diff --git a/plugins/source_test.go b/plugins/source_test.go index 63b60d87e9..df03e5e6ba 100644 --- a/plugins/source_test.go +++ b/plugins/source_test.go @@ -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, + }, + }, + }, + }}) +} diff --git a/plugins/source_testing.go b/plugins/source_testing.go index e44a00b486..5cd054e66c 100644 --- a/plugins/source_testing.go +++ b/plugins/source_testing.go @@ -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) } }