Skip to content

Conversation

@jjotero
Copy link
Contributor

@jjotero jjotero commented Jul 16, 2021

This PR rearranges the instantiation/construction process of classes using the RegressionTestMeta metaclass. The RegressionTestMeta is now agnostic of pipeline-specific concepts, which facilitates its use in other classes which could also benefit from using all the machinery implemented in this metaclass (such as the BuildSystem - see #2030):

  • variables and parameters are now injected into a class from the __call__ method in the metaclass, instead of the __new__ method from the class. This means that now any class that uses this RegressionTestMeta can use the variables and parameters "for free" without implementing anything else.
  • The injection and stage-specific mapping of hooks now happens in the __new__ method of the RegressionTest class. This moves all pipeline-specific concepts into the pipeline itself. This rearrangement paves the way for Dynamic pipeline stages #1936, and for the same money, it closes Incomplete hook override with multiple inheritance #2055.

@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2021

Codecov Report

Merging #2081 (b7e70d8) into master (13af717) will increase coverage by 0.00%.
The diff coverage is 98.64%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2081   +/-   ##
=======================================
  Coverage   86.74%   86.75%           
=======================================
  Files          52       52           
  Lines        9267     9272    +5     
=======================================
+ Hits         8039     8044    +5     
  Misses       1228     1228           
Impacted Files Coverage Δ
reframe/core/hooks.py 90.21% <94.11%> (-0.70%) ⬇️
reframe/core/meta.py 98.92% <100.00%> (-0.07%) ⬇️
reframe/core/pipeline.py 91.73% <100.00%> (+0.33%) ⬆️

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 13af717...b7e70d8. Read the comment docs.

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 except a couple of minor comments + the following one. Since now the hooks are checked upon class instantiation, if somebody tries to attach a hook to an inexistent state, they get:

./bin/reframe: skipping test 'HelloTest' due to errors: use `-v' for more information
    FILE: n/a:n/a

The first part of the message, I think should be addressed by #1899, but the second one might be related to this PR. If not, we address that in #1899 as well.

@vkarak
Copy link
Contributor

vkarak commented Jul 19, 2021

I check the error message in master:

./bin/reframe: run session stopped: value error: ../misc/rfm-support/issue-1899/hello1.py:16: invalid pipeline stage specified: 'foo'
    @run_before('foo')

@vkarak
Copy link
Contributor

vkarak commented Jul 20, 2021

You can ignore the comments about the error message here. They will be fixed by #2087.

@pep8speaks
Copy link

pep8speaks commented Jul 23, 2021

Hello @jjotero, Thank you for updating!

Cheers! There are no PEP8 issues in this Pull Request!Do see the ReFrame Coding Style Guide

Comment last updated at 2021-07-23 13:42:46 UTC

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.

Just a final minor comment.

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 bc4af33 into reframe-hpc:master Jul 23, 2021
@jjotero jjotero deleted the feat/cleanup-meta branch July 23, 2021 15:01
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.

Incomplete hook override with multiple inheritance

4 participants