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
|`report_context`| fixture (autouse) | session | The `ReportContext` backing the run's `TestReport`. Use it to attach metadata or open ad-hoc steps. |
89
89
|`step`| fixture (autouse) | function | A `NewStep` created for the current test function. Exposes `measure*`, `substep`, `report_outcome`, and `current_step`. |
90
90
|`module_substep`| fixture (autouse) | module | One step per test file with each function nested as a substep. |
91
-
|`client_has_connection`| fixture | session |Calls `sift_client.ping.ping()`; consulted only when `--sift-test-results-check-connection` is set. |
91
+
|`client_has_connection`| fixture | session |Pings Sift via `sift_client.ping.ping()`. Consulted at session start when running in online mode. |
92
92
93
93
### CLI options
94
94
95
95
| Flag | Default | Effect |
96
96
|---|---|---|
97
-
|`--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
-
|`--no-sift-test-results-git-metadata`| git metadata on | Skip capturing git repo/branch/commit on the report's metadata. |
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. |
97
+
|`--sift-offline`| off (online) | Skip the session-start ping and don't contact Sift. All create/update calls go to the JSONL log file for later replay via `import-test-result-log`. |
98
+
|`--sift-log-file=<path>`| temp file | Path to write the JSONL log file. In online mode this is a write-through backup; in offline mode it is the sole sink. When unset, a temp file is created and its path emitted via a `logger.info` line at session start. |
99
+
|`--no-sift-log-file`| off | Disable the JSONL log file (online mode only). Create/update calls run inline against the API instead of being deferred through the import worker. Incompatible with `--sift-offline`. |
100
+
|`--sift-no-git-metadata`| git metadata on | Skip capturing git repo/branch/commit on the report's metadata. |
100
101
101
102
These can be set permanently in `pytest.ini`:
102
103
103
104
```ini title="pytest.ini"
104
105
[pytest]
105
-
addopts = --sift-test-results-check-connection
106
+
addopts = --sift-offline
106
107
```
107
108
108
109
!!! warning "FedRAMP / shared environments"
109
-
Pass `--sift-test-results-log-file=false` to skip the temp file + worker
110
-
pipeline. Create/update calls then run inline against the API instead of
111
-
being deferred through a subprocess.
110
+
Pass `--no-sift-log-file` to skip the temp file + worker pipeline. Create/update calls then run inline against the API instead of being deferred through a subprocess.
112
111
113
112
### Report metadata captured automatically
114
113
@@ -119,7 +118,7 @@ Every report the plugin creates includes:
119
118
-`system_operator`: `getpass.getuser()`.
120
119
-`start_time` / `end_time`: set on session enter/exit.
121
120
-`status`: starts at `IN_PROGRESS`, finalized to `PASSED` or `FAILED` on session exit (failure if any step failed or an exception escaped the session).
122
-
-`metadata.git_repo`, `metadata.git_branch`, `metadata.git_commit`: captured via `git remote get-url origin` / `git rev-parse --abbrev-ref HEAD` / `git describe --always --dirty --exclude '*'`. Suppressed by `--no-sift-test-results-git-metadata` or when not in a git repo.
121
+
-`metadata.git_repo`, `metadata.git_branch`, `metadata.git_commit`: captured via `git remote get-url origin` / `git rev-parse --abbrev-ref HEAD` / `git describe --always --dirty --exclude '*'`. Suppressed by `--sift-no-git-metadata` or when not in a git repo.
123
122
124
123
Example invocations:
125
124
@@ -548,94 +547,75 @@ The `unit` argument is a free-form string label (e.g. `"V"`, `"C"`, `"psi"`).
548
547
pytest
549
548
550
549
# Pin the log file so you can replay it later if the import worker dies
See [Running offline](#running-offline) for the same suite running with or
555
-
without a reachable Sift server.
553
+
See [Running offline](#running-offline) for capturing a run locally and
554
+
replaying it later, and [Disabling the plugin](#disabling-the-plugin) for
555
+
keeping test code working when Sift isn't part of the pipeline.
556
556
557
-
## Running offline
557
+
## Modes
558
558
559
-
The plugin supports two offline workflows, depending on whether you want a
560
-
Sift report at all when the test environment can't reach Sift. The first
561
-
turns the plugin into a no-op when the server is unreachable. The second
562
-
keeps the plugin running normally and writes every create/update to a local
563
-
JSONL file that you upload from a connected machine afterward.
559
+
The plugin has two runtime modes. Bad configuration (missing
560
+
`SIFT_API_KEY` / `SIFT_GRPC_URI` / `SIFT_REST_URI`) is a hard error in both
561
+
modes — the failure surfaces with the missing variable named.
564
562
565
-
|Pattern| Flag |Runtime behavior|Follow-up|
566
-
|---|---|---|---|
567
-
|Skip when offline |`--sift-test-results-check-connection`|Fixtures yield `None`, no log file, no report. Pytest still reports pass/fail. | None.|
568
-
|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.|
563
+
|Mode| Flag |Session-start ping|Transport | Log file|
0 commit comments