-
Notifications
You must be signed in to change notification settings - Fork 117
Enable setting 'pre_run' and 'post_run' in 'setup' #333
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
Conversation
* Allow setting the above `RegressionTest` fields during setup. * Create the corresponding unit test.
Codecov Report
@@ Coverage Diff @@
## master #333 +/- ##
=========================================
+ Coverage 91.29% 91.3% +0.01%
=========================================
Files 67 67
Lines 8005 8018 +13
=========================================
+ Hits 7308 7321 +13
Misses 697 697
Continue to review full report at Codecov.
|
reframe/core/pipeline.py
Outdated
| if not self.current_system or not self._current_partition: | ||
| raise PipelineError('no system or system partition is set') | ||
|
|
||
| # Temporary fix for supporting multiple pre/post run steps |
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.
Prefix this with FIXME: . Also remove the pre/post.
unittests/test_pipeline.py
Outdated
| test.setup = custom_setup.__get__(test) | ||
|
|
||
| # Use test environment for the regression check | ||
| test.valid_prog_environs = [self.progenv.name] |
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.
You can simply use '*' here.
| def custom_setup(obj, partition, environ, **job_opts): | ||
| obj.pre_run = ['echo prerun cmd'] | ||
| obj.post_run = ['echo postrun cmd'] | ||
| super(obj.__class__, obj).setup(partition, environ, **job_opts) |
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.
This test would have worked before your changes as well. You should try settings the pre_run post_run after calling the superclass setup. Also, you should echo slightly different strings from those defined in the setUp() method of the test. Otherwise, you cannot tell which ones were actually printed.
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. I will open an issue for creating an advanced tutorial example demonstrating this.
Allow setting the above
RegressionTestfields during setup.Create the corresponding unit test.
Closes #44