Skip to content

python(feat): archive pytest reports on create - #808

Merged
alexluck-sift merged 3 commits into
mainfrom
eng-15045-pytest-plugin-archive-report-on-create-opt-in
Oct 1, 2026
Merged

alexluck-sift merged 3 commits into
mainfrom
eng-15045-pytest-plugin-archive-report-on-create-opt-in

Conversation

@ian-sift

@ian-sift ian-sift commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add an opt-in archive_on_create setting so the pytest plugin archives a report right after creating it. Dev runs can drop out of the default Test Results views.
  • The setting works from --sift-archive-on-create, sift_archive_on_create, SIFT_REPORT_ARCHIVE_ON_CREATE, and [tool.sift.pytest.report]. An explicit false overrides a true from a lower-precedence source.
  • The archive update is written into the JSONL log. Offline replay and batch upload both apply it. If the archive call fails, the plugin logs a warning and the session continues.

https://linear.app/siftstack/issue/ENG-15045/pytest-plugin-archive-report-on-create-opt-in

Test plan

  • pytest lib/sift_client/_tests/pytest_plugin lib/sift_client/_tests/_internal/low_level_wrappers/test_archive_replay.py lib/sift_client/_tests/util/test_report_context.py (211 passed)
  • Set archive_on_create = true in a shared pyproject.toml, run offline, and confirm the footer prints (archived) and the log contains isArchived. Local run of a temp project with that TOML and --sift-offline: the footer printed a separate (archived) line under import-test-result-log, and the JSONL contained [UpdateTestReport] ... "isArchived":true.
  • Set SIFT_REPORT_ARCHIVE_ON_CREATE=false over that TOML value and confirm the report stays unarchived. The same project with that env var printed no (archived) line, and the JSONL had no isArchived.

Dev runs can opt in so they drop out of the default Test Results views. An explicit false still overrides a shared true.
@ian-sift
ian-sift requested a review from scv-sift September 30, 2026 04:11
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Python docs preview: https://sift-stack.github.io/sift/python/pr-808/

Deployed from 14067d1. The link may take up to a minute to become live as GitHub Pages propagates.

@ian-sift
ian-sift requested review from alexluck-sift and scv-sift and removed request for scv-sift September 30, 2026 21:27
The archived note sat on the import command line, so copying that line would not run. Put the note on the next line.
Comment thread python/lib/sift_client/_internal/pytest_plugin/options.py Outdated
Comment thread python/lib/sift_client/_internal/pytest_plugin/terminal.py Outdated
Comment thread python/lib/sift_client/_internal/pytest_plugin/options.py Outdated
Comment thread python/lib/sift_client/util/test_results/context_manager.py
Comment thread python/lib/sift_client/_internal/pytest_plugin/options.py Outdated
Use pytest's None ini default so an unset key does not hide TOML, and print archived on the status row so the upload command stays copyable.
@ian-sift
ian-sift requested a review from alexluck-sift October 1, 2026 03:35
@alexluck-sift
alexluck-sift merged commit 85cd37c into main Oct 1, 2026
26 checks passed
@alexluck-sift
alexluck-sift deleted the eng-15045-pytest-plugin-archive-report-on-create-opt-in branch October 1, 2026 16:57
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