Repository navigation
test(cli): snapshot the --json envelopes of map, doctor, config and logs - #1124
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 5 Skipped Deployments
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Thank you for following the naming conventions! 🙏 |
Risk score: Low (1/4)Assessed at ba9198f from the changed files and the title, by
|
@evlog/cli
evlog
@evlog/nuxthub
@evlog/signals
@evlog/telemetry
commit: |
Part of the CLI 1.0 audit (EVL-574). This PR freezes the
--jsonoutput ofmap,doctor,configandlogsso 1.x can't change it by accident.evloghq/actionreadsmap --json.test/json-contract.test.tsruns each command throughrun(), the CLI's real entry, against one Hono fixture. The fixture has anevlog.config.ts, an installedevlogand two fs-drain events. It then snapshots the exit code and the parsed envelope. It masks only what differs between machines and releases: the temp dir (<cwd>), the CLI version, the Node version andmap.generatedAt. It setsEVLOG_CLI_ENV=test, soenvironmentis also stable. The tests pass with and withoutCI=true GITHUB_ACTIONS=true.Snapshot excerpt (map):
Test-only, so no changeset.
map --jsonagainst published CLIsSame fixture,
evlog map --no-write --no-header --json, all three exit 0.generatedAt,cliVersionandenvironmentare normalised, keys sorted withjq -S:For the CLI 1.0 release notes and
evloghq/action:grade,ignoredandroutes[].event(feat(cli): record the wide event each entry point carries in evlog map #1075) are new fields. Nothing the action reads was removed or renamed.ruleSetVersiongoes from 1 to 3. Passing--baselinewith anevlog.map.jsoncommitted by a 0.x CLI exits 2 (MAP_BASELINE_VERSION_MISMATCH) until the file is regenerated, and the CLI 1.0 release notes should say so. The action scans the base with its own CLI, but a project that installs@evlog/clihad its pull request scanned with a different version than its base. fix: scan the base with the CLI the project installed action#16 fixes that.Checks
pnpm --filter @evlog/cli exec vitest run: 931 passedpnpm --filter @evlog/cli run typecheck,eslinton the new file: cleanELI5
Some tools read the CLI's machine-readable output. These tests record exactly what that output looks like today, so any change to it shows up in review instead of breaking those tools.