Skip to content

Commit cf37a88

Browse files
committed
materialize-iceberg: only run rest catalog tests
1 parent 984b71b commit cf37a88

File tree

8 files changed

+589
-13
lines changed

8 files changed

+589
-13
lines changed

materialize-iceberg/.snapshots/TestIntegration-apply

Lines changed: 348 additions & 0 deletions
Large diffs are not rendered by default.

materialize-iceberg/.snapshots/TestIntegration-materialize

Lines changed: 65 additions & 0 deletions
Large diffs are not rendered by default.

materialize-iceberg/.snapshots/TestIntegration-migrate

Lines changed: 96 additions & 0 deletions
Large diffs are not rendered by default.

materialize-iceberg/driver_test.go

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
package connector
22

33
import (
4+
"flag"
5+
"os"
46
"testing"
57

68
boilerplate "github.com/estuary/connectors/materialize-boilerplate/testutil"
79
)
810

11+
// testAll controls whether integration tests run against every catalog
12+
// configuration (REST, Glue, S3 Tables, and their deprecated variants) or only
13+
// against the REST catalog. Running the full matrix is slow and requires
14+
// credentials for multiple cloud backends, so by default we only exercise the
15+
// REST catalog. Opt in to the full matrix by setting the `ICEBERG_TEST_ALL`
16+
// environment variable or passing `-iceberg.test-all` to `go test`.
17+
var testAll = flag.Bool("iceberg.test-all", false, "run integration tests against all catalog configurations (REST, Glue, S3 Tables) instead of REST only")
18+
919
func TestIntegration(t *testing.T) {
1020
if testing.Short() {
1121
t.Skip()
@@ -15,15 +25,26 @@ func TestIntegration(t *testing.T) {
1525
return resource{Table: table}
1626
}
1727

28+
all := *testAll || os.Getenv("ICEBERG_TEST_ALL") != ""
29+
30+
materializeSpec := "testdata/materialize-rest.flow.yaml"
31+
applySpec := "testdata/apply-rest.flow.yaml"
32+
migrateSpec := "testdata/migrate-rest.flow.yaml"
33+
if all {
34+
materializeSpec = "testdata/materialize.flow.yaml"
35+
applySpec = "testdata/apply.flow.yaml"
36+
migrateSpec = "testdata/migrate.flow.yaml"
37+
}
38+
1839
t.Run("materialize", func(t *testing.T) {
19-
boilerplate.RunMaterializationTestParallel(t, newMaterialization, "testdata/materialize.flow.yaml", makeResourceFn, nil)
40+
boilerplate.RunMaterializationTestParallel(t, newMaterialization, materializeSpec, makeResourceFn, nil)
2041
})
2142

2243
t.Run("apply", func(t *testing.T) {
23-
boilerplate.RunApplyTestParallel(t, &Driver{}, newMaterialization, "testdata/apply.flow.yaml", makeResourceFn)
44+
boilerplate.RunApplyTestParallel(t, &Driver{}, newMaterialization, applySpec, makeResourceFn)
2445
})
2546

2647
t.Run("migrate", func(t *testing.T) {
27-
boilerplate.RunMigrationTestParallel(t, newMaterialization, "testdata/migrate.flow.yaml", makeResourceFn, nil)
48+
boilerplate.RunMigrationTestParallel(t, newMaterialization, migrateSpec, makeResourceFn, nil)
2849
})
2950
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
materializations:
2+
acmeCo/tests/materialize-iceberg/rest:
3+
endpoint:
4+
local:
5+
command: ["go", "run", "./cmd/connector"]
6+
protobuf: true
7+
config: config.rest.yaml
8+
bindings: []
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import:
2+
- ../../materialize-boilerplate/testdata/integration/collections.materialize.flow.yaml
3+
4+
materializations:
5+
acmeCo/tests/materialize-iceberg/rest:
6+
endpoint:
7+
local:
8+
command: ["go", "run", "./cmd/connector"]
9+
protobuf: true
10+
config: config.rest.yaml
11+
bindings:
12+
- resource:
13+
table: simple_standard
14+
source: tests/simple
15+
fields:
16+
recommended: true
17+
# The tests/not-simple collection is intentionally omitted for the REST
18+
# (Polaris) catalog: several of its field names (notably the required key
19+
# containing unicode supplementary characters and other punctuation) cause
20+
# Polaris table creation to fail with a 500. Since the problematic column
21+
# is part of the collection key, it can't be dropped via field selection,
22+
# so we skip the whole binding here. It is still exercised by the Glue and
23+
# S3 Tables tasks.
24+
- resource:
25+
table: data_types
26+
source: tests/data-types
27+
fields:
28+
recommended: true

materialize-iceberg/testdata/materialize.flow.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ materializations:
1414
source: tests/simple
1515
fields:
1616
recommended: true
17-
- resource:
18-
table: not_simple
19-
source: tests/not-simple
20-
fields:
21-
recommended: true
17+
# tests/not-simple is skipped for REST (Polaris): its required unicode key
18+
# field breaks Polaris table creation, and since it's a key it can't be
19+
# dropped via field selection.
2220
- resource:
2321
table: data_types
2422
source: tests/data-types
@@ -37,11 +35,7 @@ materializations:
3735
source: tests/simple
3836
fields:
3937
recommended: true
40-
- resource:
41-
table: not_simple
42-
source: tests/not-simple
43-
fields:
44-
recommended: true
38+
# See note on the rest task above for why tests/not-simple is omitted.
4539
- resource:
4640
table: data_types
4741
source: tests/data-types
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import:
2+
- ../../materialize-boilerplate/testdata/integration/collections.migrate-base.flow.yaml
3+
4+
materializations:
5+
acmeCo/tests/materialize-iceberg/rest:
6+
endpoint:
7+
local:
8+
command: ["go", "run", "./cmd/connector"]
9+
protobuf: true
10+
config: config.rest.yaml
11+
bindings:
12+
- resource:
13+
table: migrate
14+
source: key/value
15+
fields:
16+
recommended: true

0 commit comments

Comments
 (0)