Page MenuHomePhabricator

Phester: Allow tests to be skipped
Closed, InvalidPublic


It would be useful to have a mechanism to automatically skip tests when a required functionality is unavailable. E.g.

  • tests for file uploads could be skipped if file uploads are unavailable.
  • tests for wikibase data inclusion could be skipped if no data repo is configured
  • tests ensuring the compatibility of two extensions should be skipped if one of the two extensions is not present.

Skipping would be done by a precondition check. A precondition is an interaction sequence (just like a setup sequence or a fixture sequence), with the distinction that the test is skipped, not failed, when the assertions in the interaction fail.

Adding a precondition key to a test suite that works similar to the setup key would be simple.

Ideally, we could also have a precondition in a fixture; if that precondition fails, any test suite requiring that fixture would be skipped (instead of failing).