-
Notifications
You must be signed in to change notification settings - Fork 117
[feat] Introduce new syntax for allowing the creation of extensible parametrised tests #1614
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
[feat] Introduce new syntax for allowing the creation of extensible parametrised tests #1614
Conversation
|
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-01-20 10:32:07 UTC |
|
Some initial comments by reading the high-level description only:
|
|
I think it's better if we just focus on the high-level stuff for now :)
|
|
|
I will start looking into the implementation now for more details. |
|
Sounds good to me. I'll push some of these changes today. |
|
The unit tests that check the parameter space consumption with the decorators are still to do. |
|
Looks great! I haven't pressed the "Approve" button yet, because we need to think a bit about some forward-looking parts of the API and the finalization of the unit tests:
|
def simple_test(cls):
...
for _ in cls.parameter_space:
_register_test(cls)Here I'm adding a third item here :)
@rfm.simple_test
class SpackInstallSupportedMCApps(SpackInstallDaintMCApps):
parameter('specs', 'gromacs@02020.4', 'gromacs@02020.2')
parameter('options', '~cuda')
parameter(variant, '', '+plumed', '+craypat')
def __init__(self):
...
self.valid_systems = ['daint:mc','dom:mc']
self.valid_prog_environs = ['builtin']
... |
…otero/reframe into feature/extensible-parameterized-test
|
Hi @jjotero,
This is to help users define new variables in their library tests and attach attributes to them (for example, types, whether it is required or not etc.) Check an older suggestion here: https://gist.github.com/vkarak/be9e88fa3c86abd50bfaac04a97d5fa5#file-gromacs-py-L20-L22
For what you do, what you say makes perfectly sense. I'm trying to correlate this to the bigger picture of a test in the future. Again from that gist the idea was that the users could use For your third point, I think the best idea is to make |
|
OK, I now understand why there is a need for a different mechanism to set test variables that may depend on the parameter space and other factors. There are still a few things that confuse me on that gist, but let's not get into that yet, since it's independent from what's being done on this PR (perhaps move the discussion over to #1568?). What would be needed for the Agree on the third point. I'll make them incompatible. |
|
The gist is certainly under discussion and we can revise it. It was a very first idea of how the tests might look like in the future. I just brought it in order to keep this in context, too. |
vkarak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor comment.
vkarak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latm. I will open a separate issue for updating the documentation and perhaps adding a tutorial about it ;-)
|
I have not merged this yet, because I need to see how it shows up the documentation that you have put already. |
|
I've extended the directives section a bit and expanded the example. Even though this example uses the The |
vkarak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just minor comments and corrections.
|
@jenkins-cscs retry all |
vkarak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
Goes in finally! 🍾 🎉 |
Implementation of a new way to write more flexible parametrised tests (see #1567). This new approach does not rely on the test parameters to be passed as arguments to the
__init__method. Instead, the parameters are defined through class attribute directives that append these parameters to the namespace of the class. This allows extending the parameter space directly through class inheritance, which was not possible before. This method to write parametrised test introduces the concept of abstract parametrised tests. This would be tests with at least one parameter that does not have any values assigned to it. See this examples below.Closes #1567