Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

[WIP] test script and venv requirements #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cat-bro
Copy link
Contributor

@cat-bro cat-bro commented Oct 21, 2020

A script to clone training-material and find workflows with tests then run the tests + non-GTN-workflow tests in this repo.

The virtual environment requires planemo and parsec. There is a conflict installing these requirements and it ends up using bioblend version 0.14.0 which is too new for parsec, but this seems to be fine for the parsec calls used in the script.

@bgruening what code is on Jenkins for this currently? I'd like to make the history.html links and the planemo reports available after the test run. The planemo report is useful if the test has failed because of tool versions, history links are useful for just about everything else.

TODO: Makefile, automatic updating of the readme

@hexylena
Copy link
Member

hexylena commented Oct 21, 2020

There is a conflict installing these requirements and it ends up using bioblend version 0.14.0 which is too new for parsec, but this seems to be fine for the parsec calls used in the script.

yeah, should be fine, the diff between 0.14.0 and what parsec was pinned to, should be very minimal.

what code is on Jenkins for this currently

pip install planemo==0.62.1
pip install galaxy-parsec
export PLANEMO_OPTIONS="--verbose"
export GALAXY_URL="https://usegalaxy.eu"

bash run_galaxy_workflow_tests.sh $WORKFLOW

this is everything that's in jenkins currently.

And the following glob chooses which files to archive:

**/tool_test_output.html, **/history.html

test_workflows.sh Outdated Show resolved Hide resolved
test_workflows.sh Outdated Show resolved Hide resolved
[ ! $GALAXY_URL ] || [ ! $GALAXY_USER_KEY ] && source .secret.env
export GALAXY_URL GALAXY_USER_KEY

virtualenv -p python3 .venv; . .venv/bin/activate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On jenkins this is done through a plugin that creates a venv (shining panda), so this step isn't necessary. But the pip install is useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to pip install -r requirements.txt within code on jenkins

rm -f ~/.parsec.yml ||:
parsec init --url $GALAXY_URL --api_key $GALAXY_USER_KEY # caution: if ~/.parsec.yml already exists at this point it will not be updated

workflow_list=workflows_to_test.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
workflow_list=workflows_to_test.txt
workflow_list=$(mktemp)

# run test for each workflow and store json report
cat $workflow_list | while read line || [[ -n $line ]]; do
./run_galaxy_workflow_tests.sh $line
mv test_output.json test_output/$(sed 's/\//__/g' <<< $line).test_output.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen this construction before, cool! 👍


# merge json reports and create html report from merged report
find 'test_output' -name '*test_output.json' -exec sh -c 'planemo merge_test_reports "$@" test_output/merged_test_output.json' sh {} +
planemo test_reports test_output/merged_test_output.json --test_output merged_test_output.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged test reports will be SO much nicer!!

@cat-bro
Copy link
Contributor Author

cat-bro commented Oct 21, 2020

@hexylena thanks for reviewing.

I've taken out a few lines. There will be more that needs to change because I hadn't considered that Jenkins was running a build for each test. So the workflow_list and the test_output folder will both need to be outside of the repo.

@hexylena
Copy link
Member

Or we can switch it to running a single build! I used the multi-build strategy only because I wanted the nice pass/fail badges for each WF, but, this looks so much more conceptually simple/correct than the old design (where updating the workflow list was super difficult) that it's definitely worth sacrificing the badges for, we can find another, better solution for those.

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

Successfully merging this pull request may close these issues.

2 participants