Repository navigation
Add golden output snapshots and one version source - #3
Merged
Merged
Conversation
Snapshot examples/aws-web-app for both targets under pkg/engine/testdata, including each target's warnings, so an emitter change cannot alter generated TypeScript without showing up in review. The test runs from the repository root so the embedded source path stays portable; -update rewrites the snapshots. The release version now lives in internal/buildinfo/VERSION and is embedded at build time, so go build, go run and make build all report the same value through `openiac version`. A CLI test pins the output and the golden tests close the v0.1.1 exit criteria.
be-thomas
commented
Oct 26, 2026
be-thomas
left a comment
Owner
Author
There was a problem hiding this comment.
Reviewed at 0d8885a. Verified locally: gofmt clean, go vet clean, go test ./... passes, the golden test is deterministic across 25 runs, the snapshots contain no absolute paths or timestamps and map-derived output is sorted, and go run ./cmd/openiac version and go build both report openiac 0.1.0-dev (the Makefile build target adds no ldflags). The findings below are low severity; none blocks the change.
Address review findings on the golden test: - Find the module root from the test file instead of assuming the binary starts in pkg/engine, so a prebuilt test binary run from any directory still finds the example. - Snapshot a second fixture that cannot be fully converted, so the warning section of a golden file is actually populated and changes to warning collection are visible. The test fails if that fixture stops reporting warnings. - Keep v0.1.1 marked in progress: VERSION still carries a -dev suffix and no tag exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes the remaining v0.1.1 release-hardening items.
pkg/engine/golden_test.gosnapshotsexamples/aws-web-appfor CDK and Pulumi underpkg/engine/testdata/golden/, including each target's warnings. The test runs from the repository root so the// Source:path in generated code stays portable across machines;-updaterewrites the snapshots.internal/buildinfo/VERSIONand is embedded at build time, sogo build,go runandmake buildall report the same value throughopeniac version. A CLI test pins the output.Why
The last two commits changed emitter output (JSON nested-block recovery, single interpolations). Without snapshots that drift is invisible in review.
Verification
gofmt -l .clean,go vet ./...cleango test ./...andgo test -race ./pkg/... ./internal/... ./cmd/...passOPENIAC_CORPUS=1 go test ./pkg/parsers/hcl -run TestParseConformanceCorpusparses 853 modulesmake build,make wasm,./bin/openiac version→openiac 0.1.0-devmake conformance-verify→ 853 fixtures, 6,471 files, 24,314,566 bytes