Skip to content
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
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ jobs:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/checkout@v5
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests and collect coverage
run: pytest --cov app --junitxml=junit.xml -o junit_family=legacy
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
run: |
pip install sentry-prevent-cli
sentry-prevent-cli -v upload --report-type test-results
uses: getsentry/prevent-action@v0
env:
PREVENT_TOKEN: ${{ secrets.PREVENT_TOKEN }}
18 changes: 18 additions & 0 deletions app/test_calculator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
import random
import time

from .calculator import Calculator


def test_flaky():
assert random.random() <= 0.8

def test_fail_1():
assert True is False

def test_fail_2():
assert True is False

def test_fail_3():
assert True is False

def test_slow():
time.sleep(5)

def test_add():
assert Calculator.add(1, 2) == 3.0
assert Calculator.add(1.0, 2.0) == 3.0
Expand Down
Loading