-
Notifications
You must be signed in to change notification settings - Fork 11
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
first attempt at a common staging class #209
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from pathlib import Path | ||
|
||
import reframe as rfm | ||
from reframe.utility import sanity as sn | ||
from reframe.core.builtins import run_after, sanity_function | ||
|
||
|
||
@rfm.simple_test | ||
class EESSI_Staging(rfm.RunOnlyRegressionTest): | ||
'''Stage input files''' | ||
|
||
valid_systems = ['*'] | ||
valid_prog_environs = ['*'] | ||
executable = "true" | ||
local = True | ||
|
||
@run_after('init') | ||
def remove_modules(self): | ||
"Remove any modules that have been set on the cmd line: they are not needed for staging" | ||
self.modules = [] | ||
|
||
@sanity_function | ||
def check_stagedir(self): | ||
"Check that all input files have been correctly copied to the stagedir" | ||
ignore = {'rfm_job.sh', 'rfm_job.out', 'rfm_job.err'} | ||
sourcepath = Path(self.sourcesdir) | ||
sourcefiles = {x.relative_to(sourcepath).as_posix() for x in sourcepath.rglob('*')} | ||
stagepath = Path(self.stagedir) | ||
stagefiles = {x.relative_to(stagepath).as_posix() for x in stagepath.rglob('*')} - ignore | ||
|
||
return sn.assert_eq( | ||
sourcefiles, stagefiles, | ||
f'sourcesdir {self.sourcesdir} and stagedir {self.stagedir} do not have the same contents' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
eessi/testsuite/tests/apps/cp2k/cp2k_staging/cp2k_stage_input.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm not sure if this will work. If another test uses
EESSI_Staging
as a fixture, with scopesession
, will it then be run twice (i.e. once for each tests invoking it as afixture
)? Or once (because it's once per session scope)?Also: even if it does run once per test that invokes this as fixture, it'll have the name
EESSI_Staging
both times, right? That could be confusing. But maybe that can be resolved by overwriting the test name through thevariables
construct? I don't know, I don't have much experience withvariables
as an argument tofixture
.Could you try to add the
lammps
case here as well? That would allow us to easily verify it.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.
Discussed in the meeting: maybe we can do something along the lines of: