AltimateAI / AltimateAI/altimate-code

test(release): integration tests for release-preflight.ts live-check functions

Offen
#1,039 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
811
Forks
134
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
50

Beschreibung

Deferred from the v0.9.3 pre-release review.

### Current behavior

`script/release-preflight.ts` has 41 unit tests covering the pure helper functions: `normalizeVersion`, `parseSemver`, `compareSemver`, `isStableTagName`, `selectPrevTag`, `prereleaseLineTags`.

### Gap

The `main()` function's nine live gates — which shell out to `run()`, `git()`, and `gh` — are untested. A regression in the npm reachability branch or the `gh release-blocker` query logic would not surface until an actual release attempt fails on it, at which point the release is already halted and every second of debug time is on the wire.

### Proposal

Add integration tests that mock the `run()` shim at the test-harness boundary and exercise each of the nine gates. Coverage targets:
- Tag-collision paths — local exists, remote exists, both exist, neither exists.
- Version-sanity failures — npm-view reachable but version already published; npm-view unreachable; malformed SemVer.
- Prerelease-line ancestry — prerelease tag on the same minor line not an ancestor of origin/main.
- Release-blocker query — open PR with the label; API failure; empty result.
- PREV_TAG selection dry-run against a rigged tag graph.

### Why deferred

Requires building the `run()` mocking harness. Test infrastructure work worth its own follow-up.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.