Skip to content

Split CI execution of integration tests #1526

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

Merged
merged 3 commits into from
Oct 25, 2021
Merged
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
11 changes: 11 additions & 0 deletions .github/tools/get_integration_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pathlib import Path
import json


if __name__ == "__main__":
import sys

tests_path = sys.argv[1]

test_files = [str(f) for f in Path(tests_path).glob("test_*.py")]
print(json.dumps(test_files))
24 changes: 22 additions & 2 deletions .github/workflows/test-go-integration-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,30 @@ jobs:

echo "::set-output name=result::$RESULT"

test:
tests-collector:
runs-on: ubuntu-latest
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
outputs:
tests-data: ${{ steps.collection.outputs.tests-data }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Collect tests
id: collection
run: |
echo "::set-output name=tests-data::$(python .github/tools/get_integration_tests.py ./test/)"

test:
needs: tests-collector
strategy:
matrix:
operating-system:
- ubuntu-latest
- windows-latest
- macos-latest
tests: ${{ fromJSON(needs.tests-collector.outputs.tests-data) }}

runs-on: ${{ matrix.operating-system }}

Expand Down Expand Up @@ -97,5 +111,11 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Build Arduino CLI
run: task go:build

- name: Install poetry deps
run: task poetry:install-deps

- name: Run integration tests
run: task go:test-integration
run: poetry run pytest ${{ matrix.tests }}
Loading