chore(Makefile): update golden files as part of make gen (#17039)

Updating golden files is an unnecessary extra step in addition to gen
that is easily overlooked, leading to the developer noticing the issue
in CI leading to lost developer time waiting for tests to complete.
This commit is contained in:
Mathias Fredriksson
2025-03-21 15:04:30 +02:00
committed by GitHub
parent de6080c46d
commit b79167293c
8 changed files with 37 additions and 34 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ import (
// UpdateGoldenFiles indicates golden files should be updated.
// To update the golden files:
// make update-golden-files
// make gen/golden-files
var UpdateGoldenFiles = flag.Bool("update", false, "update .golden files")
func TestDebugTemplate(t *testing.T) {
@@ -64,11 +64,11 @@ func TestDebugTemplate(t *testing.T) {
}
expected, err := os.ReadFile(goldenPath)
require.NoError(t, err, "read golden file, run \"make update-golden-files\" and commit the changes")
require.NoError(t, err, "read golden file, run \"make gen/golden-files\" and commit the changes")
require.Equal(
t, string(expected), string(actual),
"golden file mismatch: %s, run \"make update-golden-files\", verify and commit the changes",
"golden file mismatch: %s, run \"make gen/golden-files\", verify and commit the changes",
goldenPath,
)
}