Jump to content

Topic on Talk:MediaWiki API integration tests

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"