-
Notifications
You must be signed in to change notification settings - Fork 522
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
generate unit test with snakemake but missing quote for configfile in generated test scripts #843
Comments
I have the same issue when defining a configfile with --configfile. If I define a configfile in my Snakefile like so: configfile: "config/config.yaml" Pytest throws the following error: E subprocess.CalledProcessError: Command '['python', '-m', 'snakemake', 'results/workflow/GRCh38/A.fa.gz', '-F', '-j1', '--keep-target-files', '--use-conda', '--directory', PosixPath('/tmp/tmplu3iwqww/workdir')]' returned non-zero exit status 1.
../../anaconda3/envs/snakemake_tests/lib/python3.8/subprocess.py:512: CalledProcessError
------------------------------------------------------------------------------ Captured stderr call -------------------------------------------------------------------------------
results/workflow/GRCh38/A.fa.gz
WorkflowError in line 20 of /home/user/git_group/new_project/workflow/Snakefile:
Config file config/config.yaml not found.
File "/home/user/git_group/new_project/workflow/Snakefile", line 20, in <module Interestingly, I am able to reproduce the WorkflowError when specifying a temporary directory with E ValueError: Unexpected files:
E results/logs/createRandomIntervals.GRCh38.A.log
E results/logs/extendInterval.GRCh38.A.log
E results/logs/getSequence.GRCh38.A.log
E results/workflow/GRCh38/A.bed.gz
.tests/unit/common.py:41: ValueError I hope this helps EDIT: After playing a while with an example workflow I figured these things out to make the tests pass:
|
Hey, I have the same problem. I define my
Any kind of feedback would be highly appreciated 😄 |
I think the following line needs to be updated:
and replaced with "{{ configfile }}", But there would also need to be some changes in how the config files are handled. Would it make sense to simply copy the config directory to the workdir? But there seem to be several additional issues here. |
Okay, I've fiddled around a bit with this in the past few days. A result is here: https://github.com/nikostr/dna-seq-deepvariant-glnexus-variant-calling/tree/main/.tests/unit The changes I've done to get this working:
This is of course possible to do manually, but I'd propose that this is a sensible update, together with clear instructions on how to generate the unit tests. These could specify that the |
snakemake 5.31.1
I ran my workflow with success a first time
and then I ran again my workflow to generate unit test scripts using
--generate-unit-tests
I ran
pytest3
Then all the tests failed. It appears that the path of the configfile is not quoted inside the scripts:
Instance of error:
And the faulty code:
The text was updated successfully, but these errors were encountered: