TestViewSubsetTemplateVersion ensures TemplateVersionTable is a subset TemplateVersion
(t *testing.T)
| 39 | |
| 40 | // TestViewSubsetTemplateVersion ensures TemplateVersionTable is a subset TemplateVersion |
| 41 | func 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 |
nothing calls this directly
no test coverage detected