Page MenuHomePhabricator

Create a user guide for how to implement spec testing for API accuracy
Open, LowPublic5 Estimated Story Points

Description

Description

One of the key values of creating OpenAPI specs is the ability to implement automated testing against them. This form of testing ensures the accuracy of the spec, while acting as a gating mechanism to catch any unexpected breaking changes. While we are not yet fully enforcing this form of testing for all APIs, we should have a user guide that outlines how to set up such testing, so that API maintainers can reference it in the future.

Conditions of acceptance

  • Create a user guide for how to implement mocha tests that verify spec accuracy.
  • Tests should focus on verifying that defined JSON responses match actual responses returned by the API itself.
  • Tests are assumed to run as part of CI, so that unexpected breaking changes are caught before release.
  • Include references to existing tests, implemented for MediaWiki REST APIs, as examples.
  • Document any known gaps or challenges with specific types of endpoints (for example, verifying media responses)
  • Review the guide with the team.
  • Publish to mediawiki.org

Event Timeline

HCoplin-WMF set the point value for this task to 5.May 21 2026, 3:31 PM

Notes from estimation:

  • We might want to consider making an AI skill for this, as well
  • Reference guides for how to make documentation more AI-friendly (Halley is looking into this and can help :) )
  • Adding to existing integration tests is fairly boilerplate (and easy to describe because of that), but there are some nuances that have to be customized.
  • Consider having actual testers use the guide (probably within our team, to build expertise).
BPirkle subscribed.