reframe-hpc/reframe

How to define a reframe test which uses a git repo plus some local files

sjpb opened this issue · 3 comments

sjpb commented

Conceptually, I want to do something like this:

class MyTest(rfm.RunOnlyRegressionTest):
    ...
    sourcesdir = [
       'https://github.com/myrepo/myrepo.git',
       'inputs/'
    ]
  prerun_cmds = ['expand.py inputs/foo.txt']
   

i.e. have the test use (= have available in staging directory, I think?) both files from a repo plus some files I've included in the test definition, and then preprocess those input files before running the tests.

Is there a simple way of doing this? So far I've tried:

  • Defining the git repo in sources_dir and copying files/ in with pre_cmds: fails because it means that the staging dir is then non-empty when the git repo gets copied (as that happens during the run_state)
  • Using a @run_before('run') to do the file copying: same issue

I would do the opposite of your first choice: use the sourcesdir to point to the local files of the test and then do explicitly the git clone in the prerun_cmds.

sjpb commented

Hah that was the workaround I ended up with after posting this! So good to know that wasn't totally daft but I felt like this must be a really common use-case.

Maybe others have stumbled on this, but it's the first time being reported and thanks! If we get more user requests on this, we will consider extending sourcesdir syntax.