Skip to content

Commit e551d67

Browse files
committed
PR feedback
1 parent 21a6ffe commit e551d67

File tree

4 files changed

+36
-16
lines changed

4 files changed

+36
-16
lines changed

.circleci/continue_config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,11 @@ jobs:
144144
- halt_unless_core
145145
- checkout
146146
- run:
147-
name: Run the migration test
148-
command: ./.circleci/test_migration.sh
147+
name: Run the migration test - sushi
148+
command: ./.circleci/test_migration.sh sushi "--gateway duckdb_persistent"
149+
- run:
150+
name: Run the migration test - sushi_dbt
151+
command: ./.circleci/test_migration.sh sushi_dbt "--config migration_test_config"
149152

150153
ui_style:
151154
docker:

.circleci/test_migration.sh

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#!/usr/bin/env bash
22
set -ex
33

4-
GATEWAY_NAME="duckdb_persistent"
5-
TMP_DIR=$(mktemp -d)
6-
SUSHI_DIR="$TMP_DIR/sushi"
7-
8-
94
if [[ -z $(git tag --points-at HEAD) ]]; then
105
# If the current commit is not tagged, we need to find the last tag
116
LAST_TAG=$(git describe --tags --abbrev=0)
@@ -14,28 +9,48 @@ else
149
LAST_TAG=$(git tag --sort=-creatordate | head -n 2 | tail -n 1)
1510
fi
1611

12+
if [ "$1" == "" ]; then
13+
echo "Usage: $0 <example name> <sqlmesh opts>"
14+
echo "eg $0 sushi '--gateway duckdb_persistent'"
15+
exit 1
16+
fi
17+
18+
19+
TMP_DIR=$(mktemp -d)
20+
EXAMPLE_NAME="$1"
21+
SQLMESH_OPTS="$2"
22+
EXAMPLE_DIR="./examples/$EXAMPLE_NAME"
23+
TEST_DIR="$TMP_DIR/$EXAMPLE_NAME"
24+
25+
echo "Running migration test for '$EXAMPLE_NAME' in '$TEST_DIR' for example project '$EXAMPLE_DIR' using options '$SQLMESH_OPTS'"
26+
1727
git checkout $LAST_TAG
1828

1929
# Install dependencies from the previous release.
2030
make install-dev
2131

22-
cp -r ./examples/sushi $TMP_DIR
32+
cp -r $EXAMPLE_DIR $TEST_DIR
33+
34+
# this is only needed temporarily until the released tag for $LAST_TAG includes this config
35+
if [ "$EXAMPLE_NAME" == "sushi_dbt" ]; then
36+
echo 'migration_test_config = sqlmesh_config(Path(__file__).parent, dbt_target_name="duckdb")' >> $TEST_DIR/config.py
37+
fi
2338

2439
# Run initial plan
25-
pushd $SUSHI_DIR
40+
pushd $TEST_DIR
2641
rm -rf ./data/*
27-
sqlmesh --gateway $GATEWAY_NAME plan --no-prompts --auto-apply
42+
sqlmesh $SQLMESH_OPTS plan --no-prompts --auto-apply
2843
rm -rf .cache
2944
popd
3045

31-
# Switch back to the starting state of the repository
46+
# Switch back to the starting state of the repository
3247
git checkout -
3348

3449
# Install updated dependencies.
3550
make install-dev
3651

3752
# Migrate and make sure the diff is empty
38-
pushd $SUSHI_DIR
39-
sqlmesh --gateway $GATEWAY_NAME migrate
40-
sqlmesh --gateway $GATEWAY_NAME diff prod
41-
popd
53+
pushd $TEST_DIR
54+
sqlmesh $SQLMESH_OPTS migrate
55+
sqlmesh $SQLMESH_OPTS diff prod
56+
popd

examples/sushi_dbt/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
config = sqlmesh_config(Path(__file__).parent)
66

77
test_config = config
8+
9+
migration_test_config = sqlmesh_config(Path(__file__).parent, dbt_target_name="duckdb")

sqlmesh/core/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class DbtNodeInfo(PydanticModel):
183183

184184
fqn: str
185185
"""Used for selectors in --select/--exclude.
186-
Takes the filesystem into account so may be structured differently to :resource_name.
186+
Takes the filesystem into account so may be structured differently to :unique_id.
187187
188188
Examples:
189189
- jaffle_shop.staging.unique_stg_orders_order_id

0 commit comments

Comments
 (0)