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

Add pytest-sentry for pytest runs #7186

Merged
merged 1 commit into from
Nov 23, 2022
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
38 changes: 30 additions & 8 deletions .github/workflows/!PR.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: PR

on:
pull_request:
pull_request_target:
types:
- opened
- synchronize
Expand Down Expand Up @@ -45,21 +45,35 @@ jobs:
- 'build/**'
- 'src/**'
- 'requirements*'



gatekeeper: # check user's permissions
runs-on: ubuntu-latest
steps:
- name: Check if user has write access
uses: lannonbr/repo-permission-check-action@2bb8c89ba8bf115c4bfab344d6a6f442b24c9a1f
with:
permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ----------------------------------------------------------------------------
# PR is Draft and PR is Ready
pytest:
needs: changes
needs: [changes, gatekeeper]
if: ${{ needs.changes.outputs.src == 'true' }}
uses: ./.github/workflows/pytest.yml
secrets:
PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}
with:
python-version: 3.8
matrix: '{"os": ["windows-latest"]}'

guitest:
needs: changes
needs: [ changes, gatekeeper ]
if: ${{ needs.changes.outputs.src == 'true' }}
uses: ./.github/workflows/guitest.yml
secrets:
PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}
with:
python-version: 3.8
matrix: '{"os": ["windows-latest"]}'
Expand All @@ -72,25 +86,33 @@ jobs:
python-version: 3.8

coverage:
needs: changes
needs: [ changes, gatekeeper ]
if: ${{ needs.changes.outputs.src == 'true' }}
uses: ./.github/workflows/coverage.yml
secrets:
PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}
CODACY_PROJECT_TOKEN: ${{secrets.CODACY_PROJECT_TOKEN}}
with:
python-version: 3.8

# ----------------------------------------------------------------------------
# PR is Ready only
pytest_nix:
needs: changes
needs: [changes, gatekeeper]
if: ${{needs.changes.outputs.src == 'true' && !github.event.pull_request.draft}}
uses: ./.github/workflows/pytest.yml
secrets:
PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}
with:
python-version: 3.8
matrix: '{"os": ["macos-latest", "ubuntu-latest"]}'

guitest_nix:
needs: changes
needs: [changes, gatekeeper]
if: ${{needs.changes.outputs.src == 'true' && !github.event.pull_request.draft}}
uses: ./.github/workflows/guitest.yml
secrets:
PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}
with:
python-version: 3.8
matrix: '{"os": ["macos-latest", "ubuntu-latest"]}'
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ on:
secrets:
CODACY_PROJECT_TOKEN:
required: false
PYTEST_SENTRY_DSN:
required: false

jobs:
generate_and_upload:
name: generate and upload
runs-on: ubuntu-latest

env:
PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}

steps:
- uses: actions/checkout@v3

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/guitest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
type: boolean
required: false

secrets:
PYTEST_SENTRY_DSN:
required: false

jobs:
run:
runs-on: ${{ matrix.os }}
Expand All @@ -29,6 +33,9 @@ jobs:
run:
shell: bash

env:
PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}

timeout-minutes: 10

steps:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
type: boolean
required: false

secrets:
PYTEST_SENTRY_DSN:
required: false

jobs:
run:
runs-on: ${{ matrix.os }}
Expand All @@ -29,6 +33,9 @@ jobs:
run:
shell: bash

env:
PYTEST_SENTRY_DSN: ${{secrets.PYTEST_SENTRY_DSN}}

timeout-minutes: 10

steps:
Expand Down
5 changes: 3 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ pytest-randomly==3.12.0
pytest-timeout==2.1.0
pytest-freezegun==0.4.2
pytest-rerunfailures==10.2
pytest-sentry==0.1.10
pytest-profiling==1.7.0 # for pytest profiling

freezegun==1.2.1
coverage==6.3.2
looptime==0.2

asynctest==0.13.0 # this library has to be installed to properly work with ipv8 TestBase.

scipy==1.8.0

pytest-profiling==1.7.0 # for pytest profiling