-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from dbt-msft/cnxn_ci
Add CI tests for different target connection configs
- Loading branch information
Showing
5 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ orbs: | |
python: circleci/[email protected] | ||
|
||
jobs: | ||
integration-sqlserver: | ||
integration-sqlserver: &sqlserver | ||
docker: | ||
- image: dataders/pyodbc:1.4 | ||
- image: mcr.microsoft.com/mssql/server:2019-latest | ||
|
@@ -26,6 +26,46 @@ jobs: | |
- run: | ||
name: Test adapter on SQL Server against dbt-adapter-tests | ||
command: tox -e integration-sqlserver | ||
connection-sqlserver: | ||
<<: *sqlserver | ||
steps: | ||
- checkout | ||
- python/install-packages: | ||
pkg-manager: pip | ||
- run: | ||
name: wait for SQL Server container to set up | ||
command: sleep 30 | ||
- run: | ||
name: prep for connecting | ||
command: | | ||
mkdir -p ~/.dbt | ||
cd test/integration | ||
cp sample.profiles.yml ~/.dbt/profiles.yml | ||
- run: | ||
name: cnxn -- SQL Server - local sql cred | ||
command: | | ||
cd test/integration | ||
dbt compile --target sqlserver_local_userpass | ||
- run: | ||
name: cnxn -- SQL Server - local sql cred encrypt | ||
command: | | ||
cd test/integration | ||
dbt compile --target sqlserver_local_encrypt | ||
- run: | ||
name: cnxn -- Azure SQL - SQL cred | ||
command: | | ||
cd test/integration | ||
dbt compile --target azuresql_sqlcred | ||
# TODO drop support for this method in favor of | ||
# https://github.com/dbt-msft/dbt-sqlserver/pull/71 | ||
# - run: | ||
# name: cnxn -- Azure SQL - AAD Password | ||
# command: | | ||
# cd test/integration | ||
# dbt compile --target azuresql_aad | ||
|
||
integration-azuresql: | ||
docker: | ||
- image: dataders/pyodbc:1.4 | ||
|
@@ -41,6 +81,9 @@ jobs: | |
workflows: | ||
main: | ||
jobs: | ||
- connection-sqlserver: | ||
context: | ||
- DBT_SYNAPSE_PROFILE | ||
- integration-sqlserver | ||
- integration-azuresql: | ||
context: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ black~=20.8b1 | |
pytest-dbt-adapter~=0.3.0 | ||
tox==3.2.0 | ||
flake8>=3.5.0 | ||
certifi==2020.6.20 | ||
certifi==2020.6.20 | ||
. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
name: 'sqlserver_integration_tests' | ||
version: '1.0' | ||
config-version: 2 | ||
|
||
profile: 'integration_tests' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{# inane comment #} | ||
{% set col_name = 'foo' %} | ||
SELECT 1 as {{ col_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# HEY! This file is used in the tsql_utils integrations tests with CircleCI. | ||
# You should __NEVER__ check credentials into version control. Thanks for reading :) | ||
|
||
config: | ||
send_anonymous_usage_stats: False | ||
use_colors: True | ||
|
||
defaults: | ||
sqlserver: &sqlserver | ||
type: sqlserver | ||
driver: "ODBC Driver 17 for SQL Server" | ||
schema: "dbt_cnxn_test" | ||
port: 1433 | ||
threads: 8 | ||
|
||
integration_tests: | ||
target: sqlserver_local_userpass | ||
outputs: | ||
sqlserver_local_userpass: &sqlserver-local | ||
<<: *sqlserver | ||
host: localhost | ||
database: msdb | ||
username: SA | ||
password: 5atyaNadella | ||
sqlserver_local_encrypt: | ||
<<: *sqlserver-local | ||
encrypt: yes | ||
trust_cert: yes | ||
azuresql_sqlcred: &azuresql | ||
<<: *sqlserver | ||
host: "{{ env_var('DBT_AZURESQL_SERVER') }}" | ||
database: "{{ env_var('DBT_AZURESQL_DB') }}" | ||
username: "{{ env_var('DBT_AZURESQL_UID') }}" | ||
password: "{{ env_var('DBT_AZURESQL_PWD') }}" | ||
encrypt: yes | ||
trust_cert: yes | ||
azuresql_aad: | ||
<<: *azuresql | ||
authentication: ActiveDirectoryPassword | ||
username: "{{ env_var('DBT_AZURESQL_AAD_USER') }}" | ||
password: "{{ env_var('DBT_AZURESQL_AAD_PASS') }}" | ||
|