Skip to content

[feat] Add support for marking tests as expected failures #3481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

vkarak
Copy link
Contributor

@vkarak vkarak commented May 15, 2025

The main elements introduced by this PR are:

  1. The @xfail decorator to mark a test as an expected sanity failure.
  2. The xfail() builtin to mark reference tuples as expected performance failures.

Two new test states are introduced which are also logged: XFAIL for expected failures and XPASS for unexpected passes.

Design-wise the concept is the same as the one explained in #2378.

Implementation-wise there are two major changes:

  1. The execution policies code is refactored by eliminating code duplication between the serial and asynchronous policies.
  2. A new utility function reference_bounds() is introduced which is used to validate and calculate the absolute lower/upper bounds. This used to be internal to assert_reference() and now it's made public (maybe the docs there need a slight reorganization).
  3. The treatment of performance failures is rewritten as now we have to handle much more complex cases, were the performance variables of a test can simultaneously be pass, fail, xpass or xfail.

For more details on how feature works macroscopically check the tutorial and the reference docs.

Closes #2378.

@vkarak vkarak force-pushed the feat/expected-failures branch from 7bbb18a to 0d5b5e4 Compare May 15, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Support marking a test as an expected failure
1 participant