Skip to content

Conversation

@jjotero
Copy link
Contributor

@jjotero jjotero commented Jun 8, 2021

This PR introduces the sanity_function and deferrable decorators, which are exposed directly in the class' namespace.

  • A test's sanity function may now be set as follows:
class MyTest(rfm.RunOnlyRegressionTest):
    ...
    executable = 'echo bananas'

    @sanity_function
    def assert_bananas(self):
        return sn.assert_found(r'bananas', self.stdout)

The gpu microbenchmarks from the hpctestlib (and also the job report check) have been ported to this syntax. Using this new syntax in combination with setting sanity_patterns manually is disallowed.

  • The deferrable built-in decorator exposes the same functionality as the reframe.utility.sanity.sanity_function decorator.
  • The reframe.utility.sanity.sanity_function has been marked to be deprecated in 3.8.
  • This same decorator is now exposed as reframe.utility.sanity.deferrable.

Closes #1981
Closes #2008

@jjotero jjotero requested a review from teojgo June 8, 2021 15:36
@jjotero jjotero self-assigned this Jun 8, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2021

Codecov Report

Merging #2007 (a02037e) into master (c5f59fa) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2007      +/-   ##
==========================================
+ Coverage   87.48%   87.51%   +0.02%     
==========================================
  Files          50       50              
  Lines        8853     8874      +21     
==========================================
+ Hits         7745     7766      +21     
  Misses       1108     1108              
Impacted Files Coverage Δ
reframe/core/meta.py 98.89% <100.00%> (+0.09%) ⬆️
reframe/core/pipeline.py 91.68% <100.00%> (+0.05%) ⬆️
reframe/utility/sanity.py 97.79% <100.00%> (+0.01%) ⬆️

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 c5f59fa...a02037e. Read the comment docs.

Copy link
Contributor

@ekouts ekouts left a comment

Choose a reason for hiding this comment

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

lgtm in general

Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

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

I have just a couple of minor comments. Lgtm otherwise.

Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

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

lgtm

@vkarak vkarak merged commit c085116 into reframe-hpc:master Jul 1, 2021
@jjotero jjotero deleted the feat/sanity branch July 1, 2021 08:43
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.

Deprecate the use of sn.sanity_function over the @deferrable builtin Investigate ways for assigning sanity_patterns at the class level

4 participants