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 3 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 added this to the ReFrame 4.9 milestone May 15, 2025
@vkarak vkarak requested review from ekouts, victorusu and teojgo May 15, 2025 14:08
@vkarak vkarak self-assigned this May 15, 2025
@vkarak vkarak force-pushed the feat/expected-failures branch from 7bbb18a to 0d5b5e4 Compare May 15, 2025 14:10
@vkarak vkarak requested a review from jack-morrison June 6, 2025 08:32
Copy link
Contributor

@victorusu victorusu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in ReFrame Backlog Jun 18, 2025
@vkarak vkarak force-pushed the feat/expected-failures branch from 8cb57af to 489e3b0 Compare June 18, 2025 19:17
@vkarak vkarak requested a review from teojgo June 18, 2025 19:18
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 75.11111% with 56 lines in your changes missing coverage. Please review.

Project coverage is 67.14%. Comparing base (2a2dd82) to head (489e3b0).

Files with missing lines Patch % Lines
reframe/frontend/executors/__init__.py 60.46% 17 Missing ⚠️
reframe/frontend/executors/policies.py 80.55% 14 Missing ⚠️
reframe/core/decorators.py 0.00% 11 Missing ⚠️
reframe/core/pipeline.py 93.50% 5 Missing ⚠️
reframe/core/builtins.py 25.00% 3 Missing ⚠️
reframe/utility/sanity.py 57.14% 3 Missing ⚠️
reframe/core/exceptions.py 0.00% 2 Missing ⚠️
reframe/frontend/printer.py 66.66% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (2a2dd82) and HEAD (489e3b0). Click for more details.

HEAD has 17 uploads less than BASE
Flag BASE (2a2dd82) HEAD (489e3b0)
22 5
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #3481       +/-   ##
============================================
- Coverage    91.13%   67.14%   -24.00%     
============================================
  Files           62       60        -2     
  Lines        13132    13167       +35     
============================================
- Hits         11968     8841     -3127     
- Misses        1164     4326     +3162     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Support marking a test as an expected failure
3 participants