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

Function TestViewSubsetWorkspace

coderd/database/gentest/models_test.go:88–99  ·  view source on GitHub ↗

TestViewSubsetWorkspace ensures WorkspaceTable is a subset of Workspace

(t *testing.T)

Source from the content-addressed store, hash-verified

86
87// TestViewSubsetWorkspace ensures WorkspaceTable is a subset of Workspace
88func TestViewSubsetWorkspace(t *testing.T) {
89 t.Parallel()
90 table := reflect.TypeOf(database.WorkspaceTable{})
91 joined := reflect.TypeOf(database.Workspace{})
92
93 tableFields := allFields(table)
94 joinedFields := allFields(joined)
95 if !assert.Subset(t, fieldNames(joinedFields), fieldNames(tableFields), "table is not subset") {
96 t.Log("Some fields were added to the Workspace Table without updating the 'workspaces_expanded' view.")
97 t.Log("See migration 000262_workspace_with_names.up.sql to create the view.")
98 }
99}
100
101func TestViewSubsetChat(t *testing.T) {
102 t.Parallel()

Callers

nothing calls this directly

Calls 3

allFieldsFunction · 0.85
fieldNamesFunction · 0.85
LogMethod · 0.80

Tested by

no test coverage detected