Skip to content

Commit

Permalink
Merge pull request #105 from JCZuurmond/clean-up-tox-ini
Browse files Browse the repository at this point in the history
Clean up tox ini
  • Loading branch information
dataders authored Feb 24, 2021
2 parents f821cc7 + 5f0bfd2 commit a298e8b
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 59 deletions.
44 changes: 16 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- image: dataders/pyodbc:1.4
steps:
- checkout
- run: tox -e unit
- run: tox -- -v test/unit
integration-sqlserver: &sqlserver
docker:
- image: dataders/pyodbc:1.4
Expand All @@ -19,40 +19,42 @@ jobs:
ACCEPT_EULA: 'yes'
MSSQL_SA_PASSWORD: 5atyaNadella
MSSQL_IP_ADDRESS: 0.0.0.0
executor: python/default
steps:
- run: &install-git
name: "TEMP: install Git"
command: |
apt-get install -y git
- run: &upgrade-dbt
name: "TEMP: upgrade dbt" # hot fix: dbt is installed in the pyodbc docker image, it should be removed there
command: |
pip install --upgrade dbt
- checkout
- run:
name: wait for SQL Server container to set up
command: sleep 30
- run:
name: test connection via SQL CMD
command: sqlcmd -S 'localhost,1433' -U sa -P 5atyaNadella -Q 'create database blog'
- python/install-packages:
pkg-manager: pip
- run:
name: Test adapter on SQL Server against dbt-adapter-tests
command: tox -e integration-sqlserver
command: tox -- -v test/integration/sqlserver.dbtspec
connection-sqlserver:
<<: *sqlserver
steps:
- run: *install-git
- run: *upgrade-dbt
- checkout
- python/install-packages:
pkg-manager: pip
- run: &install-dbt-sqlserver
name: "install dbt-sqlserver"
command: python setup.py install
- run:
name: wait for SQL Server container to set up
command: sleep 30
- run: &prep=connect
name: prep for connecting
command: |
mkdir -p ~/.dbt
cd test/integration
cp sample.profiles.yml ~/.dbt/profiles.yml
cp test/integration/sample.profiles.yml ~/.dbt/profiles.yml
- run:
name: cnxn -- SQL Server - local sql cred
command: |
Expand All @@ -63,45 +65,31 @@ jobs:
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
executor: python/default
steps:
- run: *install-git
- run: *upgrade-dbt
- checkout
- python/install-packages:
pkg-manager: pip
- run: *install-dbt-sqlserver
- run:
name: wake up serverless db
command: |
cd test/integration
dbt debug --target azuresql_sqlcred
- run:
name: Test adapter on Azure SQL against dbt-adapter-tests
command: tox -e integration-azuresql
command: tox -- -v test/integration/azuresql.dbtspec
connection-azuresql:
docker:
- image: dataders/pyodbc:1.4
executor: python/default
steps:
- run: *install-git
- run: *upgrade-dbt
- checkout
- python/install-packages:
pkg-manager: pip
- run: *install-dbt-sqlserver
- run:
name: install gnupg
command: apt-get install gnupg -y
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#### Under the hood:
- This adapter has separate CI tests to ensure all the connection methods are working as they should [#75](https://github.com/dbt-msft/dbt-sqlserver/pull/75)
- This adapter has a CI job for running unit tests [#103](https://github.com/dbt-msft/dbt-sqlserver/pull/103)
- Update the tox setup [#105](https://github.com/dbt-msft/dbt-sqlserver/pull/105)

### v0.18.1
#### New Features:
Expand Down
5 changes: 5 additions & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
black==20.8b1
pytest-dbt-adapter==0.4.0
pytest==6.2.2
tox==3.2.0
flake8==3.5.0
10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def _dbt_sqlserver_version():
]
},
install_requires=[
'dbt-core~=0.19.0',
"dbt-core~=0.19.0",
"pyodbc>=4.0.27",
"azure-identity>=1.4.0",
]
)
)
29 changes: 10 additions & 19 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
[tox]
skipsdist = True
envlist = unit, flake8, integration-sqlserver, integration-synapse
envlist = py37

[testenv:integration-sqlserver]
basepython = python3
commands = /bin/bash -c '{envpython} -m pytest -v test/integration/sqlserver.dbtspec'
[testenv]
commands = pytest {posargs}
passenv =
DBT_AZURESQL_DB
DBT_AZURESQL_SERVER
DBT_AZURESQL_PWD
DBT_AZURESQL_UID
deps =
-r {toxinidir}/requirements.txt

[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

[testenv:unit]
basepython = python3
commands = /bin/bash -c '{envpython} -m pytest test/unit'
deps =
-r {toxinidir}/requirements.txt
pytest~=6.2.2
pytest-dbt-adapter~=0.4.0

0 comments on commit a298e8b

Please sign in to comment.