Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions plugins/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,18 @@ func testSyncTable(t *testing.T, tc syncTestCase) {
t.Fatal(err)
}
}

func TestIgnoredColumns(t *testing.T) {
validateResources(t, schema.Resources{{
Item: struct{ A *string }{},
Table: &schema.Table{
Columns: schema.ColumnList{
{
Name: "a",
Type: schema.TypeString,
IgnoreInTests: true,
},
},
},
}})
}
4 changes: 3 additions & 1 deletion plugins/source_testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ func validateResources(t *testing.T, resources []*schema.Resource) {

// Make sure every column has at least one value.
for i, hasValue := range columnsWithValues {
if !hasValue && !(table.Columns[i].Name == "_cq_parent_id" && table.Parent == nil) {
col := table.Columns[i]
emptyExpected := col.Name == "_cq_parent_id" && table.Parent == nil
if !hasValue && !emptyExpected && !col.IgnoreInTests {
t.Errorf("table: %s column %s has no values", table.Name, table.Columns[i].Name)
}
}
Expand Down