From 253bf760182bf472654ef49f4a73dcce69dcf4f8 Mon Sep 17 00:00:00 2001 From: Ilia Date: Wed, 10 May 2023 17:15:52 -0400 Subject: [PATCH 01/13] Create phpunit_test_setup.sh --- .ci/phpunit_test_setup.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .ci/phpunit_test_setup.sh diff --git a/.ci/phpunit_test_setup.sh b/.ci/phpunit_test_setup.sh new file mode 100644 index 0000000000..9b5cfb2a39 --- /dev/null +++ b/.ci/phpunit_test_setup.sh @@ -0,0 +1,25 @@ +apk --no-cache add \ + php5 \ + php5-dom \ + php5-phar \ + php5-gd \ + php5-iconv \ + php5-json \ + php5-mysql \ + php5-openssl \ + php5-xml \ + php5-zlib \ + php5-curl \ + curl \ + git + +curl -sS https://getcomposer.org/installer | php5 -- --install-dir=/usr/local/bin --filename=composer +ln -s /usr/bin/php5 /usr/bin/php + +cd /tmp +git clone https://github.com/gctools-outilsgc/gcconnex.git && cd gcconnex + +composer config --no-plugins allow-plugins.composer/installers true +composer install + +cd mod && ../vendor/bin/phpunit From f73760669f200f1096cde470e1ef80a244dbe4fc Mon Sep 17 00:00:00 2001 From: Ilia Date: Thu, 11 May 2023 09:32:58 -0400 Subject: [PATCH 02/13] add junit test result output --- .ci/phpunit_test_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/phpunit_test_setup.sh b/.ci/phpunit_test_setup.sh index 9b5cfb2a39..a0f043bcdb 100644 --- a/.ci/phpunit_test_setup.sh +++ b/.ci/phpunit_test_setup.sh @@ -22,4 +22,4 @@ git clone https://github.com/gctools-outilsgc/gcconnex.git && cd gcconnex composer config --no-plugins allow-plugins.composer/installers true composer install -cd mod && ../vendor/bin/phpunit +cd mod && ../vendor/bin/phpunit --log-junit /tmp/results.xml From 20f137bf8d912cd3bb289700f6f7ce14a6287315 Mon Sep 17 00:00:00 2001 From: Phanoix Date: Wed, 17 May 2023 15:12:24 -0400 Subject: [PATCH 03/13] dockerfile for a container to run phpunit test in pipeline --- Dockerfile.phpunit | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Dockerfile.phpunit diff --git a/Dockerfile.phpunit b/Dockerfile.phpunit new file mode 100644 index 0000000000..77e5ed2013 --- /dev/null +++ b/Dockerfile.phpunit @@ -0,0 +1,39 @@ +FROM ubuntu:18.04 +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ + software-properties-common \ + && apt-get clean \ + && rm -fr /var/lib/apt/lists/* + +RUN add-apt-repository ppa:ondrej/php + +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + php5.6 \ + php5.6-gd \ + php5.6-mbstring \ + php5.6-json \ + php5.6-mysql \ + php5.6-zip \ + php5.6-xml \ + php5.6-curl \ + php5.6-opcache \ + php5.6-memcache \ + && apt-get clean \ + && rm -fr /var/lib/apt/lists/* + +RUN mkdir /app && mkdir /app/pleio && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +WORKDIR /app +COPY composer.json composer.json /app/ +COPY mod/pleio/composer.json /app/pleio/ + +ARG COMPOSER_ALLOW_SUPERUSER=1 +ARG COMPOSER_NO_INTERACTION=1 +RUN composer config --no-plugins allow-plugins.composer/installers true +RUN composer install + +WORKDIR /app/pleio +RUN composer install + From 21558733ffba9419a164367175c89a65aa79e8cd Mon Sep 17 00:00:00 2001 From: Ilia Date: Wed, 17 May 2023 15:53:51 -0400 Subject: [PATCH 04/13] Update azure-pipelines-PR.yaml --- azure-pipelines-PR.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index f72168e45b..6fc7949ec9 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -15,6 +15,18 @@ pool: vmImage: 'ubuntu-latest' + +jobs: +- job: unittests + displayName: run phpunit tests + container: phanoix/collab-pipeline:latest + steps: + - script: | + php --version + ls -l + composer install + vendor/bin/phpunit + jobs: - job: setup displayName: build and set up review site From 9fdd55557c8d06e08ea9d914dec0783ca02e0168 Mon Sep 17 00:00:00 2001 From: Ilia Date: Thu, 18 May 2023 08:35:52 -0400 Subject: [PATCH 05/13] Update azure-pipelines-PR.yaml --- azure-pipelines-PR.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index 6fc7949ec9..9580fa7b7a 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -27,7 +27,6 @@ jobs: composer install vendor/bin/phpunit -jobs: - job: setup displayName: build and set up review site steps: From 957f6e4b88c401957e92e75f8672ae2b3740661b Mon Sep 17 00:00:00 2001 From: Ilia Date: Thu, 18 May 2023 08:39:43 -0400 Subject: [PATCH 06/13] Update azure-pipelines-PR.yaml --- azure-pipelines-PR.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index 9580fa7b7a..18eed16580 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -22,7 +22,7 @@ jobs: container: phanoix/collab-pipeline:latest steps: - script: | - php --version + rm composer.lock ls -l composer install vendor/bin/phpunit From 015e9d0bf7b4343eb5573ecc3b9d86eb6667fbcb Mon Sep 17 00:00:00 2001 From: Ilia Date: Thu, 18 May 2023 08:47:20 -0400 Subject: [PATCH 07/13] Update azure-pipelines-PR.yaml --- azure-pipelines-PR.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index 18eed16580..f6f6452cef 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -23,9 +23,10 @@ jobs: steps: - script: | rm composer.lock - ls -l composer install - vendor/bin/phpunit + ls -l + ls -l ./vendor/bin/ + ./vendor/bin/phpunit - job: setup displayName: build and set up review site From a9a5aa906efd9e8237d3033456dddbb3cb1c2145 Mon Sep 17 00:00:00 2001 From: Ilia Date: Thu, 18 May 2023 08:53:02 -0400 Subject: [PATCH 08/13] Update azure-pipelines-PR.yaml --- azure-pipelines-PR.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index f6f6452cef..3f3da3d679 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -23,6 +23,7 @@ jobs: steps: - script: | rm composer.lock + composer config --no-plugins allow-plugins.composer/installers true composer install ls -l ls -l ./vendor/bin/ From 602f5fbe85302226a81af5726d27fe9d4c5db330 Mon Sep 17 00:00:00 2001 From: Ilia Date: Thu, 18 May 2023 09:07:32 -0400 Subject: [PATCH 09/13] Update azure-pipelines-PR.yaml --- azure-pipelines-PR.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index 3f3da3d679..d4163976b1 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -27,7 +27,7 @@ jobs: composer install ls -l ls -l ./vendor/bin/ - ./vendor/bin/phpunit + cd mod && ../vendor/bin/phpunit --log-junit /tmp/results.xml - job: setup displayName: build and set up review site From c5157fa66ef3c56e9cc5212f7eb7c804f10809ea Mon Sep 17 00:00:00 2001 From: Ilia Date: Thu, 18 May 2023 09:33:32 -0400 Subject: [PATCH 10/13] Update azure-pipelines-PR.yaml --- azure-pipelines-PR.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index d4163976b1..f1dee733e5 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -27,8 +27,14 @@ jobs: composer install ls -l ls -l ./vendor/bin/ - cd mod && ../vendor/bin/phpunit --log-junit /tmp/results.xml + cd mod && ../vendor/bin/phpunit --log-junit ../PHPunit_results.xml + - task: PublishTestResults@2 + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '**/PHPunit_results.xml' + testRunTitle: phpunit tests + - job: setup displayName: build and set up review site steps: From acb017d1f7acc0afd8d53a54977b24bd7864d603 Mon Sep 17 00:00:00 2001 From: Ilia Date: Thu, 18 May 2023 09:33:45 -0400 Subject: [PATCH 11/13] Update azure-pipelines-PR.yaml --- azure-pipelines-PR.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index f1dee733e5..53a062bb0f 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -34,7 +34,7 @@ jobs: testResultsFormat: 'JUnit' testResultsFiles: '**/PHPunit_results.xml' testRunTitle: phpunit tests - + - job: setup displayName: build and set up review site steps: From fa5f20ede6c9fe72dddc52e46ffaa30e0c0751b9 Mon Sep 17 00:00:00 2001 From: Ilia Date: Thu, 18 May 2023 09:45:03 -0400 Subject: [PATCH 12/13] Delete phpunit_test_setup.sh --- .ci/phpunit_test_setup.sh | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .ci/phpunit_test_setup.sh diff --git a/.ci/phpunit_test_setup.sh b/.ci/phpunit_test_setup.sh deleted file mode 100644 index a0f043bcdb..0000000000 --- a/.ci/phpunit_test_setup.sh +++ /dev/null @@ -1,25 +0,0 @@ -apk --no-cache add \ - php5 \ - php5-dom \ - php5-phar \ - php5-gd \ - php5-iconv \ - php5-json \ - php5-mysql \ - php5-openssl \ - php5-xml \ - php5-zlib \ - php5-curl \ - curl \ - git - -curl -sS https://getcomposer.org/installer | php5 -- --install-dir=/usr/local/bin --filename=composer -ln -s /usr/bin/php5 /usr/bin/php - -cd /tmp -git clone https://github.com/gctools-outilsgc/gcconnex.git && cd gcconnex - -composer config --no-plugins allow-plugins.composer/installers true -composer install - -cd mod && ../vendor/bin/phpunit --log-junit /tmp/results.xml From b7793cadc415f2f71a472a9e9e64e17bfa56716c Mon Sep 17 00:00:00 2001 From: Ilia Date: Fri, 19 May 2023 14:24:54 -0400 Subject: [PATCH 13/13] try more general trigger with conditions on jobs --- azure-pipelines-PR.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines-PR.yaml b/azure-pipelines-PR.yaml index 53a062bb0f..365058cd2e 100644 --- a/azure-pipelines-PR.yaml +++ b/azure-pipelines-PR.yaml @@ -1,5 +1,5 @@ -trigger: # don't trigger outside PRs -- none +trigger: +- '*' pr: # Trigger the pipeline only for PRs targeting master branch - master @@ -37,6 +37,7 @@ jobs: - job: setup displayName: build and set up review site + condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) # don't trigger outside PRs steps: - task: Docker@2 displayName: Build and Push Container image to ACR