File tree Expand file tree Collapse file tree 6 files changed +53
-3
lines changed
acceptance/bundle/invariant Expand file tree Collapse file tree 6 files changed +53
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ resources:
2020 database_instance_name: $ {resources.database_instances.instance1.name }
2121 logical_database_name: $ {resources.database_catalogs.catalog1.database_name }
2222 spec:
23- source_table_full_name: samples.nyctaxi.trips
23+ # Use a unique source table per test run to avoid hitting the 20-table-per-source limit
24+ source_table_full_name: main.test_synced_ $UNIQUE_NAME .trips_source
2425 scheduling_policy: SNAPSHOT
2526 primary_key_columns:
2627 - tpep_pickup_datetime
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Clean up the temporary source table
4+ echo " Cleaning up temporary source table"
5+ $CLI tables delete main.test_synced_$UNIQUE_NAME .trips_source || true
6+ $CLI schemas delete main.test_synced_$UNIQUE_NAME || true
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Create a unique source table for this test run to avoid hitting the 20-table-per-source limit
4+ echo " Creating temporary source table: main.test_synced_$UNIQUE_NAME .trips_source"
5+
6+ # Create schema using CLI
7+ $CLI schemas create test_synced_$UNIQUE_NAME main -o json | jq ' {full_name}'
8+
9+ # Create source table from samples.nyctaxi.trips using SQL API
10+ # MSYS_NO_PATHCONV=1 prevents Git Bash on Windows from converting /api/... to C:/Program Files/Git/api/...
11+ MSYS_NO_PATHCONV=1 $CLI api post " /api/2.0/sql/statements/" --json " {
12+ \" warehouse_id\" : \" $TEST_DEFAULT_WAREHOUSE_ID \" ,
13+ \" statement\" : \" CREATE TABLE main.test_synced_$UNIQUE_NAME .trips_source AS SELECT * FROM samples.nyctaxi.trips LIMIT 10\" ,
14+ \" wait_timeout\" : \" 45s\"
15+ }" > /dev/null
Original file line number Diff line number Diff line change 44# Copy data files to test directory
55cp -r "$TESTDIR/../data/." . &> LOG.cp
66
7+ # Run init script if present
8+ INIT_SCRIPT="$TESTDIR/../configs/$INPUT_CONFIG-init.sh"
9+ if [ -f "$INIT_SCRIPT" ]; then
10+ source "$INIT_SCRIPT" &> LOG.init
11+ fi
12+
713envsubst < $TESTDIR/../configs/$INPUT_CONFIG > databricks.yml
814
915cp databricks.yml LOG.config
@@ -16,6 +22,12 @@ cat LOG.validate | contains.py '!panic' '!internal error' > /dev/null
1622cleanup() {
1723 trace $CLI bundle destroy --auto-approve &> LOG.destroy
1824 cat LOG.destroy | contains.py '!panic' '!internal error' > /dev/null
25+
26+ # Run cleanup script if present
27+ CLEANUP_SCRIPT="$TESTDIR/../configs/$INPUT_CONFIG-cleanup.sh"
28+ if [ -f "$CLEANUP_SCRIPT" ]; then
29+ source "$CLEANUP_SCRIPT" &> LOG.cleanup
30+ fi
1931}
2032
2133trap cleanup EXIT
Original file line number Diff line number Diff line change @@ -35,3 +35,12 @@ EnvMatrix.INPUT_CONFIG = [
3535 " synced_database_table.yml.tmpl" ,
3636 " volume.yml.tmpl" ,
3737]
38+
39+ # Fake SQL endpoint for local tests
40+ [[Server ]]
41+ Pattern = " POST /api/2.0/sql/statements/"
42+ Response.Body = ' {"status": {"state": "SUCCEEDED"}, "manifest": {"schema": {"columns": []}}}'
43+
44+ [[Server ]]
45+ Pattern = " DELETE /api/2.1/unity-catalog/tables/{name}"
46+ Response.Body = ' {"status": "OK"}'
Original file line number Diff line number Diff line change @@ -109,6 +109,13 @@ resources:
109109
110110 # database_instances: no special config
111111
112- # database_catalogs: no special config
112+ database_catalogs :
113+ ignore_remote_changes :
114+ # Backend does not set this:
115+ - create_database_if_not_exists
113116
114- # synced_database_tables: no special config
117+ synced_database_tables :
118+ ignore_remote_changes :
119+ # Backend does not set these fields in response (it sets effective_ counterparts instead)
120+ - database_instance_name
121+ - logical_database_name
You can’t perform that action at this time.
0 commit comments