The Wikimedia Foundation Core Platform Team has recently begun adding API integration tests to its Action API. MediaWiki is the wiki software that powers MediaWiki. The purpose of this project is to allow refactoring of MediaWiki with more confidence without fear of breaking the API.
The initial testing framework and a subset of tests have been set-up by the Core Platform Team, however, the Action API has many more tests than are currently covered. This proposed internship is to expand upon those tests so a greater portion of the code is covered.
Tasks will all be tests related to the API Integration Tests, beginning with a more simple subset and increasingly become more complex depending on how the previous tasks go.
For more information about the work done so far and future planned work review: https://www.mediawiki.org/wiki/Core_Platform_Team/Initiatives/Add_API_integration_tests
Getting started instructions
- Read the following:
- The project overview with examples on how to write tests: https://www.mediawiki.org/wiki/MediaWiki_API_Integration_Tests
- The README: https://github.com/wikimedia/mediawiki-tools-api-testing/blob/master/README.md
- Set up your MediaWiki Docker environment: https://github.com/addshore/mediawiki-docker-dev
- Set up a Gerrit account: https://www.mediawiki.org/wiki/Gerrit
- Login to Gerrit and follow the steps to clone the API-testing repository: https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/tools/api-testing
- Follow the steps to install your dependencies and run current tests against your Mediawiki Docker dev:
- Pick one of the microtasks as your first test
- A few things to note:
- All of the tests can be found in the test directory (this is also where you'll be adding your test)
- The fixtures module (fixtures.js) provides you with a number of different clients (users) that have different permissions set and can interact as real user accounts would
- Fixtures must not be modified. Any resource (user or page) that you want to modify needs to be created specifically for the given test and must use a randomized name. Look at how other tests use new api.Client() and the account() method to do that
- A few things to note:
- Once you've written your test publish your contribution to Gerrit and tag the mentors as reviewers
Please reach out to any of the mentors if you run into issues or have questions about the instructions.