Page MenuHomePhabricator
Paste P17489

Run Selenium tests targeting MediaWiki Core in MediaWiki-Docker - Completed
ActivePublic

Authored by AghaSaad04 on Oct 15 2021, 5:49 PM.
$ git clone --depth=1 https://gerrit.wikimedia.org/r/mediawiki/core.git mediawiki
Cloning into 'mediawiki'...
remote: Counting objects: 8978, done
remote: Finding sources: 100% (8978/8978)
remote: Getting sizes: 100% (7339/7339)
remote: Compressing objects: 99% (92937/92938)
remote: Total 8978 (delta 2450), reused 4025 (delta 1638)
Receiving objects: 100% (8978/8978), 31.64 MiB | 1.64 MiB/s, done.
Resolving deltas: 100% (2450/2450), done.
Updating files: 100% (8334/8334), done.
$ export MW_SERVER=http://localhost:8080
$ export MW_SCRIPT_PATH=/w
$ export MEDIAWIKI_USER=Admin
$ export MEDIAWIKI_PASSWORD=dockerpass
$ docker-compose up -d
WARNING: The MW_DOCKER_UID variable is not set. Defaulting to a blank string.
Creating mediawiki_mediawiki-web_1 ... done
Creating mediawiki_mediawiki_1 ... done
Creating mediawiki_mediawiki-jobrunner_1 ... done
$ docker-compose exec mediawiki composer update
> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Updating dependencies (including require-dev)
Package operations: 124 installs, 0 updates, 0 removals
- Installing wikimedia/composer-merge-plugin (v2.0.1): Downloading (100%)
- Installing cssjanus/cssjanus (v2.1.0): Downloading (100%)
- Installing oojs/oojs-ui (v0.42.0): Downloading (100%)
- Installing pear/pear_exception (v1.0.2): Downloading (100%)
- Installing pear/console_getopt (v1.4.3): Downloading (100%)
- Installing pear/pear-core-minimal (v1.10.11): Downloading (100%)
- Installing pear/mail (v1.4.1): Downloading (100%)
- Installing pear/mail_mime (1.10.11): Downloading (100%)
- Installing pear/net_socket (v1.2.2): Downloading (100%)
- Installing pear/net_smtp (1.10.0): Downloading (100%)
- Installing wikimedia/base-convert (v2.0.1): Downloading (100%)
- Installing wikimedia/cdb (1.4.1): Downloading (100%)
- Installing wikimedia/cldr-plural-rule-parser (v2.0.0): Downloading (100%)
- Installing pleonasm/bloom-filter (1.0.2): Downloading (100%)
- Installing wikimedia/common-passwords (v0.3.0): Downloading (100%)
- Installing wikimedia/html-formatter (3.0.1): Downloading (100%)
- Installing wikimedia/at-ease (v2.1.0): Downloading (100%)
- Installing wikimedia/ip-set (3.0.0): Downloading (100%)
- Installing wikimedia/less.php (v3.1.0): Downloading (100%)
- Installing pear/net_url2 (v2.2.2): Downloading (100%)
- Installing wikimedia/minify (2.2.4): Downloading (100%)
- Installing wikimedia/normalized-exception (v1.0.1): Downloading (100%)
- Installing psr/log (1.1.4): Downloading (100%)
- Installing wikimedia/php-session-serializer (v2.0.0): Downloading (100%)
- Installing wikimedia/purtle (v1.0.8): Downloading (100%)
- Installing wikimedia/relpath (3.0.0): Downloading (100%)
- Installing wikimedia/request-timeout (1.1.0): Downloading (100%)
- Installing wikimedia/running-stat (v1.2.1): Downloading (100%)
- Installing wikimedia/scoped-callback (v3.0.0): Downloading (100%)
- Installing wikimedia/assert (v0.5.0): Downloading (100%)
- Installing psr/container (1.1.1): Downloading (100%)
- Installing wikimedia/services (2.0.1): Downloading (100%)
- Installing wikimedia/wikipeg (2.0.6): Downloading (100%)
- Installing monolog/monolog (2.2.0): Downloading (100%)
- Installing psr/http-message (1.0.1): Downloading (100%)
- Installing psr/http-client (1.0.1): Downloading (100%)
- Installing ralouphie/getallheaders (3.0.3): Downloading (100%)
- Installing guzzlehttp/psr7 (1.8.3): Downloading (100%)
- Installing guzzlehttp/promises (1.5.0): Downloading (100%)
- Installing guzzlehttp/guzzle (7.2.0): Downloading (100%)
- Installing wikimedia/shellbox (2.1.0): Downloading (100%)
- Installing wikimedia/utfnormal (3.0.2): Downloading (100%)
- Installing wikimedia/wait-condition-loop (v2.0.2): Downloading (100%)
- Installing wikimedia/wrappedstring (v4.0.1): Downloading (100%)
- Installing wikimedia/timestamp (v3.0.0): Downloading (100%)
- Installing wikimedia/xmp-reader (0.8.1): Downloading (100%)
- Installing zordius/lightncandy (v1.2.6): Downloading (100%)
- Installing doctrine/sql-formatter (1.1.1): Downloading (100%)
- Installing giorgiosironi/eris (0.10.0): Downloading (100%)
- Installing squizlabs/php_codesniffer (3.6.0): Downloading (100%)
- Installing sebastian/diff (3.0.3): Downloading (100%)
- Installing composer/spdx-licenses (1.5.5): Downloading (100%)
- Installing composer/semver (3.2.5): Downloading (100%)
- Installing mediawiki/mediawiki-codesniffer (v37.0.0): Downloading (100%)
- Installing tysonandre/var_representation_polyfill (0.1.1): Downloading (100%)
- Installing symfony/polyfill-php80 (v1.23.1): Downloading (100%)
- Installing symfony/polyfill-intl-normalizer (v1.23.0): Downloading (100%)
- Installing symfony/polyfill-intl-grapheme (v1.23.1): Downloading (100%)
- Installing symfony/string (v5.3.7): Downloading (100%)
- Installing symfony/service-contracts (v2.4.0): Downloading (100%)
- Installing symfony/polyfill-php73 (v1.23.0): Downloading (100%)
- Installing symfony/deprecation-contracts (v2.4.0): Downloading (100%)
- Installing symfony/console (v5.3.7): Downloading (100%)
- Installing sabre/event (5.1.2): Downloading (100%)
- Installing netresearch/jsonmapper (v4.0.0): Downloading (100%)
- Installing microsoft/tolerant-php-parser (v0.1.1): Downloading (100%)
- Installing phpdocumentor/reflection-common (2.2.0): Downloading (100%)
- Installing webmozart/assert (1.10.0): Downloading (100%)
- Installing phpdocumentor/type-resolver (1.5.1): Downloading (100%)
- Installing phpdocumentor/reflection-docblock (5.2.2): Downloading (100%)
- Installing felixfbecker/advanced-json-rpc (v3.2.1): Downloading (100%)
- Installing composer/xdebug-handler (2.0.2): Downloading (100%)
- Installing phan/phan (5.2.0): Downloading (100%)
- Installing mediawiki/phan-taint-check-plugin (3.3.2): Downloading (100%)
- Installing mediawiki/mediawiki-phan-config (0.11.0): Downloading (100%)
- Installing nmred/kafka-php (v0.1.5): Downloading (100%)
- Installing php-parallel-lint/php-console-color (v0.3): Downloading (100%)
- Installing php-parallel-lint/php-console-highlighter (v0.5): Downloading (100%)
- Installing php-parallel-lint/php-parallel-lint (v1.3.1): Downloading (100%)
- Installing seld/jsonlint (1.8.3): Downloading (100%)
- Installing wikimedia/testing-access-wrapper (2.0.0): Downloading (100%)
- Installing hamcrest/hamcrest-php (v2.0.1): Downloading (100%)
- Installing wmde/hamcrest-html-matchers (v1.0.0): Downloading (100%)
- Installing doctrine/event-manager (1.1.1): Downloading (100%)
- Installing doctrine/deprecations (v0.5.3): Downloading (100%)
- Installing doctrine/cache (2.1.1): Downloading (100%)
- Installing doctrine/dbal (2.13.3): Downloading (100%)
- Installing wikimedia/zest-css (2.0.1): Downloading (100%)
- Installing wikimedia/remex-html (2.3.2): Downloading (100%)
- Installing wikimedia/object-factory (v3.0.2): Downloading (100%)
- Installing wikimedia/ip-utils (3.0.2): Downloading (100%)
- Installing wikimedia/idle-dom (v0.10.0): Downloading (100%)
- Installing wikimedia/dodo (v0.3.0): Downloading (100%)
- Installing liuggio/statsd-php-client (v1.0.18): Downloading (100%)
- Installing wikimedia/parsoid (v0.15.0-a3): Downloading (100%)
- Installing sebastian/version (2.0.1): Downloading (100%)
- Installing sebastian/type (1.1.4): Downloading (100%)
- Installing sebastian/resource-operations (2.0.2): Downloading (100%)
- Installing sebastian/recursion-context (3.0.1): Downloading (100%)
- Installing sebastian/object-reflector (1.1.2): Downloading (100%)
- Installing sebastian/object-enumerator (3.0.4): Downloading (100%)
- Installing sebastian/global-state (3.0.1): Downloading (100%)
- Installing sebastian/exporter (3.1.3): Downloading (100%)
- Installing sebastian/environment (4.2.4): Downloading (100%)
- Installing sebastian/comparator (3.0.3): Downloading (100%)
- Installing phpunit/php-timer (2.1.3): Downloading (100%)
- Installing phpunit/php-text-template (1.2.1): Downloading (100%)
- Installing phpunit/php-file-iterator (2.0.4): Downloading (100%)
- Installing theseer/tokenizer (1.2.1): Downloading (100%)
- Installing sebastian/code-unit-reverse-lookup (1.0.2): Downloading (100%)
- Installing phpunit/php-token-stream (3.1.3): Downloading (100%)
- Installing phpunit/php-code-coverage (7.0.15): Downloading (100%)
- Installing doctrine/instantiator (1.4.0): Downloading (100%)
- Installing phpspec/prophecy (1.14.0): Downloading (100%)
- Installing myclabs/deep-copy (1.10.2): Downloading (100%)
- Installing phar-io/version (3.1.0): Downloading (100%)
- Installing phar-io/manifest (2.0.3): Downloading (100%)
- Installing phpunit/phpunit (8.5.21): Downloading (100%)
- Installing johnkary/phpunit-speedtrap (v3.3.0): Downloading (100%)
- Installing justinrainbow/json-schema (5.2.11): Downloading (100%)
- Installing nikic/php-parser (v4.13.0): Downloading (100%)
- Installing symfony/var-dumper (v5.3.8): Downloading (100%)
- Installing psy/psysh (v0.10.9): Downloading (100%)
- Installing symfony/yaml (v5.3.6): Downloading (100%)
pear/net_smtp suggests installing pear/auth_sasl (Install optionally via your project's composer.json)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing elasticsearch/elasticsearch (Allow sending log messages to an Elasticsearch server via official client)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongodb (Allow sending log messages to a MongoDB server (via driver))
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server (via library))
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
guzzlehttp/psr7 suggests installing laminas/laminas-httphandlerrunner (Emit PSR-7 responses)
giorgiosironi/eris suggests installing icomefromthenet/reverse-regex (v0.0.6.3 for the regex() Generator)
tysonandre/var_representation_polyfill suggests installing ext-var_representation (*)
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/event-dispatcher
symfony/console suggests installing symfony/lock
symfony/console suggests installing symfony/process
phan/phan suggests installing ext-ast (Needed for parsing ASTs (unless --use-fallback-parser is used). 1.0.1+ is needed, 1.0.14+ is recommended.)
phan/phan suggests installing ext-var_representation (Suggested for converting values to strings in issue messages)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
wikimedia/parsoid suggests installing wikimedia/langconv (Provides script conversion support)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0.0)
phpunit/phpunit suggests installing ext-soap (*)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating optimized autoload files
40 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
$ docker-compose exec mediawiki /bin/bash /docker/install.sh
+ php maintenance/install.php --server http://localhost:8080 --scriptpath=/w --dbtype sqlite --dbpath /var/www/html/w/cache/sqlite --lang en --pass dockerpass MediaWiki Admin
PHP 7.2.34-18+0~20210223.60+debian10~1.gbpb21322+wmf1 is installed.
Found ImageMagick: /usr/bin/convert. Image thumbnailing will be enabled if you enable uploads.
Found the Git version control software: /usr/bin/git.
Using server name "http://localhost".
Using server URL "http://localhost:8080/w".
Warning: Your default directory for uploads (/var/www/html/w/images/) is not checked for vulnerability to arbitrary script execution during the CLI install.
Using the PHP intl extension for Unicode normalization.
The environment has been checked. You can install MediaWiki.
Setting up database
done
Creating tables, step one
done
Creating tables, step two
done
Populating default interwiki table
done
Initializing statistics
done
Generating secret keys
done
Prevent running unneeded updates
done
Restoring mediawiki services
done
Creating administrator user account
done
Creating main page with default content
done
Database was successfully set up
MediaWiki has been successfully installed. You can now visit <http://localhost:8080/w> to view your wiki. If you have questions, check out our frequently asked questions list: <https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ> or use one of the support forums linked on that page.
$ unset DISPLAY
$ npm ci
added 1097 packages, and audited 1099 packages in 10s
3 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
$ npm run selenium-test
> selenium-test
> wdio ./tests/selenium/wdio.conf.js
Execution of 5 spec files started at 2021-10-15T17:16:06.238Z
[0-0] RUNNING in chrome - /tests/selenium/specs/page.js
[0-0] PASSED in chrome - /tests/selenium/specs/page.js
[0-1] RUNNING in chrome - /tests/selenium/specs/recentchanges.js
[0-1] PASSED in chrome - /tests/selenium/specs/recentchanges.js
[0-2] RUNNING in chrome - /tests/selenium/specs/user.js
[0-2] PASSED in chrome - /tests/selenium/specs/user.js
[0-3] RUNNING in chrome - /tests/selenium/specs/watchlist.js
[0-3] PASSED in chrome - /tests/selenium/specs/watchlist.js
[0-4] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
[0-4] PASSED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
"dot" Reporter:
..............
Spec Files: 5 passed, 5 total (100% completed) in 00:00:38
OS and tools versions:
$ npm -v
7.8.0
$ node -v
v10.24.0
$ docker -v
Docker version 20.10.9, build c2ea9bc
$ docker-compose -v
docker-compose version 1.25.0, build unknown
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal