Skip to content

Commit 495a284

Browse files
authored
Merge pull request #388 from dbt-msft/add-option-run-manually
Add option to trigger CI manually
2 parents 30910b4 + 98c014b commit 495a284

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

.github/workflows/integration-tests-azure.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: Integration tests on Azure
33
on: # yamllint disable-line rule:truthy
4+
workflow_dispatch:
45
push:
56
branches:
67
- master
@@ -12,7 +13,7 @@ on: # yamllint disable-line rule:truthy
1213

1314
jobs:
1415
integration-tests-azure:
15-
name: Integration tests on Azure
16+
name: Regular
1617
strategy:
1718
matrix:
1819
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
@@ -69,4 +70,36 @@ jobs:
6970
DBT_TEST_AAD_PRINCIPAL_1: ${{ secrets.DBT_TEST_AAD_PRINCIPAL_1 }}
7071
DBT_TEST_AAD_PRINCIPAL_2: ${{ secrets.DBT_TEST_AAD_PRINCIPAL_2 }}
7172
SQLSERVER_TEST_DRIVER: 'ODBC Driver ${{ matrix.msodbc_version }} for SQL Server'
72-
run: pytest -n auto -ra -v tests/functional --profile "${{ matrix.profile }}"
73+
run: pytest --ignore=tests/functional/adapter/test_provision_users.py -ra -v tests/functional --profile "${{ matrix.profile }}"
74+
75+
flaky-tests-azure:
76+
name: Flaky tests on Azure
77+
runs-on: ubuntu-latest
78+
container:
79+
image: ghcr.io/${{ github.repository }}:CI-3.11-msodbc18
80+
steps:
81+
- uses: actions/checkout@v3
82+
83+
- name: Install dependencies
84+
run: pip install -r dev_requirements.txt
85+
86+
- name: Wake up server
87+
env:
88+
DBT_AZURESQL_SERVER: ${{ secrets.DBT_AZURESQL_SERVER }}
89+
DBT_AZURESQL_DB: ${{ secrets.DBT_AZURESQL_DB }}
90+
DBT_AZURESQL_UID: ${{ secrets.DBT_AZURESQL_UID }}
91+
DBT_AZURESQL_PWD: ${{ secrets.DBT_AZURESQL_PWD }}
92+
MSODBC_VERSION: ${{ matrix.msodbc_version }}
93+
run: python devops/scripts/wakeup_azure.py
94+
95+
- name: Run auto provisioning tests
96+
env:
97+
DBT_AZURESQL_SERVER: ${{ secrets.DBT_AZURESQL_SERVER }}
98+
DBT_AZURESQL_DB: ${{ secrets.DBT_AZURESQL_DB }}
99+
AZURE_CLIENT_ID: ${{ secrets.DBT_AZURE_SP_NAME }}
100+
AZURE_CLIENT_SECRET: ${{ secrets.DBT_AZURE_SP_SECRET }}
101+
AZURE_TENANT_ID: ${{ secrets.DBT_AZURE_TENANT }}
102+
DBT_TEST_AAD_PRINCIPAL_1: ${{ secrets.DBT_TEST_AAD_PRINCIPAL_1 }}
103+
DBT_TEST_AAD_PRINCIPAL_2: ${{ secrets.DBT_TEST_AAD_PRINCIPAL_2 }}
104+
SQLSERVER_TEST_DRIVER: 'ODBC Driver 18 for SQL Server'
105+
run: pytest -ra -v tests/functional/adapter/test_provision_users.py --profile "ci_azure_environment"

.github/workflows/integration-tests-sqlserver.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: Integration tests on SQL Server
33
on: # yamllint disable-line rule:truthy
4+
workflow_dispatch:
45
push:
56
branches:
67
- master
@@ -12,7 +13,7 @@ on: # yamllint disable-line rule:truthy
1213

1314
jobs:
1415
integration-tests-sql-server:
15-
name: Integration tests on SQL Server
16+
name: Regular
1617
strategy:
1718
matrix:
1819
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
@@ -37,7 +38,7 @@ jobs:
3738
run: pip install -r dev_requirements.txt
3839

3940
- name: Run functional tests
40-
run: pytest -n auto -ra -v tests/functional --profile "ci_sql_server"
41+
run: pytest -ra -v tests/functional --profile "ci_sql_server"
4142
env:
4243
DBT_TEST_USER_1: DBT_TEST_USER_1
4344
DBT_TEST_USER_2: DBT_TEST_USER_2

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: Unit tests
33
on: # yamllint disable-line rule:truthy
4+
workflow_dispatch:
45
push:
56
branches:
67
- master

tests/functional/adapter/test_provision_users.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_auto_provision(self, project):
6060
run_dbt(["run"])
6161

6262

63-
@pytest.mark.only_with_profile("ci_azure_cli", "ci_azure_auto", "ci_azure_environment")
63+
@pytest.mark.only_with_profile("ci_azure_environment", "user_azure")
6464
@pytest.mark.flaky(max_runs=5, min_passes=1)
6565
class TestProvisionSingleUserAzureSQL(BaseTestProvisionAzureSQL):
6666
@pytest.fixture(scope="class")
@@ -71,7 +71,7 @@ def models(self):
7171
}
7272

7373

74-
@pytest.mark.only_with_profile("ci_azure_cli", "ci_azure_auto", "ci_azure_environment")
74+
@pytest.mark.only_with_profile("ci_azure_environment", "user_azure")
7575
@pytest.mark.flaky(max_runs=5, min_passes=1)
7676
class TestProvisionMultipleUsersAzureSQL(BaseTestProvisionAzureSQL):
7777
@pytest.fixture(scope="class")

0 commit comments

Comments
 (0)