Page MenuHomePhabricator

mediawiki-docker test feature
Open, Needs TriagePublic

Description

Add the ability to run tests for mw/core using the cli

Acceptance criteria:

  • running 'mw docker test php':
    • runs all php tests
    • outputs the results to stdout
  • running 'mw docker test php /path/to/test/':
    • runs a specific php test
    • outputs the results to stdout
  • running 'mw docker test selenium':
    • runs npm ci
    • runs selenium tests
    • uses Fresh container
    • outputs results to stdout
  • API tests?

Event Timeline

jeena created this task.Sep 9 2020, 4:17 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 9 2020, 4:17 AM

Is this going to run in quibble?
in mwdd-v1 I decided to instead of having a generic "test" command, have multiple commands for interacting with the many different testing containers.

You can see these at https://github.com/addshore/mediawiki-docker-dev/tree/v1/docker-compose such as fresh, quibble, composer.
There is a phpmyadmin command, but this just runs inside the main mediawiki container image, perhaps that is the equivalent of this "test" command?

My two cents would be to avoid doing this, because it's quite complicated and in the end I think for this type of thing, the user is better off learning how to run the various test commands themselves. From this section https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/master/DEVELOPERS.md#running-tests, I think we could instruct users how to open a shell into the mediawiki/PHP container (T262370 basically), and for Selenium and API tests the fresh-node instructions seem fine, unless we install nodejs in the mediawiki container and in that case the instructions would be to shell exec, then follow the README for tests/selenium or tests/api-testing, etc.

jeena added a comment.Sep 23 2020, 6:04 AM

We could do task T262370 and update the instructions, while keeping @Addshore 's idea in mind for after we accomplish some of the other tasks. How does that sound?

I think quibble is a nice to have, but should be pushed further down the line.
I like the layout of the commands discussed in the description and also the "automagic" switching to the appropriate container based on if "php" is specified or "npm" for example, switching between some php image, or fresh for example.
This is different to mwdd-v1 and I like it (it exposes the idea of "fresh" https://github.com/addshore/mediawiki-docker-dev/tree/4d380cf638bc60b5b6c22853a199639a3eb70b0b#mediawiki-fresh )