From eebf8c12da358c7bddce318683d5b524b6064564 Mon Sep 17 00:00:00 2001 From: gggeek Date: Wed, 23 Nov 2022 16:49:42 +0000 Subject: [PATCH] WIP CI test fixes --- .github/workflows/ci.yml | 27 ++++++++++++++++++--------- tests/PolyfillTestCase.php | 2 +- tests/PolyfillTestCase7.php | 2 +- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8fde51c..b2de2bd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,8 +28,9 @@ jobs: # @todo enable testing on php 5.3 - it requires use an older version of phpunit (and no yoast/phpunit-polyfills?) php: ['8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4'] steps: - - - uses: actions/checkout@v2 + - name: checkout code + uses: actions/checkout@v2 + # Although this action is useful, we prefer to use the same script to set up php that we use for the # docker image used for local testing. This allows us to make sure that script is always in good shape #- @@ -41,7 +42,8 @@ jobs: # #tools: phpunit/phpunit:a_version_compatible_with_php_5.3-5.5 # # NB: this disables xdebug completely # coverage: none - - + + - name: env setup # @todo add env setup scripts for windows run: | chmod 755 ./tests/ci/setup/*.sh @@ -50,29 +52,36 @@ jobs: sudo --preserve-env=GITHUB_ACTIONS ./tests/ci/setup/setup_privoxy.sh sudo --preserve-env=GITHUB_ACTIONS ./tests/ci/setup/setup_php.sh ${{ matrix.php }} sudo --preserve-env=GITHUB_ACTIONS ./tests/ci/setup/setup_composer.sh + # Avoid downloading composer deps on every workflow. Is this useful/working for us? #- # uses: actions/cache@v2 # with: # path: /tmp/composer-cache # key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} - - + + - name: composer install run: 'composer install' - - + + - name: run tests and upload coverage if: ${{ matrix.php == '7.4' }} run: | ./tests/ci/setup/setup_code_coverage.sh enable ./vendor/bin/phpunit -v --coverage-clover=coverage.clover tests if [ -f coverage.clover ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi - - + + - name: run tests if: ${{ matrix.php != '7.4' }} run: './vendor/bin/phpunit -v tests' # @todo would it be useful to run a 2nd test with composer --prefer-lowest? After all the only dependencies we have are testing tools - - + + - name: test python demo files run: 'python3 demo/client/python/test.py' - - + + - name: test perl demo files run: 'perl demo/client/perl/test.pl' - - + + - name: failure troubleshooting if: ${{ failure() }} run: | #env diff --git a/tests/PolyfillTestCase.php b/tests/PolyfillTestCase.php index 4de58f1b..0899ee9d 100644 --- a/tests/PolyfillTestCase.php +++ b/tests/PolyfillTestCase.php @@ -14,7 +14,7 @@ if ( class_exists( 'PHPUnit_Runner_BaseTestRunner' ) === true class_alias( 'PHPUnit_Runner_BaseTestRunner', 'PHPUnit\Runner\BaseTestRunner' ); } -if (class_exists('PHPUnit_Version') === false || version_compare(PHPUnit_Version::id(), '8.0.0', '<')) { +if (class_exists('PHPUnit\Runner\Version') === false || version_compare(PHPUnit_Version::id(), '8.0.0', '<')) { include_once __DIR__ . '/PolyfillTestCase7.php'; } else { include_once __DIR__ . '/PolyfillTestCase8.php'; diff --git a/tests/PolyfillTestCase7.php b/tests/PolyfillTestCase7.php index d54d6b24..112f6066 100644 --- a/tests/PolyfillTestCase7.php +++ b/tests/PolyfillTestCase7.php @@ -16,6 +16,6 @@ abstract class PhpXmlRpc_PolyfillTestCase extends TestCase public static function fail($message = '') { static::_fail($message); - self::fail($message); + parent::fail($message); } } -- 2.47.0