|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +set -o xtrace |
| 4 | + |
| 5 | +set -e |
| 6 | + |
| 7 | +shopt -s expand_aliases # Needed for conda_env test |
| 8 | + |
| 9 | +# Preconditions: |
| 10 | +# - seqtk_example doesn't exist and in home directory |
| 11 | +# - conda_exercises doesn't exist in home directory. |
| 12 | +# - seqtk environment is absent |
| 13 | + |
| 14 | +cd |
| 15 | + |
| 16 | +rm -rf seqtk_example |
| 17 | +rm -rf conda_exercises |
| 18 | +echo "Remove existing seqtk environment - it is fine if it doesn't exist." |
| 19 | +conda remove --force --name '[email protected]' --all || true |
| 20 | + |
| 21 | +# Tests |
| 22 | + |
| 23 | +echo "Try planemo conda_init - this may fail and will always fail on planemo-machine" |
| 24 | +echo "still good to see a decent error message though." |
| 25 | +planemo conda_init || true |
| 26 | + |
| 27 | +echo "Setup completed seqtk example" |
| 28 | +planemo project_init --template=seqtk_complete seqtk_example |
| 29 | +cd seqtk_example |
| 30 | + |
| 31 | +echo "Check conda_requirements - should see them linting properly" |
| 32 | +planemo lint --conda_requirements seqtk_seq.xml |
| 33 | + |
| 34 | + |
| 35 | +planemo conda_install seqtk_seq.xml |
| 36 | + |
| 37 | +echo "Checking for seqtk - shouldn't be present" |
| 38 | +which seqtk || true |
| 39 | + |
| 40 | +echo "Simulating '. <(planemo conda_env seqtk_seq.xml)', subshell-ism doesn't seem to work in script" |
| 41 | +planemo conda_env seqtk_seq.xml > .conda_env |
| 42 | +. .conda_env |
| 43 | + |
| 44 | +echo "Inside conda_env I should see seqtk" |
| 45 | +which seqtk |
| 46 | + |
| 47 | +conda_env_deactivate |
| 48 | + |
| 49 | +sleep 5 # Need to wait for the package to get cleaned up. |
| 50 | + |
| 51 | +planemo test seqtk_seq.xml |
| 52 | + |
| 53 | +echo "Doing a search - should see seqtk in bioconda results along with versions" |
| 54 | +planemo conda_search seqt |
| 55 | + |
| 56 | +cd |
| 57 | + |
| 58 | +planemo project_init --template conda_exercises conda_exercises |
| 59 | +cd conda_exercises/exercise_1 |
| 60 | +ls |
| 61 | + |
| 62 | +echo "Running test wrong - this should fail" |
| 63 | +planemo test pear.xml || true |
| 64 | +echo "Linting pear without requirements - this should fail" |
| 65 | +planemo lint --conda_requirements pear.xml || true |
| 66 | + |
| 67 | +echo "Should see pear from bioconda at 0.9.6" |
| 68 | +planemo conda_search pear |
| 69 | + |
| 70 | +wget https://raw.githubusercontent.com/galaxyproject/planemo/master/project_templates/conda_answers/exercise_1/pear.xml -O pear.xml |
| 71 | +planemo lint --conda_requirements pear.xml || true |
| 72 | + |
| 73 | +planemo test pear.xml |
| 74 | + |
| 75 | +cd ../exercise_2 |
| 76 | + |
| 77 | +# Fetch and build recipe. |
| 78 | + |
| 79 | +mkdir fleeqtk |
| 80 | +cd fleeqtk |
| 81 | + |
| 82 | +wget https://raw.githubusercontent.com/galaxyproject/planemo/master/project_templates/conda_answers/exercise_2/fleeqtk/build.sh |
| 83 | +wget https://raw.githubusercontent.com/galaxyproject/planemo/master/project_templates/conda_answers/exercise_2/fleeqtk/meta.yaml |
| 84 | + |
| 85 | +cd .. |
| 86 | +conda build fleeqtk |
| 87 | + |
| 88 | +# Update to fix tool and see it work. |
| 89 | + |
| 90 | +wget https://raw.githubusercontent.com/galaxyproject/planemo/master/project_templates/conda_answers/exercise_2/fleeqtk_seq.xml -O fleeqtk_seq.xml |
| 91 | +planemo conda_install --conda_use_local fleeqtk_seq.xml |
| 92 | +planemo test fleeqtk_seq.xml |
0 commit comments