From ec3879ddd38e38a51e143966bae96f9c8fd21da1 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Mon, 25 Nov 2024 09:14:06 +0100 Subject: [PATCH] add test for failing tool (#49) * add test for failing tool fixes https://github.com/galaxyproject/planemo-ci-action/issues/48 * adapt number of chunks test * quotes * assure check step failed * Update .github/workflows/tools.yaml Co-authored-by: Nicola Soranzo --------- Co-authored-by: Nicola Soranzo --- .github/workflows/tools.yaml | 23 ++++++++++++++++++--- test/tools/fail/.shed.yml | 4 ++++ test/tools/fail/galaxy_slots.xml | 35 ++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 test/tools/fail/.shed.yml create mode 100644 test/tools/fail/galaxy_slots.xml diff --git a/.github/workflows/tools.yaml b/.github/workflows/tools.yaml index 7a65209..94f61b1 100644 --- a/.github/workflows/tools.yaml +++ b/.github/workflows/tools.yaml @@ -145,8 +145,8 @@ jobs: if ! grep -q "tool1.xml" <<<$(echo "${{ steps.discover.outputs.tool-list }}"); then echo "tool1.xml must be in the repo list"; exit 1; fi if ! grep -q "tool2.xml" <<<$(echo "${{ steps.discover.outputs.tool-list }}"); then echo "tool2.xml must be in the repo list"; exit 1; fi # chunk-count will only consider tools/workflows depending on the workflow input to the action - - name: Check that the number of chunks is three, i.e. the number of tools - run: if [ "${{ steps.discover.outputs.chunk-count }}" != "3" ]; then exit 1; fi + - name: Check that the number of chunks is four, i.e. the number of tools + run: if [ "${{ steps.discover.outputs.chunk-count }}" != "4" ]; then exit 1; fi lint: name: Test linting of tools @@ -275,13 +275,30 @@ jobs: mode: combine html-report: true - name: Check statistics - run: if ! grep -q "3\s\+success" <<<$(echo ${{ steps.combine.outputs.statistics }}); then echo "wrong statistics"; exit 1; fi + run: | + if ! grep -q "3\s\+success" <<<$(echo "${{ steps.combine.outputs.statistics }}"); then + echo "wrong statistics: expected 3 success"; + echo "${{ steps.combine.outputs.statistics }}"; + exit 1; + fi + if ! grep -q "1\s\+failure" <<<$(echo "${{ steps.combine.outputs.statistics }}"); then + echo "wrong statistics: expected 1 failure"; + echo "${{ steps.combine.outputs.statistics }}"; + exit 1; + fi - uses: actions/upload-artifact@v3 with: name: 'All tool test results' path: upload - name: Check outputs uses: ./ + continue-on-error: true id: check with: mode: check + - name: Check on failures + if: steps.check.outcome != 'failure' + run: | + echo "outcome ${{ steps.check.outcome }}" + exit 1 + diff --git a/test/tools/fail/.shed.yml b/test/tools/fail/.shed.yml new file mode 100644 index 0000000..2d80913 --- /dev/null +++ b/test/tools/fail/.shed.yml @@ -0,0 +1,4 @@ +categories: [Sequence Analysis] +description: just fail +name: fail +owner: adent diff --git a/test/tools/fail/galaxy_slots.xml b/test/tools/fail/galaxy_slots.xml new file mode 100644 index 0000000..4247165 --- /dev/null +++ b/test/tools/fail/galaxy_slots.xml @@ -0,0 +1,35 @@ + + + 0.1.0 + 0 + + + + + + + + + + + + + + + + + + blah + + \ No newline at end of file