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

Faster Tests (DjangoCon) #1602

Merged
merged 82 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
bbfbb94
Trying tox-gh
antonpirker Sep 6, 2022
4723dd7
Splitting out django tests
antonpirker Sep 6, 2022
88dce73
Better name
antonpirker Sep 6, 2022
d2cd775
Tailored matrix
antonpirker Sep 6, 2022
14094c8
Better naming
antonpirker Sep 6, 2022
c59b679
Fixed naming
antonpirker Sep 6, 2022
ed2f8b4
Matrix stuff
antonpirker Sep 6, 2022
daeaa8a
Matrix stuff 2
antonpirker Sep 6, 2022
0d2c0e7
Cleanup
antonpirker Sep 6, 2022
95da9da
Fixed include matric
antonpirker Sep 6, 2022
d3958a9
Actually try to run the tests again.
antonpirker Sep 6, 2022
59c8f79
Better call to tox
antonpirker Sep 6, 2022
fb99fa1
Removed some Django versions
antonpirker Sep 6, 2022
f04133d
Trying new matrix format
antonpirker Sep 8, 2022
b3f5137
Fixed python version string
antonpirker Sep 8, 2022
1af02c3
Fixed matrix again
antonpirker Sep 8, 2022
4d7ce29
Cleanup
antonpirker Sep 8, 2022
a51f12d
Cleanup Django test environments definistion
antonpirker Sep 8, 2022
d8d4143
Fixed pypy definition
antonpirker Sep 8, 2022
ecbce4a
First splitting everything
antonpirker Sep 9, 2022
b5729e2
Fixed typo
antonpirker Sep 9, 2022
9fc5f72
Try to get nice env name
antonpirker Sep 9, 2022
bea6a1b
Fixed typo
antonpirker Sep 9, 2022
e9abdbf
Regenerated file
antonpirker Sep 9, 2022
27a5184
Reactivated tests
antonpirker Sep 9, 2022
dbfeb34
Fixed shell var unpacking
antonpirker Sep 9, 2022
977de5a
All the new config files
antonpirker Sep 9, 2022
3967317
Deactivate redis/postgres everywhere to see where it is not needed.
antonpirker Sep 9, 2022
d42134d
Regenerate github actions config
antonpirker Sep 9, 2022
9cee517
Removed setup-node
antonpirker Sep 9, 2022
efc9aec
Nicer GH actions names
antonpirker Sep 9, 2022
4b7aafa
Even nicer GH actions names
antonpirker Sep 9, 2022
89872cf
Do not run tox in parallel, because we have one workflow per env now.
antonpirker Sep 9, 2022
9e35a38
Removed silent failing if postgres is not present.
antonpirker Sep 9, 2022
b078106
Render postgres only where it is needed (Django)
antonpirker Sep 9, 2022
60a4857
Cleanup
antonpirker Sep 9, 2022
695a109
Code cleanup
antonpirker Sep 9, 2022
726e5c2
Run general tests (not integration specific)
antonpirker Sep 9, 2022
883010d
Added general sdk tests
antonpirker Sep 9, 2022
6f1a26a
Renamed ci files to reflect that those are test for integrations
antonpirker Sep 9, 2022
cb9dffa
Renamed common tests
antonpirker Sep 9, 2022
44143c0
Added missing common tests file
antonpirker Sep 9, 2022
6b5cfce
Show the five slowest tests when running tets
antonpirker Sep 9, 2022
9bfaa9b
Try running all tests in ram drives
antonpirker Sep 12, 2022
06ac31d
Cleanup
antonpirker Sep 12, 2022
8149bc8
Handle empty params
antonpirker Sep 12, 2022
556875b
Fix psychopg2 requirement
antonpirker Sep 12, 2022
e16a584
Fixed postgres related tests
antonpirker Sep 12, 2022
0ce6180
Do not run Flask tests in Python 3.4
antonpirker Sep 12, 2022
012245f
Cleanup
antonpirker Sep 12, 2022
f2a78ce
Fixed running of common tests
antonpirker Sep 12, 2022
1ec79c8
Merge branch 'master' into antonpirker/tests-experiments
antonpirker Sep 13, 2022
c16171c
Ignore PyPy for now, because it has not been tested in PyPy the last …
antonpirker Sep 13, 2022
1d4b3b2
Merge branch 'antonpirker/tests-experiments' of github.com:getsentry/…
antonpirker Sep 13, 2022
7ea4dbf
Removed pypy from common tests.
antonpirker Sep 13, 2022
23fb590
Removed PyPy
antonpirker Sep 15, 2022
bedc73d
Run all framework versions in one runner
antonpirker Sep 15, 2022
023cdc7
Fixed typo
antonpirker Sep 15, 2022
f05a054
Fixed typo, now for real
antonpirker Sep 15, 2022
ff32466
Run testsuite in parallel mode again (because we now again run multip…
antonpirker Sep 15, 2022
872ffb4
Cleanup
antonpirker Sep 15, 2022
e607cc1
Prevent tox parallel spinner output.
antonpirker Sep 15, 2022
dec4db3
Better name for job
antonpirker Sep 15, 2022
0fca622
Removed tests from CI workflow (because they run now in multiple othe…
antonpirker Sep 15, 2022
a27acbf
Name change again
antonpirker Sep 15, 2022
c84d2c3
Merge branch 'master' into antonpirker/tests-experiments
antonpirker Sep 15, 2022
8d10f5e
Cleanup
antonpirker Sep 15, 2022
8542f0f
Merge branch 'antonpirker/tests-experiments' of github.com:getsentry/…
antonpirker Sep 15, 2022
bd2381c
Cleanup
antonpirker Sep 15, 2022
a34f8ab
More cleanup
antonpirker Sep 15, 2022
c307519
Fixed invocation of common tests
antonpirker Sep 15, 2022
b94ebd2
Fixed regex to run common tests
antonpirker Sep 16, 2022
1b77ffd
Fixed calling the common tests again.
antonpirker Sep 16, 2022
6d1bd77
Cleanup
antonpirker Sep 16, 2022
d07a213
Create ram dir in default location.
antonpirker Sep 19, 2022
b12406d
Reworded test requirements
antonpirker Sep 19, 2022
7d12660
Fail CI when tox.ini and yaml files are out of sync
antonpirker Sep 19, 2022
670b04a
Updated github actions config
antonpirker Sep 19, 2022
cc6f8d3
Made ram drive bigger, because we run in parallel now
antonpirker Sep 19, 2022
5f4a031
Removed ram drive
antonpirker Sep 19, 2022
794af55
try to fix gevent install on python 2.7
antonpirker Sep 19, 2022
f7a013a
Removed gevent from general test requirements
antonpirker Sep 19, 2022
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
76 changes: 0 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,82 +32,6 @@ jobs:
pip install tox
tox -e linters

test:
name: Run Tests
runs-on: ${{ matrix.linux-version }}
timeout-minutes: 45
continue-on-error: true
strategy:
matrix:
linux-version: [ubuntu-latest]
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
include:
# GHA doesn't host the combo of python 3.4 and ubuntu-latest (which is
# currently 20.04), so run just that one under 18.04. (See
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
# for a listing of supported python/os combos.)
- linux-version: ubuntu-18.04
python-version: "3.4"

services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379

postgres:
image: postgres
env:
POSTGRES_PASSWORD: sentry
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Maps tcp port 5432 on service container to the host
ports:
- 5432:5432

env:
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Test Env
env:
PGHOST: localhost
PGPASSWORD: sentry
run: |
pip install codecov tox

- name: Run Tests
env:
CI_PYTHON_VERSION: ${{ matrix.python-version }}
timeout-minutes: 45
run: |
coverage erase
./scripts/runtox.sh '' --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
coverage combine .coverage*
coverage xml -i
codecov --file coverage.xml

build_lambda_layer:
name: Build Package
runs-on: ubuntu-latest
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/test-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Test Common

on:
push:
branches:
- master
- release/**

pull_request:

permissions:
contents: read

env:
BUILD_CACHE_KEY: ${{ github.sha }}
CACHED_BUILD_PATHS: |
${{ github.workspace }}/dist-serverless

jobs:
test:
name: Test Python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
continue-on-error: true
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: sentry
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Maps tcp port 5432 on service container to the host
ports:
- 5432:5432
env:
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Test Env
env:
PGHOST: localhost
PGPASSWORD: sentry
run: |
pip install codecov tox

- name: Run Tests
env:
CI_PYTHON_VERSION: ${{ matrix.python-version }}
timeout-minutes: 45
shell: bash
run: |
set -x # print commands that are executed
coverage erase

./scripts/runtox.sh "py${{ matrix.python-version }}$" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch --ignore=tests/integrations
coverage combine .coverage*
antonpirker marked this conversation as resolved.
Show resolved Hide resolved
coverage xml -i
codecov --file coverage.xml
60 changes: 60 additions & 0 deletions .github/workflows/test-integration-aiohttp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test aiohttp

on:
push:
branches:
- master
- release/**

pull_request:

permissions:
contents: read

env:
BUILD_CACHE_KEY: ${{ github.sha }}
CACHED_BUILD_PATHS: |
${{ github.workspace }}/dist-serverless

jobs:
test:
name: aiohttp, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
continue-on-error: true

strategy:
matrix:
python-version: ["3.7","3.8","3.9","3.10"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Test Env
env:
PGHOST: localhost
PGPASSWORD: sentry
run: |
pip install codecov tox

- name: Test aiohttp
env:
CI_PYTHON_VERSION: ${{ matrix.python-version }}
timeout-minutes: 45
shell: bash
run: |
set -x # print commands that are executed
coverage erase

# create ram drive to run tests in
mkdir -p ~/toxworkdir
sudo mount -o size=180m -t tmpfs none ~/toxworkdir

./scripts/runtox.sh "${{ matrix.python-version }}-aiohttp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
coverage combine .coverage*
coverage xml -i
codecov --file coverage.xml
60 changes: 60 additions & 0 deletions .github/workflows/test-integration-asgi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test asgi

on:
push:
branches:
- master
- release/**

pull_request:

permissions:
contents: read

env:
BUILD_CACHE_KEY: ${{ github.sha }}
CACHED_BUILD_PATHS: |
${{ github.workspace }}/dist-serverless

jobs:
test:
name: asgi, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
continue-on-error: true

strategy:
matrix:
python-version: ["3.7","3.8","3.9","3.10"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Test Env
env:
PGHOST: localhost
PGPASSWORD: sentry
run: |
pip install codecov tox

- name: Test asgi
env:
CI_PYTHON_VERSION: ${{ matrix.python-version }}
timeout-minutes: 45
shell: bash
run: |
set -x # print commands that are executed
coverage erase

# create ram drive to run tests in
mkdir -p ~/toxworkdir
sudo mount -o size=180m -t tmpfs none ~/toxworkdir

./scripts/runtox.sh "${{ matrix.python-version }}-asgi" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
coverage combine .coverage*
coverage xml -i
codecov --file coverage.xml
60 changes: 60 additions & 0 deletions .github/workflows/test-integration-aws_lambda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test aws_lambda

on:
push:
branches:
- master
- release/**

pull_request:

permissions:
contents: read

env:
BUILD_CACHE_KEY: ${{ github.sha }}
CACHED_BUILD_PATHS: |
${{ github.workspace }}/dist-serverless

jobs:
test:
name: aws_lambda, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
continue-on-error: true

strategy:
matrix:
python-version: ["3.7"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Test Env
env:
PGHOST: localhost
PGPASSWORD: sentry
run: |
pip install codecov tox

- name: Test aws_lambda
env:
CI_PYTHON_VERSION: ${{ matrix.python-version }}
timeout-minutes: 45
shell: bash
run: |
set -x # print commands that are executed
coverage erase

# create ram drive to run tests in
mkdir -p ~/toxworkdir
sudo mount -o size=180m -t tmpfs none ~/toxworkdir

./scripts/runtox.sh "${{ matrix.python-version }}-aws_lambda" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
coverage combine .coverage*
coverage xml -i
codecov --file coverage.xml
Loading