Add initial work towards checking that all goldens are used

This commit is contained in:
David Dworken 2024-02-09 21:03:03 -08:00
parent 1deb3cffc6
commit d8b9d77213
No known key found for this signature in database
3 changed files with 9 additions and 3 deletions

View File

@ -112,6 +112,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, macos-14]
fail-fast: false
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Go
@ -126,3 +127,4 @@ jobs:
echo ---
ls *
# TODO: Actually do this check that was reverted in 06cc3eedbc5be6a09dbc3f274adcacd875eb25a8
go run client/posttest/main.go check-goldens

View File

@ -9,7 +9,7 @@ forcetest: ## Force running all tests without a test cache
make test
test: ## Run all tests
TZ='America/Los_Angeles' HISHTORY_TEST=1 HISHTORY_SKIP_INIT_IMPORT=1 gotestsum --packages ./... --rerun-fails=10 --rerun-fails-max-failures=30 --format testname --jsonfile /tmp/testrun.json --post-run-command "go run client/posttest/main.go" -- -p 1 -timeout 90m
TZ='America/Los_Angeles' HISHTORY_TEST=1 HISHTORY_SKIP_INIT_IMPORT=1 gotestsum --packages ./... --rerun-fails=10 --rerun-fails-max-failures=30 --format testname --jsonfile /tmp/testrun.json --post-run-command "go run client/posttest/main.go export" -- -p 1 -timeout 90m
ftest: ## Run a specific test specified via `make ftest FILTER=TestParam/testTui/color`
go clean -testcache

View File

@ -29,8 +29,12 @@ var UNUSED_GOLDENS []string = []string{"TestTui-Exit", "testControlR-ControlC-ba
"TestTui-DefaultColorScheme", "TestTui-ColoredOutputWithDefaultFilter"}
func main() {
exportMetrics()
checkGoldensUsed()
if os.Args[1] == "export" {
exportMetrics()
}
if os.Args[1] == "check-goldens" {
checkGoldensUsed()
}
}
func checkGoldensUsed() {