Skip to content

Commit 1e1db62

Browse files
committed
Add helpers for running and viewing pcov code coverage
1 parent 6a2e1cc commit 1e1db62

File tree

11 files changed

+194
-2
lines changed

11 files changed

+194
-2
lines changed

compose/nginx.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ services:
1515
volumes:
1616
- ${LOCAL_SRC}:${REMOTE_SRC}
1717
- totara-data:${REMOTE_DATA}
18+
- coverage-report:/var/www/totara/coverage-report
1819
depends_on:
1920
- maildev
2021
networks:
@@ -66,4 +67,5 @@ services:
6667
- totara83.behat.totaralms.com
6768

6869
volumes:
69-
totara-data:
70+
totara-data:
71+
coverage-report:

compose/php.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ services:
422422
- ${LOCAL_SRC}:${REMOTE_SRC}
423423
- totara-data:${REMOTE_DATA}
424424
- ./php/includes:/var/www/totara/includes
425+
- coverage-report:/var/www/totara/coverage-report
425426
- bash-history:/root/.bash_history
426427
- zsh-history:/root/.zsh_history
427428
- ./shell:/root/custom_shell
@@ -448,6 +449,7 @@ services:
448449
- ${LOCAL_SRC}:${REMOTE_SRC}
449450
- totara-data:${REMOTE_DATA}
450451
- ./php/includes:/var/www/totara/includes
452+
- coverage-report:/var/www/totara/coverage-report
451453
- bash-history:/root/.bash_history
452454
- zsh-history:/root/.zsh_history
453455
- ./shell:/root/custom_shell
@@ -483,6 +485,7 @@ services:
483485
- ${LOCAL_SRC}:${REMOTE_SRC}
484486
- totara-data:${REMOTE_DATA}
485487
- ./php/includes:/var/www/totara/includes
488+
- coverage-report:/var/www/totara/coverage-report
486489
- bash-history:/root/.bash_history
487490
- zsh-history:/root/.zsh_history
488491
- ./shell:/root/custom_shell
@@ -509,6 +512,7 @@ services:
509512
- ${LOCAL_SRC}:${REMOTE_SRC}
510513
- totara-data:${REMOTE_DATA}
511514
- ./php/includes:/var/www/totara/includes
515+
- coverage-report:/var/www/totara/coverage-report
512516
- bash-history:/root/.bash_history
513517
- zsh-history:/root/.zsh_history
514518
- ./shell:/root/custom_shell
@@ -543,6 +547,7 @@ services:
543547
- ${LOCAL_SRC}:${REMOTE_SRC}
544548
- totara-data:${REMOTE_DATA}
545549
- ./php/includes:/var/www/totara/includes
550+
- coverage-report:/var/www/totara/coverage-report
546551
- bash-history:/root/.bash_history
547552
- zsh-history:/root/.zsh_history
548553
- ./shell:/root/custom_shell
@@ -569,6 +574,7 @@ services:
569574
- ${LOCAL_SRC}:${REMOTE_SRC}
570575
- totara-data:${REMOTE_DATA}
571576
- ./php/includes:/var/www/totara/includes
577+
- coverage-report:/var/www/totara/coverage-report
572578
- bash-history:/root/.bash_history
573579
- zsh-history:/root/.zsh_history
574580
- ./shell:/root/custom_shell
@@ -601,6 +607,7 @@ services:
601607
- ${LOCAL_SRC}:${REMOTE_SRC}
602608
- totara-data:${REMOTE_DATA}
603609
- ./php/includes:/var/www/totara/includes
610+
- coverage-report:/var/www/totara/coverage-report
604611
- bash-history:/root/.bash_history
605612
- zsh-history:/root/.zsh_history
606613
- ./shell:/root/custom_shell
@@ -639,6 +646,7 @@ services:
639646
- ${LOCAL_SRC}:${REMOTE_SRC}
640647
- totara-data:${REMOTE_DATA}
641648
- ./php/includes:/var/www/totara/includes
649+
- coverage-report:/var/www/totara/coverage-report
642650
- bash-history:/root/.bash_history
643651
- zsh-history:/root/.zsh_history
644652
- ./shell:/root/custom_shell
@@ -659,6 +667,7 @@ services:
659667
- ${LOCAL_SRC}:${REMOTE_SRC}
660668
- totara-data:${REMOTE_DATA}
661669
- ./php/includes:/var/www/totara/includes
670+
- coverage-report:/var/www/totara/coverage-report
662671
- bash-history:/root/.bash_history
663672
- zsh-history:/root/.zsh_history
664673
- ./shell:/root/custom_shell
@@ -697,6 +706,7 @@ services:
697706
- ${LOCAL_SRC}:${REMOTE_SRC}
698707
- totara-data:${REMOTE_DATA}
699708
- ./php/includes:/var/www/totara/includes
709+
- coverage-report:/var/www/totara/coverage-report
700710
- bash-history:/root/.bash_history
701711
- zsh-history:/root/.zsh_history
702712
- ./shell:/root/custom_shell
@@ -717,6 +727,7 @@ services:
717727
- ${LOCAL_SRC}:${REMOTE_SRC}
718728
- totara-data:${REMOTE_DATA}
719729
- ./php/includes:/var/www/totara/includes
730+
- coverage-report:/var/www/totara/coverage-report
720731
- bash-history:/root/.bash_history
721732
- zsh-history:/root/.zsh_history
722733
- ./shell:/root/custom_shell
@@ -755,6 +766,7 @@ services:
755766
- ${LOCAL_SRC}:${REMOTE_SRC}
756767
- totara-data:${REMOTE_DATA}
757768
- ./php/includes:/var/www/totara/includes
769+
- coverage-report:/var/www/totara/coverage-report
758770
- bash-history:/root/.bash_history
759771
- zsh-history:/root/.zsh_history
760772
- ./shell:/root/custom_shell
@@ -775,6 +787,7 @@ services:
775787
- ${LOCAL_SRC}:${REMOTE_SRC}
776788
- totara-data:${REMOTE_DATA}
777789
- ./php/includes:/var/www/totara/includes
790+
- coverage-report:/var/www/totara/coverage-report
778791
- bash-history:/root/.bash_history
779792
- zsh-history:/root/.zsh_history
780793
- ./shell:/root/custom_shell
@@ -811,6 +824,7 @@ services:
811824
- ${LOCAL_SRC}:${REMOTE_SRC}
812825
- totara-data:${REMOTE_DATA}
813826
- ./php/includes:/var/www/totara/includes
827+
- coverage-report:/var/www/totara/coverage-report
814828
- bash-history:/root/.bash_history
815829
- zsh-history:/root/.zsh_history
816830
- ./shell:/root/custom_shell
@@ -819,5 +833,6 @@ services:
819833

