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 515f562
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,29 @@ 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: Checkout repository
uses: actions/checkout@v4
- 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]')"
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 +66,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 515f562

Please sign in to comment.