-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(tests) Check how outdated are dependencies of Selenium testsuite
- Loading branch information
1 parent
a2f065f
commit 7099047
Showing
4 changed files
with
29 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,182 +1,12 @@ | ||
name: Run PHPUnit testsuite | ||
name: Run Selenium testsuite | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
env: | ||
PARALLEL_PHPUNIT_TESTS: 4 | ||
DBNAME: testwiki | ||
DBPASS: "123456" | ||
MEDIAWIKI_USER: "Moderator User" | ||
MEDIAWIKI_PASSWORD: "123456" | ||
|
||
jobs: | ||
# Job #1: PHPUnit testsuite (unit tests + integration tests) | ||
phpunit: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [8.1] | ||
branch: [REL1_39, REL1_40, REL1_41, REL1_42, REL1_43] | ||
dbtype: [mysql, postgres] | ||
env: | ||
branch: ${{ matrix.branch }} | ||
DBTYPE: ${{ matrix.dbtype }} | ||
runs-on: ubuntu-24.04 | ||
services: | ||
memcached: | ||
image: memcached:latest | ||
ports: | ||
- 11211:11211 | ||
options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5 | ||
mariadb: | ||
image: mariadb:11.4 | ||
env: | ||
MYSQL_ROOT_PASSWORD: ${{ env.DBPASS }} | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
postgres: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_USER: root | ||
POSTGRES_PASSWORD: ${{ env.DBPASS }} | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
buildcache | ||
key: buildcache-${{ env.branch }}-${{ hashFiles('**/no/files/need/to/invalidate/cache/for/now') }} | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: mbstring, intl, opcache, mysqli | ||
tools: composer | ||
ini-values: zend.enable_gc=Off, opcache.enable_cli=1, opcache.file_cache="/dev/shm", opcache.file_cache_only=1, opcache.file_cache_consistency_checks=0, opcache.validate_timestamps=0 | ||
- name: (debug) Print "php -i" | ||
run: php -i | ||
- uses: edwardspec/github-action-build-mediawiki@v1 | ||
with: | ||
branch: ${{ env.branch }} | ||
extraLocalSettings: tests/travis/ModerationSettings.php | ||
extensions: "AbuseFilter CheckUser Echo MobileFrontend PageForms VisualEditor" | ||
skins: "MinervaNeue" | ||
dbtype: ${{ env.DBTYPE }} | ||
dbname: ${{ env.DBNAME }} | ||
dbpass: ${{ env.DBPASS }} | ||
dbserver: ${{ env.DBTYPE == 'mysql' && '127.0.0.1:3306' || '127.0.0.1' }} | ||
|
||
- name: Finalize the installation of MediaWiki | ||
run: | | ||
cp -fv tests/travis/my.cnf ~/.my.cnf | ||
cp -fv tests/travis/pgpass.conf ~/.pgpass | ||
chmod 0600 ~/.my.cnf ~/.pgpass | ||
rsync -a --exclude buildcache --exclude mediawiki --exclude .git . mediawiki/extensions/Moderation/ | ||
cd mediawiki && echo 'DELETE FROM recentchanges;' | php maintenance/sql.php | ||
( cd extensions/AbuseFilter && composer update --no-dev ) | ||
WITH_ECHO=1 php maintenance/update.php --quick | ||
php maintenance/createAndPromote.php "$MEDIAWIKI_USER" "$MEDIAWIKI_PASSWORD" --custom-groups moderator,automoderated | ||
( cd extensions/Moderation && composer install ${{ matrix.php == '8.0' && '--ignore-platform-reqs' || '' }} ) | ||
echo '{{CURRENTVERSION}}' | php maintenance/parse.php | ||
( cd extensions/Moderation/tests/phpunit/consequence && ln -sv ../unit/*Test.php . ) | ||
# Start by running non-blackbox unit tests that can use temporary DB tables. | ||
# These tests are much faster than the integration testsuite. | ||
- name: Run non-blackbox unit tests (very fast) | ||
run: cd mediawiki && php tests/phpunit/phpunit.php extensions/Moderation/tests/phpunit/consequence/ | ||
|
||
# Run all tests. | ||
- name: Run integration tests (blackbox) | ||
run: cd mediawiki && PHPUNIT_USE_NORMAL_TABLES=1 php tests/phpunit/phpunit.php extensions/Moderation/tests/phpunit/blackbox | ||
- name: Run integration tests (decoupled) | ||
run: cd mediawiki && PHPUNIT_USE_NORMAL_TABLES=1 php tests/phpunit/phpunit.php extensions/Moderation/tests/phpunit/decoupled | ||
|
||
# Job #2: phpcs, parallel-lint, etc. | ||
# Run eslint (JavaScript linter) | ||
linter: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
tools: composer | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/.composer/cache | ||
key: buildcache-linter | ||
- name: Install dependencies | ||
run: composer install && npm install | ||
- run: composer test | ||
- run: npm install | ||
- run: npm test | ||
|
||
# Job #3: Phan (PHP static analyzer) | ||
phan: | ||
runs-on: ubuntu-24.04 | ||
env: | ||
branch: REL1_43 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
extensions: ast | ||
tools: composer | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.composer/cache | ||
buildcache | ||
key: buildcache-phan | ||
- uses: edwardspec/github-action-build-mediawiki@v1 | ||
with: | ||
branch: ${{ env.branch }} | ||
noinstall: 1 | ||
extensions: "AbuseFilter CheckUser Echo MobileFrontend PageForms VisualEditor" | ||
skins: "MinervaNeue" | ||
- name: Install dependencies | ||
run: | | ||
rsync -a --exclude buildcache --exclude mediawiki --exclude .git . mediawiki/extensions/Moderation/ | ||
cd mediawiki/extensions/Moderation | ||
composer install | ||
- name: RUN -- phan | ||
run: cd mediawiki/extensions/Moderation && ./vendor/bin/phan --analyze-twice | ||
|
||
# Job #4: Phan (PHP static analyzer) with PHAN_CHECK_TESTSUITE=1 | ||
phan-testsuite: | ||
if: ${{ github.ref == 'refs/heads/phpunit' }} | ||
runs-on: ubuntu-24.04 | ||
env: | ||
branch: REL1_43 | ||
PHAN_CHECK_TESTSUITE: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
extensions: ast | ||
tools: composer | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.composer/cache | ||
buildcache | ||
key: buildcache-phan | ||
- uses: edwardspec/github-action-build-mediawiki@v1 | ||
with: | ||
branch: ${{ env.branch }} | ||
noinstall: 1 | ||
extensions: "AbuseFilter CheckUser Echo MobileFrontend PageForms VisualEditor" | ||
skins: "MinervaNeue" | ||
- name: Install dependencies | ||
run: | | ||
rsync -a --exclude buildcache --exclude mediawiki --exclude .git . mediawiki/extensions/Moderation/ | ||
cd mediawiki/extensions/Moderation | ||
composer install | ||
# Workaround incorrect annotation of with() method in PHPUnit 9 (used in MediaWiki 1.43) | ||
# to avoid over 100 false positive Phan warnings. | ||
sed -i '/@param mixed\[\] \$arguments/d' ../../vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php | ||
- name: RUN -- phan | ||
run: cd mediawiki/extensions/Moderation && ./vendor/bin/phan --analyze-twice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
{ | ||
"private": true, | ||
"devDependencies": { | ||
"@wdio/cli": "^5.10.0", | ||
"@wdio/local-runner": "^5.10.4", | ||
"@wdio/mocha-framework": "^5.10.1", | ||
"@wdio/sauce-service": "^5.9.3", | ||
"@wdio/selenium-standalone-service": "^5.16.5", | ||
"@wdio/spec-reporter": "^5.9.3", | ||
"@wdio/sync": "^5.10.1", | ||
"bluebird": "^3.5.1", | ||
"chai": "^3.5.0", | ||
"chromedriver": "^75.0.0", | ||
"deepmerge": "^1.5.2", | ||
"fs-ext": "^1.2.1", | ||
"mocha": "^5.2.0", | ||
"mwbot": "^1.0.10", | ||
"request": "^2.75.0", | ||
"url": "^0.11.0", | ||
"wdio-chromedriver-service": "^5.0.2", | ||
"wdio-mediawiki": "^0.3.0" | ||
"@wdio/cli": "^6.6.3", | ||
"@wdio/local-runner": "^6.6.3", | ||
"@wdio/mocha-framework": "^6.6.3", | ||
"@wdio/spec-reporter": "^6.6.3", | ||
"@wdio/sync": "^6.6.3", | ||
"bluebird": "^3.7.2", | ||
"chai": "^5.1.2", | ||
"deepmerge": "^4.3.1", | ||
"fs-ext": "^2.1.1", | ||
"mocha": "^11.0.1", | ||
"mwbot": "^2.1.3", | ||
"request": "^2.88.2", | ||
"url": "^0.11.4", | ||
"wdio-mediawiki": "^2.5.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters