PMBio / deeprvat

Other
15 stars 1 forks source link

Post run cmd in pipeline tests #100

Closed endast closed 1 month ago

endast commented 1 month ago

What

This PR adds support for a postrun_cmd to the run-pipeline workflow. This enables you to add an extra command to run after the pipeline is done. For example, you could add a script to verify the output.

Screenshot 2024-05-24 at 13 43 44

Screenshot 2024-05-24 at 13 40 29 Screenshot 2024-05-24 at 13 40 24

Testing

To test this you can check out this pr and add a postrun_cmd to the yaml for example:

jobs:
  # Training Pipeline
  Smoke-RunTraining:
    uses: ./.github/workflows/run-pipeline.yml
    with:
      pipeline_file: ./pipelines/run_training.snakefile
      environment_file: ./deeprvat_env_no_gpu.yml
      postrun_cmd: echo "Hello World from post"

  Pipeline-Tests-RunTraining:
    needs: Smoke-RunTraining
    uses: ./.github/workflows/run-pipeline.yml
    with:
      pipeline_file: ./pipelines/run_training.snakefile
      environment_file: ./deeprvat_env_no_gpu.yml
      dry_run: false
      postrun_cmd: python --version

Screenshot 2024-05-24 at 13 35 26

Screenshot 2024-05-24 at 13 35 20

You can also add a post_cmd that should fail example:

jobs:
  # Training Pipeline
  Smoke-RunTraining:
    uses: ./.github/workflows/run-pipeline.yml
    with:
      pipeline_file: ./pipelines/run_training.snakefile
      environment_file: ./deeprvat_env_no_gpu.yml
      postrun_cmd: echo "Hi this should fail!" && exit 1

image