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

[WIP] test script and venv requirements #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
planemo==0.72.0
galaxy-parsec==1.13.0
3 changes: 2 additions & 1 deletion run_galaxy_workflow_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ planemo $PLANEMO_OPTIONS test \
--galaxy_user_key "$GALAXY_USER_KEY" \
--no_shed_install \
--engine external_galaxy \
--test_output_json test_output.json \
"$1";
planemo_exit_code=$?
set -e
Expand All @@ -26,6 +27,6 @@ else
# Otherwise immediately delete
history_id=$(parsec histories get_histories --name "$history_name" | jq -r .[0].id)
parsec histories delete_history --purge $history_id
echo "<html><head></head><body>Test was completely successful</body></html>"> history.html
echo "<html><head></head><body>Test was completely successful</body></html>" > history.html
fi
exit $planemo_exit_code
26 changes: 26 additions & 0 deletions test_workflows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

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)

# # get list of local workflows with tests (ignoring training folder)
find . \( -name '*-test.yml' ! -path './training*' \) | sed 's/^\.\///g' | sed 's/-test.yml/.ga/g' > $workflow_list

# # clone training-material repo
git clone --depth 1 https://github.com/galaxyproject/training-material.git

# # get list of training-material workflows with tests
find 'training-material' -path '*-test.yml' | sed 's/-test.yml/.ga/g' >> $workflow_list

[ -d test_output ] && rm -rf test_output
mkdir test_output

# 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! 👍

mv history.html test_output/$(sed 's/\//__/g' <<< $line).history.html
done

# 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 {} +
hexylena marked this conversation as resolved.
Show resolved Hide resolved
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!!