Talk:MediaWiki API integration tests

About this board

Lucas Werkmeister (WMDE) (talkcontribs)

Is there a standard place to put integration tests for extensions? The “Writing tests” section currently only mentions two directories in MediaWiki core.

CAndrew (WMF) (talkcontribs)

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


Lucas Werkmeister (WMDE) (talkcontribs)

Great, thanks!

Reply to "Extension tests"

Tests depending on wiki configuration

2
Lucas Werkmeister (WMDE) (talkcontribs)

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.

CAndrew (WMF) (talkcontribs)
Reply to "Tests depending on wiki configuration"
There are no older topics
Return to "MediaWiki API integration tests" page.