Skip to content

Commit 6d9195d

Browse files
authored
Run 2.7 tests in CI again (#2181)
Since GitHub actions dropped support for 2.7 in python-versions, take 2.7 out of the test matrix and add a separate job for it where it can run inside a py2.7 container.
1 parent 0792db2 commit 6d9195d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+774
-115
lines changed

.github/workflows/test-common.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["2.7","3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6
@@ -69,14 +69,47 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
test-py27:
73+
name: common, python 2.7, ubuntu-20.04
74+
runs-on: ubuntu-20.04
75+
container: python:2.7
76+
timeout-minutes: 30
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
81+
- name: Setup Test Env
82+
run: |
83+
pip install coverage "tox>=3,<4"
84+
85+
- name: Test common
86+
uses: nick-fields/retry@v2
87+
with:
88+
timeout_minutes: 15
89+
max_attempts: 2
90+
retry_wait_seconds: 5
91+
shell: bash
92+
command: |
93+
set -x # print commands that are executed
94+
coverage erase
95+
96+
# Run tests
97+
./scripts/runtox.sh "py2.7-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
98+
coverage combine .coverage* &&
99+
coverage xml -i
100+
72101
check_required_tests:
73102
name: All common tests passed or skipped
74-
needs: test
103+
needs: [test, test-py27]
75104
# Always run this, even if a dependent job failed
76105
if: always()
77106
runs-on: ubuntu-20.04
78107
steps:
79108
- name: Check for failures
80109
if: contains(needs.test.result, 'failure')
81110
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
111+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
112+
- name: Check for 2.7 failures
113+
if: contains(needs.test-py27.result, 'failure')
114+
run: |
115+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integration-aiohttp.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
7273
check_required_tests:
7374
name: All aiohttp tests passed or skipped
7475
needs: test
@@ -79,4 +80,4 @@ jobs:
7980
- name: Check for failures
8081
if: contains(needs.test.result, 'failure')
8182
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
83+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integration-arq.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
7273
check_required_tests:
7374
name: All arq tests passed or skipped
7475
needs: test
@@ -79,4 +80,4 @@ jobs:
7980
- name: Check for failures
8081
if: contains(needs.test.result, 'failure')
8182
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
83+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integration-asgi.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
7273
check_required_tests:
7374
name: All asgi tests passed or skipped
7475
needs: test
@@ -79,4 +80,4 @@ jobs:
7980
- name: Check for failures
8081
if: contains(needs.test.result, 'failure')
8182
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
83+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integration-aws_lambda.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
7273
check_required_tests:
7374
name: All aws_lambda tests passed or skipped
7475
needs: test
@@ -79,4 +80,4 @@ jobs:
7980
- name: Check for failures
8081
if: contains(needs.test.result, 'failure')
8182
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
83+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integration-beam.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
7273
check_required_tests:
7374
name: All beam tests passed or skipped
7475
needs: test
@@ -79,4 +80,4 @@ jobs:
7980
- name: Check for failures
8081
if: contains(needs.test.result, 'failure')
8182
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
83+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integration-boto3.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["2.7","3.6","3.7","3.8"]
34+
python-version: ["3.6","3.7","3.8"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6
@@ -69,14 +69,47 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
test-py27:
73+
name: boto3, python 2.7, ubuntu-20.04
74+
runs-on: ubuntu-20.04
75+
container: python:2.7
76+
timeout-minutes: 30
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
81+
- name: Setup Test Env
82+
run: |
83+
pip install coverage "tox>=3,<4"
84+
85+
- name: Test boto3
86+
uses: nick-fields/retry@v2
87+
with:
88+
timeout_minutes: 15
89+
max_attempts: 2
90+
retry_wait_seconds: 5
91+
shell: bash
92+
command: |
93+
set -x # print commands that are executed
94+
coverage erase
95+
96+
# Run tests
97+
./scripts/runtox.sh "py2.7-boto3" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
98+
coverage combine .coverage* &&
99+
coverage xml -i
100+
72101
check_required_tests:
73102
name: All boto3 tests passed or skipped
74-
needs: test
103+
needs: [test, test-py27]
75104
# Always run this, even if a dependent job failed
76105
if: always()
77106
runs-on: ubuntu-20.04
78107
steps:
79108
- name: Check for failures
80109
if: contains(needs.test.result, 'failure')
81110
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
111+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
112+
- name: Check for 2.7 failures
113+
if: contains(needs.test-py27.result, 'failure')
114+
run: |
115+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integration-bottle.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["2.7","3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6
@@ -69,14 +69,47 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
test-py27:
73+
name: bottle, python 2.7, ubuntu-20.04
74+
runs-on: ubuntu-20.04
75+
container: python:2.7
76+
timeout-minutes: 30
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
81+
- name: Setup Test Env
82+
run: |
83+
pip install coverage "tox>=3,<4"
84+
85+
- name: Test bottle
86+
uses: nick-fields/retry@v2
87+
with:
88+
timeout_minutes: 15
89+
max_attempts: 2
90+
retry_wait_seconds: 5
91+
shell: bash
92+
command: |
93+
set -x # print commands that are executed
94+
coverage erase
95+
96+
# Run tests
97+
./scripts/runtox.sh "py2.7-bottle" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
98+
coverage combine .coverage* &&
99+
coverage xml -i
100+
72101
check_required_tests:
73102
name: All bottle tests passed or skipped
74-
needs: test
103+
needs: [test, test-py27]
75104
# Always run this, even if a dependent job failed
76105
if: always()
77106
runs-on: ubuntu-20.04
78107
steps:
79108
- name: Check for failures
80109
if: contains(needs.test.result, 'failure')
81110
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
111+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
112+
- name: Check for 2.7 failures
113+
if: contains(needs.test-py27.result, 'failure')
114+
run: |
115+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integration-celery.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["2.7","3.5","3.6","3.7","3.8","3.9","3.10"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6
@@ -69,14 +69,47 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
test-py27:
73+
name: celery, python 2.7, ubuntu-20.04
74+
runs-on: ubuntu-20.04
75+
container: python:2.7
76+
timeout-minutes: 30
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
81+
- name: Setup Test Env
82+
run: |
83+
pip install coverage "tox>=3,<4"
84+
85+
- name: Test celery
86+
uses: nick-fields/retry@v2
87+
with:
88+
timeout_minutes: 15
89+
max_attempts: 2
90+
retry_wait_seconds: 5
91+
shell: bash
92+
command: |
93+
set -x # print commands that are executed
94+
coverage erase
95+
96+
# Run tests
97+
./scripts/runtox.sh "py2.7-celery" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
98+
coverage combine .coverage* &&
99+
coverage xml -i
100+
72101
check_required_tests:
73102
name: All celery tests passed or skipped
74-
needs: test
103+
needs: [test, test-py27]
75104
# Always run this, even if a dependent job failed
76105
if: always()
77106
runs-on: ubuntu-20.04
78107
steps:
79108
- name: Check for failures
80109
if: contains(needs.test.result, 'failure')
81110
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
111+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
112+
- name: Check for 2.7 failures
113+
if: contains(needs.test-py27.result, 'failure')
114+
run: |
115+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integration-chalice.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
token: ${{ secrets.CODECOV_TOKEN }}
7070
files: coverage.xml
7171

72+
7273
check_required_tests:
7374
name: All chalice tests passed or skipped
7475
needs: test
@@ -79,4 +80,4 @@ jobs:
7980
- name: Check for failures
8081
if: contains(needs.test.result, 'failure')
8182
run: |
82-
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
83+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

0 commit comments

Comments
 (0)