Skip to content

Commit

Permalink
run tests as steps, not jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana committed Dec 5, 2023
1 parent c723385 commit 7b7819f
Show file tree
Hide file tree
Showing 12 changed files with 608 additions and 2,011 deletions.
67 changes: 64 additions & 3 deletions .github/workflows/test-integrations-aws-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:
if: github.event_name == 'push'
run: true
test-aws_lambda-pinned:
needs: check-permissions
name: AWS Lambda (pinned)
timeout-minutes: 30
name: aws_lambda pinned, python ${{ matrix.python-version }}, ${{ matrix.os }}
needs: check-permissions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -73,7 +73,7 @@ jobs:
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Test aws_lambda
- name: Test aws_lambda pinned
run: |
set -x # print commands that are executed
coverage erase
Expand All @@ -85,6 +85,67 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-aws_lambda-py27:
name: AWS Lambda (py27)
timeout-minutes: 30
needs: check-permissions
runs-on: ubuntu-20.04
container: python:2.7
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Test aws_lambda py27
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py2.7-aws_lambda" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-aws_lambda-latest:
name: AWS Lambda (latest)
timeout-minutes: 30
needs: check-permissions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Test aws_lambda latest
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh "py${{ matrix.python-version }}-aws_lambda-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
check_required_tests:
name: All AWS Lambda tests passed
needs: [test-aws_lambda-pinned]
Expand Down
176 changes: 58 additions & 118 deletions .github/workflows/test-integrations-cloud-computing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ env:
CACHED_BUILD_PATHS: |
${{ github.workspace }}/dist-serverless
jobs:
test-boto3-pinned:
test-cloud_computing-pinned:
name: Cloud Computing (pinned)
timeout-minutes: 30
name: boto3 pinned, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.11","3.12"]
python-version: ["2.7","3.6","3.7","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand All @@ -38,114 +38,96 @@ jobs:
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Test boto3
- name: Test boto3 pinned
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-boto3" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- name: Test chalice pinned
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-chalice" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- name: Test cloud_resource_context pinned
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-cloud_resource_context" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- name: Test gcp pinned
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-gcp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-boto3-py27:
test-cloud_computing-py27:
name: Cloud Computing (py27)
timeout-minutes: 30
name: boto3 py27, python 2.7
runs-on: ubuntu-20.04
container: python:2.7
steps:
- uses: actions/checkout@v4
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Test boto3
- name: Test boto3 py27
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py2.7-boto3" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-boto3-latest:
timeout-minutes: 30
name: boto3 latest, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Test boto3
- name: Test chalice py27
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh "py${{ matrix.python-version }}-boto3-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
./scripts/runtox.sh --exclude-latest "py2.7-chalice" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-chalice-pinned:
timeout-minutes: 30
name: chalice pinned, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.9"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup Test Env
- name: Test cloud_resource_context py27
run: |
pip install coverage "tox>=3,<4"
- name: Test chalice
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py2.7-cloud_resource_context" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- name: Test gcp py27
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-chalice" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
./scripts/runtox.sh --exclude-latest "py2.7-gcp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-chalice-latest:
test-cloud_computing-latest:
name: Cloud Computing (latest)
timeout-minutes: 30
name: chalice latest, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.10"]
python-version: ["2.7","3.6","3.7","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand All @@ -159,78 +141,36 @@ jobs:
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Test chalice
- name: Test boto3 latest
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh "py${{ matrix.python-version }}-chalice-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
./scripts/runtox.sh "py${{ matrix.python-version }}-boto3-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-cloud_resource_context-pinned:
timeout-minutes: 30
name: cloud_resource_context pinned, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Test cloud_resource_context
- name: Test chalice latest
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-cloud_resource_context" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
./scripts/runtox.sh "py${{ matrix.python-version }}-chalice-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-gcp-pinned:
timeout-minutes: 30
name: gcp pinned, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup Test Env
- name: Test cloud_resource_context latest
run: |
pip install coverage "tox>=3,<4"
- name: Test gcp
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh "py${{ matrix.python-version }}-cloud_resource_context-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- name: Test gcp latest
run: |
set -x # print commands that are executed
coverage erase
# Run tests
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-gcp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
./scripts/runtox.sh "py${{ matrix.python-version }}-gcp-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i
- uses: codecov/codecov-action@v3
Expand Down
Loading

0 comments on commit 7b7819f

Please sign in to comment.