Skip to content
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

Conda environment are re-created for each test #231

Open
maxulysse opened this issue Jul 12, 2024 · 2 comments
Open

Conda environment are re-created for each test #231

maxulysse opened this issue Jul 12, 2024 · 2 comments

Comments

@maxulysse
Copy link

Running the tests for untar in the nf-core/modules repo, with the following command:

nf-test test --verbose --debug --profile "+conda" modules/nf-core/untar

Four tests are launched: test_untar, test_untar_onlyfiles, test_untar - stub and test_untar_onlyfiles - stub.

And I see four similar messages on my terminal with 4 different conda cache location.

Creating env using conda: /home/max/workspace/modules/modules/nf-core/untar/tests/../environment.yml [cache /home/max/tests/5914f5c10741c2a84844fa7727ecaf5c/work/conda/untar-6ec82032d38a28f610b86307ce4a0ff3]

Any recommendation on how to deal with this properly, and avoid re-creating conda env multiple time?

@lukfor
Copy link
Collaborator

lukfor commented Jul 12, 2024

At the moment, each test uses its own work directory.

We could consider setting a work directory alias for each test suite or test case. This way, nf-test would create a work directory under .nf-test/share/<workdir alias>, allowing tests with the same work directory alias to reuse the directory.

What do you think?

@maxulysse
Copy link
Author

That's already a good progress, but I'm guessing in such a case, if I have already the conda env it will be recomputed anyway, right?
Maybe it's something that we can deal with using cachedir within https://www.nextflow.io/docs/latest/config.html#scope-conda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants