Skip to content

Commit f8c36ff

Browse files
committed
changefeedccl: opt out of enriched for column family tests
We recently added metamorphic testing for all tests by default, only opting out for test not compatible with that envelope. There were a few more tests here that failed with that envelope. This commit adds opt outs for those. Epic: none Fixes: #148155 Fixes: #148157 Fixes: #148164 Fixes: #148184 Fixes: #148177 Fixes: #148193 Release note: None
1 parent 6a5fe35 commit f8c36ff

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

pkg/ccl/changefeedccl/alter_changefeed_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,11 @@ func TestAlterChangefeedDropTargetFamily(t *testing.T) {
513513
sqlDB := sqlutils.MakeSQLRunner(s.DB)
514514
sqlDB.Exec(t, `CREATE TABLE foo (a INT PRIMARY KEY, b STRING, FAMILY onlya (a), FAMILY onlyb (b))`)
515515

516-
testFeed := feed(t, f, `CREATE CHANGEFEED FOR foo FAMILY onlya, foo FAMILY onlyb`,
517-
optOutOfMetamorphicEnrichedEnvelope{"requires families"})
516+
var args []any
517+
if _, ok := f.(*webhookFeedFactory); ok {
518+
args = append(args, optOutOfMetamorphicEnrichedEnvelope{reason: "metamorphic enriched envelope does not support column families for webhook sinks"})
519+
}
520+
testFeed := feed(t, f, `CREATE CHANGEFEED FOR foo FAMILY onlya, foo FAMILY onlyb`, args...)
518521
defer closeFeed(t, testFeed)
519522

520523
feed, ok := testFeed.(cdctest.EnterpriseTestFeed)
@@ -1192,7 +1195,11 @@ func TestAlterChangefeedColumnFamilyDatabaseScope(t *testing.T) {
11921195
`INSERT INTO movr.drivers VALUES (1, 'Alice')`,
11931196
)
11941197

1195-
testFeed := feed(t, f, `CREATE CHANGEFEED FOR movr.drivers WITH diff, split_column_families`)
1198+
var args []any
1199+
if _, ok := f.(*webhookFeedFactory); ok {
1200+
args = append(args, optOutOfMetamorphicEnrichedEnvelope{reason: "metamorphic enriched envelope does not support column families for webhook sinks"})
1201+
}
1202+
testFeed := feed(t, f, `CREATE CHANGEFEED FOR movr.drivers WITH diff, split_column_families`, args...)
11961203
defer closeFeed(t, testFeed)
11971204

11981205
assertPayloads(t, testFeed, []string{

pkg/ccl/changefeedccl/changefeed_test.go

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,8 +1913,13 @@ func TestNoBackfillAfterNonTargetColumnDrop(t *testing.T) {
19131913
sqlDB.Exec(t, `CREATE TABLE hasfams (id int primary key, a string, b string, c string, FAMILY id_a (id, a), FAMILY b_and_c (b, c))`)
19141914
sqlDB.Exec(t, `INSERT INTO hasfams values (0, 'a', 'b', 'c')`)
19151915

1916+
var args []any
1917+
if _, ok := f.(*webhookFeedFactory); ok {
1918+
args = append(args, optOutOfMetamorphicEnrichedEnvelope{reason: "metamorphic enriched envelope does not support column families for webhook sinks"})
1919+
}
1920+
19161921
// Open up the changefeed.
1917-
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c`)
1922+
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c`, args...)
19181923
defer closeFeed(t, cf)
19191924
assertPayloads(t, cf, []string{
19201925
`hasfams.b_and_c: [0]->{"after": {"b": "b", "c": "c"}}`,
@@ -1951,8 +1956,12 @@ func TestChangefeedColumnDropsWithFamilyAndNonFamilyTargets(t *testing.T) {
19511956
sqlDB.Exec(t, `INSERT INTO hasfams values (0, 'a', 'b', 'c')`)
19521957
sqlDB.Exec(t, `INSERT INTO nofams values (0, 'a', 'b', 'c')`)
19531958

1959+
var args []any
1960+
if _, ok := f.(*webhookFeedFactory); ok {
1961+
args = append(args, optOutOfMetamorphicEnrichedEnvelope{reason: "metamorphic enriched envelope does not support column families for webhook sinks"})
1962+
}
19541963
// Open up the changefeed.
1955-
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c, TABLE nofams`)
1964+
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c, TABLE nofams`, args...)
19561965
defer closeFeed(t, cf)
19571966
assertPayloads(t, cf, []string{
19581967
`hasfams.b_and_c: [0]->{"after": {"b": "b", "c": "c"}}`,
@@ -2000,8 +2009,13 @@ func TestChangefeedColumnDropsOnMultipleFamiliesWithTheSameName(t *testing.T) {
20002009
sqlDB.Exec(t, `INSERT INTO hasfams values (0, 'a', 'b', 'c')`)
20012010
sqlDB.Exec(t, `INSERT INTO alsohasfams values (0, 'a', 'b', 'c')`)
20022011

2012+
var args []any
2013+
if _, ok := f.(*webhookFeedFactory); ok {
2014+
args = append(args, optOutOfMetamorphicEnrichedEnvelope{reason: "metamorphic enriched envelope does not support column families for webhook sinks"})
2015+
}
2016+
20032017
// Open up the changefeed.
2004-
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c, TABLE alsohasfams FAMILY id_a`)
2018+
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c, TABLE alsohasfams FAMILY id_a`, args...)
20052019
defer closeFeed(t, cf)
20062020
assertPayloads(t, cf, []string{
20072021
`hasfams.b_and_c: [0]->{"after": {"b": "b", "c": "c"}}`,
@@ -2089,8 +2103,13 @@ func TestNoStopAfterNonTargetAddColumnWithBackfill(t *testing.T) {
20892103
sqlDB.Exec(t, `CREATE TABLE hasfams (id INT PRIMARY KEY, a STRING, b STRING, c STRING, FAMILY id_a (id, a), FAMILY b_and_c (b, c))`)
20902104
sqlDB.Exec(t, `INSERT INTO hasfams values (0, 'a', 'b', 'c')`)
20912105

2106+
var args []any
2107+
if _, ok := f.(*webhookFeedFactory); ok {
2108+
args = append(args, optOutOfMetamorphicEnrichedEnvelope{reason: "metamorphic enriched envelope does not support column families for webhook sinks"})
2109+
}
2110+
20922111
// Open up the changefeed.
2093-
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c WITH schema_change_policy='stop'`)
2112+
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c WITH schema_change_policy='stop'`, args...)
20942113

20952114
defer closeFeed(t, cf)
20962115
assertPayloads(t, cf, []string{
@@ -3323,7 +3342,7 @@ func TestChangefeedEachColumnFamily(t *testing.T) {
33233342
sqlDB.Exec(t, `DELETE FROM foo WHERE a>0`)
33243343

33253344
// Deletes send a message for each column family.
3326-
fooWithDiff := feed(t, f, `CREATE CHANGEFEED FOR foo WITH split_column_families, diff`)
3345+
fooWithDiff := feed(t, f, `CREATE CHANGEFEED FOR foo WITH split_column_families, diff`, args...)
33273346
defer closeFeed(t, fooWithDiff)
33283347
sqlDB.Exec(t, `DELETE FROM foo WHERE a=0`)
33293348
assertPayloads(t, fooWithDiff, []string{
@@ -3336,7 +3355,7 @@ func TestChangefeedEachColumnFamily(t *testing.T) {
33363355
// Table with a second column family added after the changefeed starts.
33373356
sqlDB.Exec(t, `CREATE TABLE bar (a INT PRIMARY KEY, FAMILY f_a (a))`)
33383357
sqlDB.Exec(t, `INSERT INTO bar VALUES (0)`)
3339-
bar := feed(t, f, `CREATE CHANGEFEED FOR bar`)
3358+
bar := feed(t, f, `CREATE CHANGEFEED FOR bar`, args...)
33403359
defer closeFeed(t, bar)
33413360
assertPayloads(t, bar, []string{
33423361
`bar: [0]->{"after": {"a": 0}}`,

0 commit comments

Comments
 (0)