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

Function TestViewSubsetTemplate

coderd/database/gentest/models_test.go:27–38  ·  view source on GitHub ↗

TestViewSubsetTemplate ensures TemplateTable is a subset of Template

(t *testing.T)

Source from the content-addressed store, hash-verified

25
26// TestViewSubsetTemplate ensures TemplateTable is a subset of Template
27func TestViewSubsetTemplate(t *testing.T) {
28 t.Parallel()
29 table := reflect.TypeOf(database.TemplateTable{})
30 joined := reflect.TypeOf(database.Template{})
31
32 tableFields := allFields(table)
33 joinedFields := allFields(joined)
34 if !assert.Subset(t, fieldNames(joinedFields), fieldNames(tableFields), "table is not subset") {
35 t.Log("Some fields were added to the Template Table without updating the 'template_with_names' view.")
36 t.Log("See migration 000138_join_users.up.sql to create the view.")
37 }
38}
39
40// TestViewSubsetTemplateVersion ensures TemplateVersionTable is a subset TemplateVersion
41func TestViewSubsetTemplateVersion(t *testing.T) {

Callers

nothing calls this directly

Calls 3

allFieldsFunction · 0.85
fieldNamesFunction · 0.85
LogMethod · 0.80

Tested by

no test coverage detected