Skip to content

ci: make sure golden files are actually up to date #15989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
ci: make sure golden files are actually up to date
  • Loading branch information
mafredri committed Dec 31, 2024
commit ad3073687072d30721fd6b95a5ca8eb3548d6a34
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@ jobs:
# coderd/rbac/object_gen.go:1:1: syntax error: package statement must be first
run: "make --output-sync -B gen"

- name: make update-golden-files
# As above, skip `-j` flag.
run: |
make clean/golden-files
make --output-sync -B update-golden-files

- name: Check for unstaged files
run: ./scripts/check_unstaged.sh

Expand Down
29 changes: 22 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -702,18 +702,33 @@ coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS)

update-golden-files: \
cli/testdata/.gen-golden \
helm/coder/tests/testdata/.gen-golden \
helm/provisioner/tests/testdata/.gen-golden \
enterprise/cli/testdata/.gen-golden \
enterprise/tailnet/testdata/.gen-golden \
tailnet/testdata/.gen-golden \
coderd/.gen-golden \
coderd/notifications/.gen-golden \
provisioner/terraform/testdata/.gen-golden
enterprise/cli/testdata/.gen-golden \
enterprise/tailnet/testdata/.gen-golden \
helm/coder/tests/testdata/.gen-golden \
helm/provisioner/tests/testdata/.gen-golden \
provisioner/terraform/testdata/.gen-golden \
tailnet/testdata/.gen-golden
.PHONY: update-golden-files

clean/golden-files:
find . -type f -name '.gen-golden' -delete
find \
cli/testdata \
coderd/notifications/testdata \
coderd/testdata \
enterprise/cli/testdata \
enterprise/tailnet/testdata \
helm/coder/tests/testdata \
helm/provisioner/tests/testdata \
provisioner/terraform/testdata \
tailnet/testdata \
-type f -name '*.golden' -delete
.PHONY: clean/golden-files

cli/testdata/.gen-golden: $(wildcard cli/testdata/*.golden) $(wildcard cli/*.tpl) $(GO_SRC_FILES) $(wildcard cli/*_test.go)
go test ./cli -run="Test(CommandHelp|ServerYAML|ErrorExamples)" -update
go test ./cli -run="Test(CommandHelp|ServerYAML|ErrorExamples|.*Golden)" -update
touch "$@"

enterprise/cli/testdata/.gen-golden: $(wildcard enterprise/cli/testdata/*.golden) $(wildcard cli/*.tpl) $(GO_SRC_FILES) $(wildcard enterprise/cli/*_test.go)
Expand Down
6 changes: 0 additions & 6 deletions cli/testdata/coder_templates_plan_--help.golden

This file was deleted.

15 changes: 0 additions & 15 deletions enterprise/cli/testdata/coder_provisionerd_--help.golden

This file was deleted.

16 changes: 0 additions & 16 deletions enterprise/cli/testdata/coder_provisionerd_keys_--help.golden

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions enterprise/cli/testdata/coder_provisionerd_keys_list_--help.golden

This file was deleted.

55 changes: 0 additions & 55 deletions enterprise/cli/testdata/coder_provisionerd_start_--help.golden

This file was deleted.

17 changes: 0 additions & 17 deletions enterprise/cli/testdata/coder_wsproxy_--help.golden

This file was deleted.