You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds --sift-test-results-offline (and matching ini key) to route every
create/update through the JSONL log file without contacting Sift. Skips
the session-start ping, skips the import worker subprocess, and
tolerates missing SIFT_API_KEY / SIFT_GRPC_URI / SIFT_REST_URI by
filling placeholders. Offline + log_file=false is rejected as a usage
error since the log file is the sole sink.
Adds sift_client.pytest_plugin_noop as a sibling plugin: matching
fixture names and method signatures, but measure* calls evaluate bounds
locally via the new value_passes_bounds() helper and nothing reaches
Sift. Useful when test code should keep working without any Sift
configuration at all.
ReportContext gains an offline=True parameter that suppresses the
import worker. Test suite conftest now picks the mode based on the
marker expression and presence of env vars: integration runs with a
real backend stay online with the log file disabled; everything else
forces offline.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|`--sift-test-results-log-file=<path\|true\|false>`| temp file | Where the JSONL log of create/update calls goes. With a log file set, the plugin spawns an `import-test-result-log --incremental` worker that polls the file and replays entries against Sift while the run is in flight. Pass `false` to disable the file entirely; create/update calls then go straight to the API synchronously during tests. |
98
98
|`--no-sift-test-results-git-metadata`| git metadata on | Skip capturing git repo/branch/commit on the report's metadata. |
99
99
|`--sift-test-results-check-connection`| off | Make `report_context`, `step`, and `module_substep` no-op (yield `None`) when `client_has_connection` is `False`. Lets the same suite run locally without a Sift backend. |
100
+
|`--sift-test-results-offline`| off | Route the run entirely through the JSONL log file without contacting Sift. The session-start ping is skipped, the import worker is not spawned, and the file is the sole sink. Replay it later with `import-test-result-log`. Incompatible with `--sift-test-results-log-file=false`. |
100
101
101
102
These can be passed permanently via `addopts`:
102
103
@@ -115,6 +116,7 @@ CLI flags, when passed, override the ini values.
The default `sift_client` fixture reads its two URIs from environment first
120
122
and falls back to ini keys when the env vars are unset. `SIFT_API_KEY` is
@@ -620,19 +622,21 @@ without a reachable Sift server.
620
622
621
623
## Running offline
622
624
623
-
The plugin supports two offline workflows, depending on whether you want a
624
-
Sift report at all when the test environment can't reach Sift. The first
625
-
turns the plugin into a no-op when the server is unreachable. The second
626
-
keeps the plugin running normally and writes every create/update to a local
627
-
JSONL file that you upload from a connected machine afterward.
625
+
The plugin supports three offline workflows, depending on whether you want a
626
+
Sift report at all when the test environment can't reach Sift, and whether
627
+
you want the plugin to make any attempt to contact Sift.
628
628
629
629
| Pattern | Flag | Runtime behavior | Follow-up |
630
630
|---|---|---|---|
631
631
| Skip when offline | `--sift-test-results-check-connection` | Fixtures yield `None`, no log file, no report. Pytest still reports pass/fail. | None. |
632
-
| Capture locally, upload later | `--sift-test-results-log-file=<path>` | Plugin writes every create/update to the JSONL file. | `import-test-result-log <path>` from a connected machine. |
632
+
| Explicit offline | `--sift-test-results-offline` | Plugin never contacts Sift; every create/update goes to a JSONL log file. No session-start ping, no import worker. | `import-test-result-log <path>` from a connected machine. |
633
+
| Capture locally, upload later | `--sift-test-results-log-file=<path>` | Plugin runs in online mode but the worker subprocess dies on connect, leaving the JSONL file on disk. | `import-test-result-log <path>` from a connected machine. |
633
634
634
635
Pattern 1 suits laptop dev and CI without Sift secrets. Pattern 2 suits
635
-
field tests, vehicles on remote sites, and air-gapped labs.
636
+
field tests, vehicles on remote sites, and air-gapped labs where you've
637
+
decided up front that there is no Sift connection. Pattern 3 suits sites
638
+
that *might* have a connection — let the run try, and pick up the log file
0 commit comments