diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b67c5e..93132b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/app/test_calculator.py b/app/test_calculator.py index f564193..6536cbf 100644 --- a/app/test_calculator.py +++ b/app/test_calculator.py @@ -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