Skip to content

feat: standard tags, reporters and retries - #18

Merged
philmcneely merged 4 commits into
mainfrom
feat/tags-reporters-retry
Oct 4, 2026
Merged

philmcneely merged 4 commits into
mainfrom
feat/tags-reporters-retry

Conversation

@philmcneely

@philmcneely philmcneely commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Standard test conventions: tag filtering, reporters, retries.

  • Tags: standard markers registered in pytest.ini (smoke, regression, p0-p3, positive, negative, boundary, llm, api). conftest.py also scans test paths at startup and auto-registers any pytest.mark.<name>, so feature markers (login, cart, ...) work with -m cart / -m "smoke and cart" with no unknown-marker warning. --strict-markers removed for this reason (trade-off: typos in marker names are no longer errors).
  • Reporters (all under results/, git-ignored): --junitxml, pytest-html (self-contained), --tracing=retain-on-failure, --screenshot=only-on-failure, --output=results/artifacts. The framework uses its own page fixture (not pytest-playwright's), so the fixture now honors those options itself. Allure unchanged.
  • Retries: pytest-rerunfailures (default 0; --reruns N, --reruns-delay, @pytest.mark.flaky). Documented.
  • Tagged existing tests with priority/type/feature markers (llm on the AI-healing test, api/visual features).
  • CI: uploads results/ as an artifact for smoke and full jobs. Deps (pytest-html, pytest-rerunfailures, pytest-playwright) were already in requirements.
  • Docs: new "Tags, reports and retries" section in docs/USAGE.md.

Verification (fresh Python 3.11 venv from requirements)

  • -m smoke: 4, -m login: 26, -m "smoke and login": 4, -m "login and negative": 23, -m "p0 or p1": 14, -m llm: 1, -m "api and regression": 16 selected; no unknown-marker warnings.
  • Unit + non-browser tests: 80 passed. tests/api (browser): 16 passed. ruff clean.
  • Temp @pytest.mark.cart test (unregistered): -m cart selected it; failure produced .png + .trace.zip only for the failing test; --reruns 1 reported "1 rerun".
  • Not run locally: the login/smoke suites (need the-internet service; CI covers).

Added in follow-up commit

  • Allure: default --alluredir is now results/allure (CLI optional, only to render; CI still passes its own --alluredir). Generation documented.

  • Data setup/teardown (utils/data_seeding.py, env-driven, no hardcoded creds): cleanup/session_cleanup (LIFO registry, runs all callbacks, reports failures), api_seed (httpx client; SEED_API_BASE_URL/SEED_API_TOKEN; create auto-schedules delete; skips if unset), db_seed (SEED_DB_DSN; sqlite built in, postgres via optional psycopg; no-op if unset). Example test tests/test_data_seeding_example.py (-m seeding, skipped without env); unit tests in tests/unit/test_data_seeding.py. Documented under "Data setup & teardown".

  • Verified: 68 passed + 1 skipped (example, no env); against a local stub API the example passed and the server log showed POST -> GET -> DELETE.

  • CI: chromium/firefox now write per-browser JUnit, HTML and artifact paths (results/junit__.xml etc.), so they no longer overwrite each other. Commits carry no attribution trailers.

- Register standard markers (p0-p3, positive/negative/boundary, llm, api) and
  auto-register feature markers so 'pytest -m <feature>' needs no setup
- JUnit XML + HTML reports, trace retain-on-failure, screenshot only-on-failure
  into results/
- Document tag/report/retry conventions in docs/USAGE.md; tag existing tests
- CI uploads results/ artifacts
Copilot AI balanced review requested due to automatic review settings October 4, 2026 16:56
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ All smoke tests passed! View report

@philmcneely
philmcneely force-pushed the feat/tags-reporters-retry branch from 5819f48 to 76b19f6 Compare October 4, 2026 16:59
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ All smoke tests passed! View report

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

BrowserStack and setup failures miss artifacts, while sequential CI runs overwrite earlier browser results.

Review effort: Balanced
Findings: 3 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Adds standardized pytest tagging, reporting artifacts, retries, and CI artifact uploads.

Changes:

  • Registers and applies standard test markers.
  • Adds HTML/JUnit reports, screenshots, traces, and retry documentation.
  • Uploads generated results from CI jobs.
File Description
conftest.py Implements marker discovery and artifact capture.
pytest.ini Configures markers and default reporters.
docs/​USAGE.md Documents tags, reports, and retries.
.github/​workflows/​smoke_full.yml Uploads smoke and full-suite results.
.gitignore Ignores generated results.
tests/​api/​test_api_mocking.py Adds API/regression markers.
tests/​login/​test_login.py Adds priority and type markers.
tests/​login/​test_login_attacks.py Classifies security tests.
tests/​login/​test_login_error_conditions.py Classifies negative and boundary tests.
tests/​visual_regression/​test_visual_regression.py Adds visual regression markers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +231 to +236
- name: Upload standard test results (JUnit XML, HTML, traces)
if: always()
uses: actions/upload-artifact@v4
with:
name: results-smoke
path: results/
Comment thread conftest.py
Comment on lines +258 to +260
def _test_failed(request):
rep = getattr(request.node, "rep_call", None)
return bool(rep and rep.failed)
Comment thread conftest.py
Comment on lines +353 to +355
tracing_mode = _tracing_mode(request)
if tracing_mode != "off":
await context.tracing.start(screenshots=True, snapshots=True, sources=True)
Comment thread docs/USAGE.md
Comment on lines +137 to +138
| Dependency | `llm` (needs an LLM / AI service) |
| **Feature** | anything you like: `login`, `cart`, `checkout`, ... |
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ All chromium login tests passed! View report

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ All smoke tests passed! View report

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ All firefox login tests passed! View report

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ All chromium login tests passed! View report

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ All chromium login tests passed! View report

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ All firefox login tests passed! View report

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ All firefox login tests passed! View report

@philmcneely
philmcneely merged commit d4bffc6 into main Oct 4, 2026
6 checks passed
@philmcneely
philmcneely deleted the feat/tags-reporters-retry branch October 4, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants