MCPcopy Index your code
hub / github.com/coder/coder / TestViewSubsetTemplateVersion

Function TestViewSubsetTemplateVersion

coderd/database/gentest/models_test.go:41–52  ·  view source on GitHub ↗

TestViewSubsetTemplateVersion ensures TemplateVersionTable is a subset TemplateVersion

(t *testing.T)

Source from the content-addressed store, hash-verified

39
40// TestViewSubsetTemplateVersion ensures TemplateVersionTable is a subset TemplateVersion
41func TestViewSubsetTemplateVersion(t *testing.T) {
42 t.Parallel()
43 table := reflect.TypeOf(database.TemplateVersionTable{})
44 joined := reflect.TypeOf(database.TemplateVersion{})
45
46 tableFields := allFields(table)
47 joinedFields := allFields(joined)
48 if !assert.Subset(t, fieldNames(joinedFields), fieldNames(tableFields), "table is not subset") {
49 t.Log("Some fields were added to the TemplateVersion Table without updating the 'template_version_with_user' view.")
50 t.Log("See migration 000141_join_users_build_version.up.sql to create the view.")
51 }
52}
53
54// TestViewSubsetWorkspaceBuild ensures WorkspaceBuildTable is a subset of
55// WorkspaceBuild, with the exception of ProvisionerState which is

Callers

nothing calls this directly

Calls 3

allFieldsFunction · 0.85
fieldNamesFunction · 0.85
LogMethod · 0.80

Tested by

no test coverage detected