Skip to content

Commit

Permalink
Change comments and verbiage
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemassa committed Jan 29, 2024
1 parent 42b6fb7 commit 26c0a84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ func TestUserConfigAllTested(t *testing.T) {
userConfigKey := u.Field(i).Tag.Get("mapstructure")
t.Run(userConfigKey, func(t *testing.T) {
// By default, we expect all fields in UserConfig to have flags defined in server.go and tested here in server_test.go
// Some fields are too complicated to have flags, so are only expressible in the yaml
// Some fields are too complicated to have flags, so are only expressible in the config yaml
flagKey := u.Field(i).Tag.Get("flag")
if flagKey == "false" {
return
}
// If a setting is configured in server.UserConfig, it should be tested here. If there is no corresponding const
// for specifying the flag, that probably means one *also* needs to be added to server.go
if _, ok := testFlags[userConfigKey]; !ok {
t.Errorf("server.UserConfig has field with mapstructure %s that is either not tested or not configured as a flag. Either add it to server_test.testFlags, or remove it from server.UserConfig", userConfigKey)
t.Errorf("server.UserConfig has field with mapstructure %s that is not tested, and potentially also not configured as a flag. Either add it to testFlags (and potentially as a const in cmd/server), or remove it from server.UserConfig", userConfigKey)
}
})

Expand Down

0 comments on commit 26c0a84

Please sign in to comment.