From 4add298b1656b179e1598bcce5c7c970662d44c3 Mon Sep 17 00:00:00 2001 From: Edward Surov Date: Fri, 10 Nov 2023 16:53:54 +0200 Subject: [PATCH] versioning workarounds in pipeline --- .github/workflows/build.yml | 12 ++++++++++-- composer.json | 23 +++++++++++++++++++++++ phpunit.10.0.report.xml | 20 ++++++++++++++++++++ phpunit.10.0.xml | 18 ++++++++++++++++++ phpunit.report.xml | 3 ++- phpunit.xml.dist | 12 ++++++++---- test/unit/Event/EventTestTrait.php | 1 + 7 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 phpunit.10.0.report.xml create mode 100644 phpunit.10.0.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecd4d9f..a8730f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,9 +49,17 @@ jobs: ${{ matrix.composer-options }} - name: Run tests - if: ${{ matrix.os != 'windows-latest' }} + if: ${{ matrix.os != 'windows-latest' && !contains(matrix.composer-options, '--prefer-lowest') }} run: composer test + - name: Run tests (lowest) + if: ${{ matrix.os != 'windows-latest' && contains(matrix.composer-options, '--prefer-lowest') }} + run: composer test-lowest + - name: Run tests (windows) - if: ${{ matrix.os == 'windows-latest' }} + if: ${{ matrix.os == 'windows-latest' && !contains(matrix.composer-options, '--prefer-lowest') }} run: composer test-windows + + - name: Run tests (windows-lowest) + if: ${{ matrix.os == 'windows-latest' && !contains(matrix.composer-options, '--prefer-lowest') }} + run: composer test-windows-lowest diff --git a/composer.json b/composer.json index 83054a0..4068c41 100644 --- a/composer.json +++ b/composer.json @@ -60,17 +60,28 @@ "scripts": { "test-cs": "vendor/bin/phpcs -sp", "test-unit": "vendor/bin/phpunit --coverage-text", + "test-unit-lowest": "vendor/bin/phpunit --configuration=phpunit.10.0.xml --coverage-text", "clear-allure-results": "rm -rf ./build/allure-results", "test-report": [ "@clear-allure-results", "vendor/bin/paratest --processes=3 --configuration=phpunit.report.xml --testsuite=positive", "vendor/bin/paratest --processes=3 --configuration=phpunit.report.xml --testsuite=negative; exit 0" ], + "test-report-lowest": [ + "@clear-allure-results", + "vendor/bin/paratest --processes=3 --configuration=phpunit.10.0.report.xml --testsuite=positive", + "vendor/bin/paratest --processes=3 --configuration=phpunit.10.0.report.xml --testsuite=negative; exit 0" + ], "test-report-windows": [ "@clear-allure-results", "vendor/bin/paratest --processes=3 --configuration=phpunit.report.xml --testsuite=positive", "vendor/bin/paratest --processes=3 --configuration=phpunit.report.xml --testsuite=negative & exit 0" ], + "test-report-windows-lowest": [ + "@clear-allure-results", + "vendor/bin/paratest --processes=3 --configuration=phpunit.10.0.report.xml --testsuite=positive", + "vendor/bin/paratest --processes=3 --configuration=phpunit.10.0.report.xml --testsuite=negative & exit 0" + ], "test-psalm": "vendor/bin/psalm --shepherd", "test": [ "@test-cs", @@ -78,11 +89,23 @@ "@test-report", "@test-psalm" ], + "test-lowest": [ + "@test-cs", + "@test-unit-lowest", + "@test-report-lowest", + "@test-psalm" + ], "test-windows": [ "@test-cs", "@test-unit", "@test-report-windows", "@test-psalm" + ], + "test-windows-lowest": [ + "@test-cs", + "@test-unit-lowest", + "@test-report-windows-lowest", + "@test-psalm" ] } } diff --git a/phpunit.10.0.report.xml b/phpunit.10.0.report.xml new file mode 100644 index 0000000..d75feef --- /dev/null +++ b/phpunit.10.0.report.xml @@ -0,0 +1,20 @@ + + + + + test/report/Generate + test/report/Generate/NegativeTest.php + + + test/report/Generate/NegativeTest.php + + + + + + diff --git a/phpunit.10.0.xml b/phpunit.10.0.xml new file mode 100644 index 0000000..a3b5b4f --- /dev/null +++ b/phpunit.10.0.xml @@ -0,0 +1,18 @@ + + + + + test/unit/ + + + + + src/ + + + diff --git a/phpunit.report.xml b/phpunit.report.xml index 60298d5..e029ed3 100644 --- a/phpunit.report.xml +++ b/phpunit.report.xml @@ -1,8 +1,9 @@ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f7ce70a..bb56c36 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,17 +1,21 @@ test/unit/ - + - src/ + src/ - + + vendor/ + + diff --git a/test/unit/Event/EventTestTrait.php b/test/unit/Event/EventTestTrait.php index e1bc2a0..0c1bd65 100644 --- a/test/unit/Event/EventTestTrait.php +++ b/test/unit/Event/EventTestTrait.php @@ -261,6 +261,7 @@ protected function createTestWarningTriggeredEvent( 'file', 1, false, + false, ); } }