Is there a standard place to put integration tests for extensions? The “Writing tests” section currently only mentions two directories in MediaWiki core.
Talk:MediaWiki API integration tests
Appearance
We expect extensions to follow the same format as Core but we will update the documentation with a section for extensions. In the meantime, extensions should be adding the api-testing and mocha npm packages, .api-testing.config.json (for local testing), adding all the tests to tests/api-testing
directory of the extension, and adding an api-testing
script to package.json.
The changes made in this extension can be used as an example: https://github.com/wikimedia/mediawiki-extensions-EventBus/commit/f19769a0ece90664f3133b8abb086c75c8a97333
Also because of some earlier issues, the CI by default doesn't run the api-testing script on extensions. So extensions would need to also update the CI. Here is an example: https://gerrit.wikimedia.org/r/c/integration/config/+/575316
Great, thanks!
Are there any standard patterns for tests that need to set some wiki configuration, or depend on wiki configuration to run? For instance, a test for a feature that’s behind a feature flag and disabled by default.
We currently don't have something like that but it could be added as part of the work to disable certain tests depending on extensions: https://phabricator.wikimedia.org/T243977
There are no older topics