Run PHPUnit test in random order by default

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2021-06-13 12:40:11 -03:00
parent ce2f6edec6
commit d544080187
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
2 changed files with 6 additions and 44 deletions

View File

@ -181,46 +181,6 @@ jobs:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: build/logs/clover.xml
test-php-random:
name: Test (random) on php ${{ matrix.php-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
php-version: ["7.4"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Generate mo files
run: ./scripts/generate-mo --quiet
- name: Use php ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, iconv, mysqli, zip, gd, bz2
- name: Get Composer cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-
- name: Install dependencies
run: composer install
- name: Run random php tests
# This one is allowed to fail, but we hope it will not
continue-on-error: true
run: composer run phpunit -- --exclude-group selenium --order-by=random --stop-on-failure
test-js:
name: Test javascript files
runs-on: ubuntu-latest

View File

@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
bootstrap="test/bootstrap-dist.php"
forceCoversAnnotation="true"
colors="true"
verbose="true">
forceCoversAnnotation="true"
verbose="true"
executionOrder="random"
>
<php>
<const name="PHPMYADMIN" value="1"/>
<const name="TESTSUITE" value="1"/>