Skip to content
Open
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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ test-coverage: check-coverage-threshold test ## Runs tests and enforces coverage
fi; \
echo "Coverage check passed"

.PHONY: update-goldens
update-goldens: ## Regenerates golden test fixtures (catalog/coverage/render parity); review with git diff before committing
@GOFLAGS="-mod=readonly" AICR_UPDATE_GOLDEN=1 go test -count=1 -run 'TestCatalogParityGolden|TestCoverageGoldenMatrix' ./pkg/recipe/
@GOFLAGS="-mod=readonly" AICR_UPDATE_GOLDEN=1 go test -count=1 -run 'TestStockRenderParityGolden' ./pkg/bundler/
Comment thread
coderabbitai[bot] marked this conversation as resolved.

.PHONY: bench
bench: ## Runs benchmarks
@echo "Running benchmarks..."
Expand Down
3 changes: 3 additions & 0 deletions pkg/bundler/stock_render_parity_golden_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ func TestStockRenderParityGolden(t *testing.T) {
}

if os.Getenv("AICR_UPDATE_GOLDEN") == "1" {
if t.Failed() {
t.Fatal("not writing golden: one or more leaves failed to resolve or render (see errors above)")
}
writeStockRenderGolden(t, got)
t.Logf("golden updated: %d leaves", len(got))
return
Expand Down
3 changes: 3 additions & 0 deletions pkg/recipe/catalog_parity_golden_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func TestCatalogParityGolden(t *testing.T) {
}

if os.Getenv("AICR_UPDATE_GOLDEN") == "1" {
if t.Failed() {
t.Fatal("not writing golden: one or more leaves failed to resolve (see errors above)")
}
writeCatalogParityGolden(t, got)
t.Logf("golden updated: %d leaves", len(got))
return
Expand Down
3 changes: 3 additions & 0 deletions pkg/recipe/coverage_matrix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ func TestCoverageGoldenMatrix(t *testing.T) {
}

if os.Getenv("AICR_UPDATE_GOLDEN") == "1" {
if t.Failed() {
t.Fatal("not writing golden: one or more projections failed to classify (see errors above)")
}
writeGolden(t, got)
t.Logf("golden updated: %d projections", len(got))
return
Expand Down
Loading