From 29adbd23724479fb2a9233853f36642aac9bf6e0 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Thu, 28 Dec 2023 19:45:59 -0800 Subject: [PATCH] Add print to go tests to monitor for UNUSED_GOLDENS overuse --- client/posttest/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/posttest/main.go b/client/posttest/main.go index c9f5168..3a16edb 100644 --- a/client/posttest/main.go +++ b/client/posttest/main.go @@ -69,6 +69,14 @@ func checkGoldensUsed() { log.Fatalf("%v", err) } } + + // And print out anything that is in UNUSED_GOLDENS that was actually used, so we + // can manually trim UNUSED_GOLDENS + for _, g := range UNUSED_GOLDENS { + if slices.Contains(usedGoldens, g) { + fmt.Printf("Golden %s is in UNUSED_GOLDENS, but was actually used\n", g) + } + } fmt.Println("Validated that all goldens in testdata/ were referenced!") }