From bad052df62b212ca2399b58ee69ec1212bc4b3cc Mon Sep 17 00:00:00 2001 From: Anders Swanson Date: Thu, 17 Dec 2020 01:10:10 -0800 Subject: [PATCH 1/2] also test azure sql --- .circleci/config.yml | 7 +++++-- test/integration/azuresql.dbtspec | 23 +++++++++++++++++++++++ tox.ini | 13 ++++++++++--- 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 test/integration/azuresql.dbtspec diff --git a/.circleci/config.yml b/.circleci/config.yml index 32b2b41e..9547549c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,8 +24,11 @@ jobs: - python/install-packages: pkg-manager: pip - run: - name: Test adapter against dbt-adapter-tests - command: tox -e integration-synapse + name: Test adapter on SQL Server against dbt-adapter-tests + command: tox -e integration-sqlserver + - run: + name: Test adapter on Azure SQL against dbt-adapter-tests + command: tox -e integration-azuresql workflows: main: diff --git a/test/integration/azuresql.dbtspec b/test/integration/azuresql.dbtspec new file mode 100644 index 00000000..84bd6582 --- /dev/null +++ b/test/integration/azuresql.dbtspec @@ -0,0 +1,23 @@ + +target: + type: sqlserver + driver: "ODBC Driver 17 for SQL Server" + port: 1433 + host: "{{ env_var('DBT_AZURESQL_SERVER') }}" + database: "{{ env_var('DBT_AZURESQL_DB') }}" + username: "{{ env_var('DBT_AZURESQL_UID') }}" + password: "{{ env_var('DBT_AZURESQL_PWD') }}" + schema: dbt_external_tables_integration_tests_azuresql + encrypt: yes + trust_cert: yes + threads: 1 +sequences: + test_dbt_empty: empty + test_dbt_base: base + test_dbt_ephemeral: ephemeral + test_dbt_incremental: incremental + test_dbt_snapshot_strategy_timestamp: snapshot_strategy_timestamp + # test_dbt_snapshot_strategy_check_cols: snapshot_strategy_check_cols + test_dbt_data_test: data_test + test_dbt_schema_test: schema_test + # test_dbt_ephemeral_data_tests: data_test_ephemeral_models diff --git a/tox.ini b/tox.ini index 3cd05a59..e69afdeb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,18 @@ [tox] skipsdist = True -envlist = unit, flake8, integration-synapse +envlist = unit, flake8, integration-sqlserver, integration-synapse -[testenv:integration-synapse] +[testenv:integration-sqlserver] basepython = python3 commands = /bin/bash -c '{envpython} -m pytest -v test/integration/sqlserver.dbtspec' -passenv = DBT_SYNAPSE_DB DBT_SYNAPSE_PORT DBT_SYNAPSE_PWD DBT_SYNAPSE_SERVER DBT_SYNAPSE_UID +deps = + -r{toxinidir}/requirements.txt + -e. + +[testenv:integration-azuresql] +basepython = python3 +commands = /bin/bash -c '{envpython} -m pytest -v test/integration/azuresql.dbtspec' +passenv = DBT_AZURESQL_DB DBT_AZURESQL_PWD DBT_AZURESQL_SERVER DBT_AZURESQL_UID deps = -r{toxinidir}/requirements.txt -e. \ No newline at end of file From 7f680e44ea6b8cf63f70823185dba9dad577a2ba Mon Sep 17 00:00:00 2001 From: Anders Swanson Date: Thu, 17 Dec 2020 01:16:43 -0800 Subject: [PATCH 2/2] break into two jobs --- .circleci/config.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9547549c..672f16d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ orbs: python: circleci/python@1.1.0 jobs: - build-and-test: + integration-sqlserver: docker: - image: dataders/pyodbc:1.4 - image: mcr.microsoft.com/mssql/server:2019-latest @@ -26,6 +26,14 @@ jobs: - run: name: Test adapter on SQL Server against dbt-adapter-tests command: tox -e integration-sqlserver + integration-azuresql: + docker: + - image: dataders/pyodbc:1.4 + executor: python/default + steps: + - checkout + - python/install-packages: + pkg-manager: pip - run: name: Test adapter on Azure SQL against dbt-adapter-tests command: tox -e integration-azuresql @@ -33,6 +41,7 @@ jobs: workflows: main: jobs: - - build-and-test: + - integration-sqlserver + - integration-azuresql: context: - DBT_SYNAPSE_PROFILE