rnaseq icon indicating copy to clipboard operation
rnaseq copied to clipboard

Pytest workflow

Open edmundmiller opened this issue 4 years ago • 9 comments

PR checklist

  • [ ] This comment contains a description of changes (with reason).
  • [ ] If you've fixed a bug or added code that should be tested, add tests!
  • [ ] If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • [ ] If necessary, also make a PR on the nf-core/rnaseq branch on the nf-core/test-datasets repository.
  • [ ] Make sure your code lints (nf-core lint .).
  • [ ] Ensure the test suite passes (nextflow run . -profile test,docker).
  • [ ] Usage Documentation in docs/usage.md is updated.
  • [ ] Output Documentation in docs/output.md is updated.
  • [ ] CHANGELOG.md is updated.
  • [ ] README.md is updated (including new tool citations and authors/contributors).

edmundmiller avatar Dec 23 '20 00:12 edmundmiller

Alright I've hit a snag. So the tests can't seem to find anyting in bin/ if I use --symlink arg for pytest. Anyone know anything more about how nextflow copies over the bin/ dir?

To reproduce install pytest-workflow and run pytest --tag default --symlink --wt 3 --kwdof

edmundmiller avatar Jan 08 '21 15:01 edmundmiller

afaik it doesn't - it just adds it to PATH. Check the .command.run script, in there should be a line defining PATH.

grst avatar Jan 08 '21 15:01 grst

@grst Hmm the Path line is in there, and it looks right. Does PATH not like symlinks?

export PATH="/tmp/pytest_workflow_woixfhep/Run_default_pipeline_with_test_data/bin:\$PATH"

edmundmiller avatar Jan 08 '21 15:01 edmundmiller

I'd assume that something goes wrong with mounting the directory in the Docker container.

grst avatar Jan 08 '21 15:01 grst

@pditommaso Could I get your thoughts on why this is happening? I noticed that https://github.com/nextflow-io/nextflow/commit/1405a28f8fc2d1198a7c76d19bf96fcc968a72b0 Is in the 5v20.11.0-edge changed the way the bin dir is handled and I'm using that version because of the singularity https fix.

edmundmiller avatar Jan 11 '21 19:01 edmundmiller

Created https://github.com/nextflow-io/nextflow/issues/1868

edmundmiller avatar Jan 26 '21 19:01 edmundmiller

YAML linting is failing

To keep the code consistent with lots of contributors, we run automated code consistency checks. To fix this CI test, please run:

  • Install yaml-lint
  • Fix the markdown errors
    • Run the test locally: yamllint $(find . -type f -name "*.yml" -o -name "*.yaml")
    • Fix any reported errors in your YAML files

Once you push these changes the test should pass, and you can hide this comment :+1:

We highly recommend setting up yaml-lint in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help!

Thanks again for your contribution!

github-actions[bot] avatar Jun 10 '21 14:06 github-actions[bot]

Nope, it should just work! Steps in case I hadn't listed them out

  1. Convert end 2 end (the current ci) to pytest. This is done but definitely needs updating since I wrote it a few months ago.
  2. Start testing local modules
  3. Test local workflows

edmundmiller avatar Dec 30 '21 16:12 edmundmiller

But would you eventually want to merge this PR, or should we get it in tools first and get it into each pipeline using template sync? Ofc, the tests would still need to be written, but I think it would be great to encourage pytest workflow as default for all pipelines.

grst avatar Dec 30 '21 18:12 grst