Skip to content

Commit

Permalink
add sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Moors committed Nov 24, 2024
1 parent a933232 commit 8b8911d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion eessi/testsuite/eessi_staging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
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
Expand All @@ -10,4 +13,20 @@ class EESSI_Staging(rfm.RunOnlyRegressionTest):
valid_prog_environs = ['*']
executable = "true"
local = True
sanity_patterns = sn.assert_true(True)

@run_after('init')
def remove_modules(self):
self.modules = []

@sanity_function
def check_stagedir(self):
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'
)

0 comments on commit 8b8911d

Please sign in to comment.