820834
volumes:
821835
totara-data:
836+
coverage-report:
822837
bash-history:
823838
zsh-history:

nginx/config/default.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,16 @@ server {
1515

1616
include totara-remote-server.conf;
1717
}
18+
19+
# PCOV code coverage report
20+
server {
21+
listen 80;
22+
server_name coverage-report.localhost;
23+
24+
root /var/www/totara/coverage-report;
25+
index index.html;
26+
27+
location / {
28+
try_files $uri $uri/ =404;
29+
}
30+
}

php/php73/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
3131
aspell \
3232
libldap2-dev \
3333
libltdl-dev \
34+
xmlstarlet \
3435
&& docker-php-ext-install -j$(nproc) xmlrpc \
3536
zip \
3637
intl \
@@ -73,6 +74,10 @@ RUN pecl install -o -f memcached \
7374
&& rm -rf /tmp/pear \
7475
&& docker-php-ext-enable memcached
7576

77+
RUN pecl install -o -f pcov \
78+
&& rm -rf /tmp/pear \
79+
&& docker-php-ext-enable pcov
80+
7681
# we need en_US locales for MSSQL connection to work
7782
# we need en_AU locales for behat to work
7883
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \

php/php74/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
2929
aspell \
3030
libldap2-dev \
3131
libltdl-dev \
32+
xmlstarlet \
3233
&& docker-php-ext-install -j$(nproc) xmlrpc \
3334
zip \
3435
intl \
@@ -68,6 +69,10 @@ RUN pecl install -o -f memcached \
6869
&& rm -rf /tmp/pear \
6970
&& docker-php-ext-enable memcached
7071

72+
RUN pecl install -o -f pcov \
73+
&& rm -rf /tmp/pear \
74+
&& docker-php-ext-enable pcov
75+
7176
# we need en_US locales for MSSQL connection to work
7277
# we need en_AU locales for behat to work
7378
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \

php/php80/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
2929
aspell \
3030
libldap2-dev \
3131
libltdl-dev \
32+
xmlstarlet \
3233
&& docker-php-ext-install -j$(nproc) \
3334
zip \
3435
intl \
@@ -68,6 +69,10 @@ RUN pecl install -o -f memcached \
6869
&& rm -rf /tmp/pear \
6970
&& docker-php-ext-enable memcached
7071

72+
RUN pecl install -o -f pcov \
73+
&& rm -rf /tmp/pear \
74+
&& docker-php-ext-enable pcov
75+
7176
# we need en_US locales for MSSQL connection to work
7277
# we need en_AU locales for behat to work
7378
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \

php/php81/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
3030
libldap2-dev \
3131
libltdl-dev \
3232
libpspell-dev \
33+
xmlstarlet \
3334
&& docker-php-ext-install -j$(nproc) \
3435
zip \
3536
intl \
@@ -74,6 +75,10 @@ RUN pecl install -o -f excimer \
7475
&& rm -rf /tmp/pear \
7576
&& docker-php-ext-enable excimer
7677

78+
RUN pecl install -o -f pcov \
79+
&& rm -rf /tmp/pear \
80+
&& docker-php-ext-enable pcov
81+
7782
# we need en_US locales for MSSQL connection to work
7883
# we need en_AU locales for behat to work
7984
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \

php/php82/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
3030
libldap2-dev \
3131
libltdl-dev \
3232
libpspell-dev \
33+
xmlstarlet \
3334
&& docker-php-ext-install -j$(nproc) \
3435
zip \
3536
intl \
@@ -74,6 +75,10 @@ RUN pecl install -o -f excimer \
7475
&& rm -rf /tmp/pear \
7576
&& docker-php-ext-enable excimer
7677

78+
RUN pecl install -o -f pcov \
79+
&& rm -rf /tmp/pear \
80+
&& docker-php-ext-enable pcov
81+
7782
# we need en_US locales for MSSQL connection to work
7883
# we need en_AU locales for behat to work
7984
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \

php/php83/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
3030
libldap2-dev \
3131
libltdl-dev \
3232
libpspell-dev \
33+
xmlstarlet \
3334
&& docker-php-ext-install -j$(nproc) \
3435
zip \
3536
intl \
@@ -74,6 +75,10 @@ RUN pecl install -o -f excimer \
7475
&& rm -rf /tmp/pear \
7576
&& docker-php-ext-enable excimer
7677

78+
RUN pecl install -o -f pcov \
79+
&& rm -rf /tmp/pear \
80+
&& docker-php-ext-enable pcov
81+
7782
# we need en_US locales for MSSQL connection to work
7883
# we need en_AU locales for behat to work
7984
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \

php/php84/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
3434
libkrb5-dev \
3535
libssl-dev \
3636
libpspell-dev \
37+
xmlstarlet \
3738
&& docker-php-ext-install -j$(nproc) \
3839
zip \
3940
intl \
@@ -87,6 +88,10 @@ RUN pecl install -o -f excimer \
8788
&& rm -rf /tmp/pear \
8889
&& docker-php-ext-enable excimer
8990

91+
RUN pecl install -o -f pcov \
92+
&& rm -rf /tmp/pear \
93+
&& docker-php-ext-enable pcov
94+
9095
# we need en_US locales for MSSQL connection to work
9196
# we need en_AU locales for behat to work
9297
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \

0 commit comments

Comments
 (0)