From b6e31e3664d05d35f12c3b121171b662a262bc9a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 11 Oct 2021 20:49:31 +0200 Subject: [PATCH 1/5] [ticket/16889] Disable anti spyware in windows CI builds PHPBB3-16889 --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2195ac2665..c4c91e0c2f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -542,6 +542,7 @@ jobs: psql -c 'create database phpbb_tests;' -U postgres Set-MpPreference -ExclusionPath "${env:PGDATA}" # Exclude PGDATA directory from Windows Defender Set-MpPreference -DisableRealtimeMonitoring $true + New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name DisableAntiSpyware -Value 1 -PropertyType DWORD -Force - name: Run unit tests run: | phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error From d4cb357b2634550deac9d0d88a6f793da0fcaf5c Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 17 Oct 2021 13:22:46 +0700 Subject: [PATCH 2/5] [ticket/16889] Run functional tests separately PHPBB3-16889 --- .github/workflows/tests.yml | 7 ++++--- tests/functional/extension_acp_test.php | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c4c91e0c2f..580a424915 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,7 @@ on: - 3.3.x - master - 'prep-release-*' + - 'ticket/*' tags: - 'release-*' pull_request: @@ -530,9 +531,8 @@ jobs: run: | $postgreSqlSvc = Get-Service "postgresql*" Set-Service $postgreSqlSvc.Name -StartupType manual - $postgreSqlSvc.Start() try { - (Get-Service "postgresql*").Start() + $postgreSqlSvc.Start() } catch { $_ | select * } @@ -545,4 +545,5 @@ jobs: New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name DisableAntiSpyware -Value 1 -PropertyType DWORD -Force - name: Run unit tests run: | - phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error + phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --exclude-group functional + phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --group functional diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 94ed7a35b7..2f26c53ce5 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -43,8 +43,6 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->purge_cache(); - $this->get_db(); - // Clear the phpbb_ext table $this->db->sql_query('DELETE FROM phpbb_ext'); From a12f903e93a663ea7dac83c5614dd24a2ef5c2ec Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 17 Oct 2021 09:04:26 +0200 Subject: [PATCH 3/5] [ticket/16889] Remove build on push for ticket branch again PHPBB3-16889 --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 580a424915..8fbedde8d7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,6 @@ on: - 3.3.x - master - 'prep-release-*' - - 'ticket/*' tags: - 'release-*' pull_request: From a3070bedebfe90c9a844c260f3467a0fab613141 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 17 Oct 2021 09:36:58 +0200 Subject: [PATCH 4/5] [ticket/16889] Remove invalid command for adding registry entry PHPBB3-16889 --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8fbedde8d7..f9589a1b5f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -541,7 +541,6 @@ jobs: psql -c 'create database phpbb_tests;' -U postgres Set-MpPreference -ExclusionPath "${env:PGDATA}" # Exclude PGDATA directory from Windows Defender Set-MpPreference -DisableRealtimeMonitoring $true - New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name DisableAntiSpyware -Value 1 -PropertyType DWORD -Force - name: Run unit tests run: | phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --exclude-group functional From 6af8872ef3d057fd081507501e2c45ecac2395dc Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 17 Oct 2021 10:19:34 +0200 Subject: [PATCH 5/5] [ticket/16889] Create separate runs for unit and functional tests PHPBB3-16889 --- .github/workflows/tests.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f9589a1b5f..c12570098c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -448,12 +448,24 @@ jobs: include: - php: '7.4' db: "postgres" + type: 'unit' - php: '8.0' db: "postgres" + type: 'unit' - php: '8.1' db: "postgres" + type: 'unit' + - php: '7.4' + db: "postgres" + type: 'functional' + - php: '8.0' + db: "postgres" + type: 'functional' + - php: '8.1' + db: "postgres" + type: 'functional' - name: Windows - PHP ${{ matrix.php }} - ${{ matrix.db }} + name: Windows - PHP ${{ matrix.php }} - ${{ matrix.db }} - ${{ matrix.type }} steps: - name: Prepare git for Windows @@ -542,6 +554,10 @@ jobs: Set-MpPreference -ExclusionPath "${env:PGDATA}" # Exclude PGDATA directory from Windows Defender Set-MpPreference -DisableRealtimeMonitoring $true - name: Run unit tests + if: ${{ matrix.type == 'unit' }} run: | phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --exclude-group functional + - name: Run unit tests + if: ${{ matrix.type == 'functional' }} + run: | phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --group functional