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

tests: Upload trace on failed tests #1196

Merged
merged 6 commits into from
Mar 6, 2024
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
19 changes: 19 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ jobs:
timeout-minutes: 20
run: |
make playwright-shiny SUB_FILE=". -vv"
- uses: actions/upload-artifact@v4
if: failure()
with:
name: "playright-shiny-${{ matrix.os }}-${{ matrix.python-version }}-results"
path: test-results/
retention-days: 5

playwright-examples:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -105,6 +111,12 @@ jobs:
timeout-minutes: 20
run: |
make playwright-examples SUB_FILE=". -vv"
- uses: actions/upload-artifact@v4
if: failure()
with:
name: "playright-examples-${{ matrix.os }}-${{ matrix.python-version }}-results"
path: test-results/
retention-days: 5

playwright-deploys:
# Only allow one `playwright-deploys` job to run at a time. (Independent of branch / PR)
Expand Down Expand Up @@ -146,6 +158,13 @@ jobs:
run: |
make playwright-deploys SUB_FILE=". -vv --numprocesses 12"

- uses: actions/upload-artifact@v4
if: failure()
with:
name: "playright-deploys-${{ matrix.os }}-${{ matrix.python-version }}-results"
path: test-results/
retention-days: 5

pypi:
name: "Deploy to PyPI"
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,4 @@ docs/source/reference/
# Developer scratch area
_dev/
tests/playwright/deploys/**/requirements.txt
test-results/
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ playwright-examples: install-playwright ## end-to-end tests on examples with pla
playwright-debug: install-playwright ## All end-to-end tests, chrome only, headed
pytest -c tests/playwright/playwright-pytest.ini tests/playwright/$(SUB_FILE)

playwright-show-trace: ## Show trace of failed tests
npx playwright show-trace test-results/*/trace.zip

testrail-junit: install-playwright install-trcli ## end-to-end tests with playwright and generate junit report
pytest tests/playwright/shiny/$(SUB_FILE) --junitxml=report.xml

Expand Down
4 changes: 1 addition & 3 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[pytest]
asyncio_mode=strict
testpaths=tests/pytest/
; ; Debug version of options
; addopts = --strict-markers --durations=6 --durations-min=5.0 --browser chromium --numprocesses auto --video=retain-on-failure -vv
addopts = --strict-markers --durations=6 --durations-min=5.0 --browser webkit --browser firefox --browser chromium --numprocesses auto
addopts = --strict-markers --durations=6 --durations-min=5.0 --browser webkit --browser firefox --browser chromium --numprocesses auto --tracing=retain-on-failure --video=retain-on-failure
3 changes: 2 additions & 1 deletion tests/playwright/playwright-pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ asyncio_mode=strict
# --browser <name>: browser type to run on playwright
# --numprocesses auto: number of testing workers. auto is number of (virtual) cores
# --video=retain-on-failure: playwright saves recording of any failed test
# --tracing=retain-on-failure: playwright saves trace of any failed test
# -vv: Extra extra verbose output
# # --headed: Headed browser testing
# # -r P: Show extra test summary info: (f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. (w)arnings...
# --maxfail=1: Stop after 1 failure has occurred
addopts = --strict-markers --durations=6 --durations-min=5.0 --browser chromium --numprocesses auto --video=retain-on-failure -vvv --maxfail=1 --headed
addopts = --strict-markers --durations=6 --durations-min=5.0 --browser chromium --numprocesses auto -vvv --maxfail=1 --headed --tracing=retain-on-failure --video=retain-on-failure
Loading