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

Fix nightly scheduled test #1747

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
37 changes: 37 additions & 0 deletions .github/workflows/run-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: run-matrix

on:
workflow_call:
inputs:
include:
required: true
description: Matrix include JSON string
type: string

jobs:
docker:
name: "docker (version: ${{ matrix.version }}, framework: ${{ matrix.framework }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
include: ${{ fromJSON(inputs.include) }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: ./tests/scripts/docker/run_tests.sh ${{ matrix.version }} ${{ matrix.framework }}
env:
LOCALSTACK_VOLUME_DIR: localstack_data
- if: success() || failure()
name: Upload JUnit Test Results
uses: actions/upload-artifact@v3
with:
name: test-results
path: "**/*-python-agent-junit.xml"
- if: success() || failure()
name: Upload Coverage Reports
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: "**/.coverage*"
67 changes: 42 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
data: ${{ steps.split.outputs.data }}
chunks: ${{ steps.split.outputs.chunks }}
steps:
- uses: actions/checkout@v3
- id: generate
Expand All @@ -30,34 +32,49 @@ jobs:
# Use .ci/.matrix_framework_full.yml if it's a scheduled workflow, otherwise use .ci/.matrix_framework.yml
frameworksFile: .ci/.matrix_framework${{ github.event_name == 'schedule' && '_full' || '' }}.yml
excludedFile: .ci/.matrix_exclude.yml
- name: Split matrix
shell: python
id: split
run: |
import os
import json

def split(lst, n):
return [lst[i::n] for i in range(n)]

matrix = json.loads(os.environ['GENERATED_MATRIX'])
chunks = split(matrix['include'], 4)
v1v marked this conversation as resolved.
Show resolved Hide resolved
chunks_json = json.dumps(chunks)

with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
print(f'chunks={chunks_json}', file=f)

docker:
name: "docker (version: ${{ matrix.version }}, framework: ${{ matrix.framework }})"
needs: create-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 10
matrix: ${{ fromJson(needs.create-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: ./tests/scripts/docker/run_tests.sh ${{ matrix.version }} ${{ matrix.framework }}
env:
LOCALSTACK_VOLUME_DIR: localstack_data
- if: success() || failure()
name: Upload JUnit Test Results
uses: actions/upload-artifact@v3
with:
name: test-results
path: "**/*-python-agent-junit.xml"
- if: success() || failure()
name: Upload Coverage Reports
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: "**/.coverage*"
GENERATED_MATRIX: ${{ steps.generate.outputs.matrix }}

chunks-0:
needs: create-matrix
uses: ./.github/workflows/run-matrix.yml
with:
include: ${{ toJSON(fromJSON(needs.create-matrix.outputs.chunks)[0]) }}

chunks-1:
needs: create-matrix
uses: ./.github/workflows/run-matrix.yml
with:
include: ${{ toJSON(fromJSON(needs.create-matrix.outputs.chunks)[1]) }}

chunks-2:
needs: create-matrix
uses: ./.github/workflows/run-matrix.yml
with:
include: ${{ toJSON(fromJSON(needs.create-matrix.outputs.chunks)[2]) }}

chunks-3:
needs: create-matrix
uses: ./.github/workflows/run-matrix.yml
with:
include: ${{ toJSON(fromJSON(needs.create-matrix.outputs.chunks)[3]) }}

windows:
name: "windows (version: ${{ matrix.version }}, framework: ${{ matrix.framework }}, asyncio: ${{ matrix.asyncio }})"
Expand Down