Skip to content
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
16 changes: 16 additions & 0 deletions PILOT.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Use a disposable branch and wholly synthetic data. Stop if the test adds no valu
| Reviewed fixtures need a second check | Run the mixed-profile starter; adapt one group in a disposable branch. |
| Response shapes drift | Add an explicit projection to one existing parser regression. |
| Recovery is hard to reproduce | Try the response replay starter at your existing mock boundary. |
| Cache expiry or outage timing is hard to reproduce | [Try one virtual-time regression](#try-one-virtual-time-regression). |
| CI reports are difficult to compare | Open the authored Studio comparison; no installation needed. |

- [Mixed-profile starter](https://flyzdev.github.io/fixturekit/downloads/fixturekit-mixed-starter-a9.zip) ([SHA-256](https://flyzdev.github.io/fixturekit/downloads/fixturekit-mixed-starter-a9.zip.sha256))
Expand Down Expand Up @@ -76,6 +77,21 @@ For the prioritized Tuya contributor workflow, download the [portable Tuya start

[Tuya maintainer trial](examples/tuya-contributor/MAINTAINER_TRIAL.md): compare the helper with the current manual workflow and tell us whether the dependency is worthwhile.

### Try one virtual-time regression

Follow the [P2 quickstart](QUICKSTART.md#try-a-virtual-time-scenario-without-cloning)
to run the bundled climate sequence, deliberately change one expectation and
restore it. Compare this timeline with one hand-written test you already maintain:
are the response and expectation fields easier to inspect, and does virtual
time remove any sleeps or clock mocking? Record setup time and any steps saved
or added. Keep your existing parser and transport tests.

The [Cosa example](examples/diff/cosa/README.md) demonstrates a trusted Python
callback with a real coordinator; the separate [first-party Cosa CI](https://github.com/FlyzDev/cosa-ha/tree/131ac9d2c2cdc2dc00611ad317783613389d9035/scenario_tests)
uses the historical P1 runner. P2 corrects editor data-loss behavior; it does
not replace actual device or HA entity lifecycle tests. No independent adoption
is implied. Synthetic input only; no device credentials or raw captures.

## 3. Compare against your existing workflow

For one synthetic fixture or mock sequence, record the original test outcome,
Expand Down
48 changes: 48 additions & 0 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ a local review candidate. No account, cloud service or device access required.
| Turn a response into a small regression fixture | [First projection](#project-a-synthetic-response-without-cloning) |
| Check several fixture formats in CI | [Mixed-profile starter ZIP](https://flyzdev.github.io/fixturekit/downloads/fixturekit-mixed-starter-a9.zip) |
| Test failure and recovery without a device | [Response replay starter ZIP](https://flyzdev.github.io/fixturekit/downloads/fixturekit-response-replay-a9.zip) |
| Author a virtual-time regression with an optional GUI | [Scenario Preview P2](#try-a-virtual-time-scenario-without-cloning) |
| Explore results without installing anything | [Recorded Studio demo](https://flyzdev.github.io/fixturekit/studio-demo/) |

## First check without a source checkout
Expand Down Expand Up @@ -186,6 +187,53 @@ The converter reports `candidate-written` with `manual_review_required`;
a second conversion into the same directory returns exit 2 rather than
overwriting the candidate. Review every field before sharing real data.

## Try a virtual-time scenario without cloning

Download [Scenario Preview P2](https://flyzdev.github.io/fixturekit/downloads/fixturekit-scenario-preview-p2.zip)
and its [SHA-256 checksum](https://flyzdev.github.io/fixturekit/downloads/fixturekit-scenario-preview-p2.zip.sha256).
Verify the ZIP before extracting to a new directory. On macOS/Linux, from the download directory:

shasum -a 256 -c fixturekit-scenario-preview-p2.zip.sha256

On Windows PowerShell, compare the output of the following commands (the first
64 hexadecimal characters must match):

(Get-FileHash .\fixturekit-scenario-preview-p2.zip -Algorithm SHA256).Hash
Get-Content .\fixturekit-scenario-preview-p2.zip.sha256

From the extracted directory, use a separate Python 3.12 environment (not the
Core-only environment above). On macOS/Linux:

python3.12 -m venv .venv
.venv/bin/python -m pip install --require-hashes --only-binary=:all: -r examples/scenario/requirements-offline.txt
.venv/bin/python -m examples.scenario.offline_regression --manifest examples/scenario/climate-timed.json

On Windows PowerShell:

py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install --require-hashes --only-binary=:all: -r examples/scenario/requirements-offline.txt
.\.venv\Scripts\python.exe -m examples.scenario.offline_regression --manifest examples/scenario/climate-timed.json

Expect `status: pass`, four observations and `virtual_elapsed_ms: 31000`
(exit 0). The virtual clock advances without sleeping. Setup needs package
access; the scenario itself needs no device, network service or Home Assistant.

To see a failure, make a new copy of the manifest and change only the last
`expected.temperature` from `23` to `24`. Run the same command with the copy's
path instead. Expect `status: fail`, one `values_changed` difference and exit 1.
Restore the expectation and rerun for a pass. An invalid manifest gives exit 2.

With Tk installed, launch `python -m examples.scenario.editor` using the same
virtual environment's Python executable. Open `examples/scenario/climate-timed.json`,
select the last row, change Expected temp. to 24, choose Update, then Run.
Save new writes a separate file; P2 warns before discarding unsaved changes.
The editor is optional; the CLI above does not require Tk.

[Setup and limitations](examples/scenario/PORTABLE.md) ·
[Voluntary maintainer trial](PILOT.md#try-one-virtual-time-regression).
P2 is a source bundle, not an installer or a real device simulator. The
historical P1 archive remains unchanged for pinned consumers.

## Continue with bundled examples

To try projection and conversion on the versioned synthetic fixtures,
Expand Down
Loading