Skip to content

Commit

Permalink
run tests as separate jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaAltieri committed Jul 18, 2024
1 parent 3526fdc commit 90fe70b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,26 @@ jobs:
name: Build rock
uses: canonical/data-platform-workflows/.github/workflows/build_rock.yaml@v16

collect-tests:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: Generate matrix with all tests
id: set-matrix
run: |
echo "matrix=$(find tests/integration/ -name "test_*.py" | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
integration:
runs-on: ubuntu-latest
timeout-minutes: 120
needs: build
needs:
- build
- collect-tests
strategy:
matrix:
env: [integration]
file: ${{ fromJson(needs.collect-tests.outputs.matrix) }}
fail-fast: false
steps:
- name: Checkout repository
Expand Down Expand Up @@ -50,7 +63,8 @@ jobs:
pipx install poetry
- name: Integration Tests
run: |
sg snap_microk8s -c "tox -e ${{ matrix.env }}"
echo "Running test ${{ matrix.file }}"
sg snap_microk8s -c "tox -e ${{ matrix.file }}"
- name: Free disk space
run: |
echo "Free disk space after int tests"
Expand Down

0 comments on commit 90fe70b

Please sign in to comment.