Skip to content

Commit 31763bf

Browse files
authored
Chore(fabric): Enable integration tests (#5192)
1 parent acf7f7e commit 31763bf

File tree

5 files changed

+39
-4
lines changed

5 files changed

+39
-4
lines changed

.circleci/continue_config.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ jobs:
237237
steps:
238238
- halt_unless_core
239239
- checkout
240+
- run:
241+
name: Install OS-level dependencies
242+
command: ./.circleci/install-prerequisites.sh "<< parameters.engine >>"
240243
- run:
241244
name: Generate database name
242245
command: |
@@ -247,6 +250,7 @@ jobs:
247250
echo "export DATABRICKS_CATALOG='$TEST_DB_NAME'" >> "$BASH_ENV"
248251
echo "export REDSHIFT_DATABASE='$TEST_DB_NAME'" >> "$BASH_ENV"
249252
echo "export GCP_POSTGRES_DATABASE='$TEST_DB_NAME'" >> "$BASH_ENV"
253+
echo "export FABRIC_DATABASE='$TEST_DB_NAME'" >> "$BASH_ENV"
250254
- run:
251255
name: Create test database
252256
command: ./.circleci/manage-test-db.sh << parameters.engine >> "$TEST_DB_NAME" up
@@ -303,9 +307,8 @@ workflows:
303307
- redshift
304308
- bigquery
305309
- clickhouse-cloud
306-
- athena
307-
# todo: enable fabric when cicd catalog create/drop implemented in manage-test-db.sh
308-
#- fabric
310+
- athena
311+
- fabric
309312
- gcp-postgres
310313
filters:
311314
branches:

.circleci/install-prerequisites.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@ ENGINE_DEPENDENCIES=""
1717

1818
if [ "$ENGINE" == "spark" ]; then
1919
ENGINE_DEPENDENCIES="default-jdk"
20+
elif [ "$ENGINE" == "fabric" ]; then
21+
echo "Installing Microsoft package repository"
22+
23+
# ref: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server
24+
curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb
25+
sudo dpkg -i packages-microsoft-prod.deb
26+
rm packages-microsoft-prod.deb
27+
28+
ENGINE_DEPENDENCIES="msodbcsql18"
2029
fi
2130

2231
ALL_DEPENDENCIES="$COMMON_DEPENDENCIES $ENGINE_DEPENDENCIES"
2332

2433
echo "Installing OS-level dependencies: $ALL_DEPENDENCIES"
2534

26-
sudo apt-get clean && sudo apt-get -y update && sudo apt-get -y install $ALL_DEPENDENCIES
35+
sudo apt-get clean && sudo apt-get -y update && sudo ACCEPT_EULA='Y' apt-get -y install $ALL_DEPENDENCIES
2736

2837
echo "All done"

.circleci/manage-test-db.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,26 @@ gcp-postgres_down() {
133133
gcp-postgres_exec "drop database $1"
134134
}
135135

136+
# Fabric
137+
fabric_init() {
138+
python --version #note: as at 2025-08-20, ms-fabric-cli is pinned to Python >= 3.10, <3.13
139+
pip install ms-fabric-cli
140+
141+
# to prevent the '[EncryptionFailed] An error occurred with the encrypted cache.' error
142+
# ref: https://microsoft.github.io/fabric-cli/#switch-to-interactive-mode-optional
143+
fab config set encryption_fallback_enabled true
136144

145+
echo "Logging in to Fabric"
146+
fab auth login -u $FABRIC_CLIENT_ID -p $FABRIC_CLIENT_SECRET --tenant $FABRIC_TENANT_ID
147+
}
148+
149+
fabric_up() {
150+
fab create "SQLMesh CircleCI.Workspace/$1.Warehouse"
151+
}
152+
153+
fabric_down() {
154+
fab rm -f "SQLMesh CircleCI.Workspace/$1.Warehouse" || true
155+
}
137156

138157
INIT_FUNC="${ENGINE}_init"
139158
UP_FUNC="${ENGINE}_up"

docs/integrations/engines/fabric.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Fabric
22

3+
!!! info
4+
The Fabric engine adapter is a community contribution. Due to this, only limited community support is available.
5+
36
## Local/Built-in Scheduler
47
**Engine Adapter Type**: `fabric`
58

tests/core/engine_adapter/integration/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ gateways:
198198
workspace_id: {{ env_var("FABRIC_WORKSPACE_ID") }}
199199
odbc_properties:
200200
Authentication: ActiveDirectoryServicePrincipal
201+
check_import: false
201202
state_connection:
202203
type: duckdb
203204

0 commit comments

Comments
 (0)