diff --git a/.circleci/continue_config.yml b/.circleci/continue_config.yml index 5fca61d7ed..8f8324a2a0 100644 --- a/.circleci/continue_config.yml +++ b/.circleci/continue_config.yml @@ -237,6 +237,9 @@ jobs: steps: - halt_unless_core - checkout + - run: + name: Install OS-level dependencies + command: ./.circleci/install-prerequisites.sh "<< parameters.engine >>" - run: name: Generate database name command: | @@ -247,6 +250,7 @@ jobs: echo "export DATABRICKS_CATALOG='$TEST_DB_NAME'" >> "$BASH_ENV" echo "export REDSHIFT_DATABASE='$TEST_DB_NAME'" >> "$BASH_ENV" echo "export GCP_POSTGRES_DATABASE='$TEST_DB_NAME'" >> "$BASH_ENV" + echo "export FABRIC_DATABASE='$TEST_DB_NAME'" >> "$BASH_ENV" - run: name: Create test database command: ./.circleci/manage-test-db.sh << parameters.engine >> "$TEST_DB_NAME" up @@ -303,9 +307,8 @@ workflows: - redshift - bigquery - clickhouse-cloud - - athena - # todo: enable fabric when cicd catalog create/drop implemented in manage-test-db.sh - #- fabric + - athena + - fabric - gcp-postgres filters: branches: diff --git a/.circleci/install-prerequisites.sh b/.circleci/install-prerequisites.sh index acd25ae02c..cbd8491535 100755 --- a/.circleci/install-prerequisites.sh +++ b/.circleci/install-prerequisites.sh @@ -17,12 +17,21 @@ ENGINE_DEPENDENCIES="" if [ "$ENGINE" == "spark" ]; then ENGINE_DEPENDENCIES="default-jdk" +elif [ "$ENGINE" == "fabric" ]; then + echo "Installing Microsoft package repository" + + # ref: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server + curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb + sudo dpkg -i packages-microsoft-prod.deb + rm packages-microsoft-prod.deb + + ENGINE_DEPENDENCIES="msodbcsql18" fi ALL_DEPENDENCIES="$COMMON_DEPENDENCIES $ENGINE_DEPENDENCIES" echo "Installing OS-level dependencies: $ALL_DEPENDENCIES" -sudo apt-get clean && sudo apt-get -y update && sudo apt-get -y install $ALL_DEPENDENCIES +sudo apt-get clean && sudo apt-get -y update && sudo ACCEPT_EULA='Y' apt-get -y install $ALL_DEPENDENCIES echo "All done" \ No newline at end of file diff --git a/.circleci/manage-test-db.sh b/.circleci/manage-test-db.sh index 80ca075912..f44bd54845 100755 --- a/.circleci/manage-test-db.sh +++ b/.circleci/manage-test-db.sh @@ -133,7 +133,26 @@ gcp-postgres_down() { gcp-postgres_exec "drop database $1" } +# Fabric +fabric_init() { + python --version #note: as at 2025-08-20, ms-fabric-cli is pinned to Python >= 3.10, <3.13 + pip install ms-fabric-cli + + # to prevent the '[EncryptionFailed] An error occurred with the encrypted cache.' error + # ref: https://microsoft.github.io/fabric-cli/#switch-to-interactive-mode-optional + fab config set encryption_fallback_enabled true + echo "Logging in to Fabric" + fab auth login -u $FABRIC_CLIENT_ID -p $FABRIC_CLIENT_SECRET --tenant $FABRIC_TENANT_ID +} + +fabric_up() { + fab create "SQLMesh CircleCI.Workspace/$1.Warehouse" +} + +fabric_down() { + fab rm -f "SQLMesh CircleCI.Workspace/$1.Warehouse" || true +} INIT_FUNC="${ENGINE}_init" UP_FUNC="${ENGINE}_up" diff --git a/docs/integrations/engines/fabric.md b/docs/integrations/engines/fabric.md index eb00b5ac1d..90ac3234fc 100644 --- a/docs/integrations/engines/fabric.md +++ b/docs/integrations/engines/fabric.md @@ -1,5 +1,8 @@ # Fabric +!!! info + The Fabric engine adapter is a community contribution. Due to this, only limited community support is available. + ## Local/Built-in Scheduler **Engine Adapter Type**: `fabric` diff --git a/tests/core/engine_adapter/integration/config.yaml b/tests/core/engine_adapter/integration/config.yaml index 51241889de..b75efc762b 100644 --- a/tests/core/engine_adapter/integration/config.yaml +++ b/tests/core/engine_adapter/integration/config.yaml @@ -198,6 +198,7 @@ gateways: workspace_id: {{ env_var("FABRIC_WORKSPACE_ID") }} odbc_properties: Authentication: ActiveDirectoryServicePrincipal + check_import: false state_connection: type: duckdb