Skip to content

Conversation

@vkarak
Copy link
Contributor

@vkarak vkarak commented Mar 19, 2021

This PR adds two RegressionTest methods that allow users to skip tests dynamically:

  • skip(msg=None): Skip test uncondintionally.
  • skip_if(cond, msg=None): Skip test if cond is true.

A test can be skipped anywhere during its lifetime, except during the cleanup stage.
NOTE: If a test is skipped after its stage directory is created, it will not be cleaned up.

Fixes #1474.

@vkarak vkarak added this to the ReFrame sprint 21.03.1 milestone Mar 19, 2021
@vkarak vkarak requested review from ekouts and victorusu March 19, 2021 00:06
@vkarak vkarak self-assigned this Mar 19, 2021
@codecov-io
Copy link

Codecov Report

Merging #1875 (5a46cde) into master (1c9b188) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1875      +/-   ##
==========================================
+ Coverage   87.83%   87.92%   +0.08%     
==========================================
  Files          49       49              
  Lines        8395     8448      +53     
==========================================
+ Hits         7374     7428      +54     
+ Misses       1021     1020       -1     
Impacted Files Coverage Δ
reframe/core/decorators.py 97.05% <100.00%> (-0.03%) ⬇️
reframe/core/exceptions.py 94.24% <100.00%> (+0.04%) ⬆️
reframe/core/pipeline.py 92.03% <100.00%> (+0.06%) ⬆️
reframe/frontend/executors/__init__.py 98.30% <100.00%> (+0.09%) ⬆️
reframe/frontend/executors/policies.py 99.69% <100.00%> (+0.02%) ⬆️
reframe/frontend/statistics.py 95.45% <100.00%> (+0.14%) ⬆️
reframe/frontend/printer.py 95.65% <0.00%> (+2.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c9b188...5a46cde. Read the comment docs.

@vkarak vkarak requested a review from ekouts March 22, 2021 17:54
@vkarak vkarak merged commit 30fa94a into reframe-hpc:master Mar 22, 2021
@vkarak vkarak deleted the feat/skip-tests branch March 22, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add possibility to skip tests from Python code

3 participants