diff --git a/.circleci/config.yml b/.circleci/config.yml index 32b2b41e..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 @@ -24,12 +24,24 @@ 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 + 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 workflows: main: jobs: - - build-and-test: + - integration-sqlserver + - integration-azuresql: context: - DBT_SYNAPSE_PROFILE 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