V1.8.0b1 #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# **what?** | ||
# Runs integration tests. | ||
# **why?** | ||
# Ensure code runs as expected. | ||
# **when?** | ||
# This will run for all PRs, when code is pushed to a main branch | ||
# branch, and when manually triggered. | ||
name: Adapter Integration Tests | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "*.latest" | ||
- "v*" | ||
permissions: | ||
contents: read # Required to access repository files | ||
packages: read # Grant explicit read access to packages | ||
id-token: write # Needed if using OIDC authentication | ||
jobs: | ||
integration-tests-fabric-dw: | ||
name: Regular | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 1 | ||
matrix: | ||
test_file: | ||
- tests/functional/adapter/basic/test_base.py | ||
- tests/functional/adapter/basic/test_empty.py | ||
steps: | ||
- name: Azure login with OIDC | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ secrets.DBT_AZURE_SP_NAME }} | ||
tenant-id: ${{ secrets.DBT_AZURE_TENANT }} | ||
allow-no-subscriptions: true | ||
federated-token: true | ||
- name: Fetch Access Token | ||
id: fetch_token | ||
run: | | ||
pip install azure-identity pyodbc azure-core | ||
python - <<EOF | ||
from azure.core.credentials import AccessToken | ||
from azure.identity import DefaultAzureCredential | ||
import os | ||
try: | ||
credential = DefaultAzureCredential() | ||
token = credential.get_token("https://analysis.windows.net/powerbi/api/.default") | ||
print(f"::set-output name=access_token::{token.token}") | ||
except Exception as e: | ||
raise RuntimeError(f"Failed to fetch token: {e}") | ||
EOF | ||
- uses: actions/checkout@v4 | ||
- name: Print Token | ||
run: echo "Token from job - ${{ steps.fetch_token.outputs.access_token }}" | ||
- name: Install dependencies | ||
run: pip install -r dev_requirements.txt | ||
- name: Run Functional Test ${{ matrix.test_file }} | ||
env: | ||
WORKSPACE_ID: ${{ secrets.WORKSPACE_ID }} | ||
LAKEHOUSE_ID: ${{ secrets.LAKEHOUSE_ID }} | ||
LAKEHOUSE_NAME: ${{ secrets.LAKEHOUSE_NAME }} | ||
SCHEMA_NAME: ${{ secrets.LAKEHOUSE_NAME }} | ||
CLIENT_ID: ${{ secrets.DBT_AZURE_SP_NAME }} | ||
TENANT_ID: ${{ secrets.DBT_AZURE_TENANT }} | ||
FABRIC_INTEGRATION_TESTS_TOKEN: ${{ steps.fetch_token.outputs.access_token }} | ||
run: pytest -ra -v ${{ matrix.test_file }} --profile "int_tests" |