Skip to content

Commit a298e8b

Browse files
authored
Merge pull request #105 from JCZuurmond/clean-up-tox-ini
Clean up tox ini
2 parents f821cc7 + 5f0bfd2 commit a298e8b

6 files changed

Lines changed: 34 additions & 59 deletions

File tree

.circleci/config.yml

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- image: dataders/pyodbc:1.4
1111
steps:
1212
- checkout
13-
- run: tox -e unit
13+
- run: tox -- -v test/unit
1414
integration-sqlserver: &sqlserver
1515
docker:
1616
- image: dataders/pyodbc:1.4
@@ -19,40 +19,42 @@ jobs:
1919
ACCEPT_EULA: 'yes'
2020
MSSQL_SA_PASSWORD: 5atyaNadella
2121
MSSQL_IP_ADDRESS: 0.0.0.0
22-
executor: python/default
2322
steps:
2423
- run: &install-git
2524
name: "TEMP: install Git"
2625
command: |
2726
apt-get install -y git
27+
- run: &upgrade-dbt
28+
name: "TEMP: upgrade dbt" # hot fix: dbt is installed in the pyodbc docker image, it should be removed there
29+
command: |
30+
pip install --upgrade dbt
2831
- checkout
2932
- run:
3033
name: wait for SQL Server container to set up
3134
command: sleep 30
3235
- run:
3336
name: test connection via SQL CMD
3437
command: sqlcmd -S 'localhost,1433' -U sa -P 5atyaNadella -Q 'create database blog'
35-
- python/install-packages:
36-
pkg-manager: pip
3738
- run:
3839
name: Test adapter on SQL Server against dbt-adapter-tests
39-
command: tox -e integration-sqlserver
40+
command: tox -- -v test/integration/sqlserver.dbtspec
4041
connection-sqlserver:
4142
<<: *sqlserver
4243
steps:
4344
- run: *install-git
45+
- run: *upgrade-dbt
4446
- checkout
45-
- python/install-packages:
46-
pkg-manager: pip
47+
- run: &install-dbt-sqlserver
48+
name: "install dbt-sqlserver"
49+
command: python setup.py install
4750
- run:
4851
name: wait for SQL Server container to set up
4952
command: sleep 30
5053
- run: &prep=connect
5154
name: prep for connecting
5255
command: |
5356
mkdir -p ~/.dbt
54-
cd test/integration
55-
cp sample.profiles.yml ~/.dbt/profiles.yml
57+
cp test/integration/sample.profiles.yml ~/.dbt/profiles.yml
5658
- run:
5759
name: cnxn -- SQL Server - local sql cred
5860
command: |
@@ -63,45 +65,31 @@ jobs:
6365
command: |
6466
cd test/integration
6567
dbt compile --target sqlserver_local_encrypt
66-
- run:
67-
name: cnxn -- Azure SQL - SQL cred
68-
command: |
69-
cd test/integration
70-
dbt compile --target azuresql_sqlcred
7168
72-
# TODO drop support for this method in favor of
73-
# https://github.com/dbt-msft/dbt-sqlserver/pull/71
74-
# - run:
75-
# name: cnxn -- Azure SQL - AAD Password
76-
# command: |
77-
# cd test/integration
78-
# dbt compile --target azuresql_aad
7969
integration-azuresql:
8070
docker:
8171
- image: dataders/pyodbc:1.4
82-
executor: python/default
8372
steps:
8473
- run: *install-git
74+
- run: *upgrade-dbt
8575
- checkout
86-
- python/install-packages:
87-
pkg-manager: pip
76+
- run: *install-dbt-sqlserver
8877
- run:
8978
name: wake up serverless db
9079
command: |
9180
cd test/integration
9281
dbt debug --target azuresql_sqlcred
9382
- run:
9483
name: Test adapter on Azure SQL against dbt-adapter-tests
95-
command: tox -e integration-azuresql
84+
command: tox -- -v test/integration/azuresql.dbtspec
9685
connection-azuresql:
9786
docker:
9887
- image: dataders/pyodbc:1.4
99-
executor: python/default
10088
steps:
10189
- run: *install-git
90+
- run: *upgrade-dbt
10291
- checkout
103-
- python/install-packages:
104-
pkg-manager: pip
92+
- run: *install-dbt-sqlserver
10593
- run:
10694
name: install gnupg
10795
command: apt-get install gnupg -y

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#### Under the hood:
2121
- 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)
2222
- This adapter has a CI job for running unit tests [#103](https://github.com/dbt-msft/dbt-sqlserver/pull/103)
23+
- Update the tox setup [#105](https://github.com/dbt-msft/dbt-sqlserver/pull/105)
2324

2425
### v0.18.1
2526
#### New Features:

dev_requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
black==20.8b1
2+
pytest-dbt-adapter==0.4.0
3+
pytest==6.2.2
4+
tox==3.2.0
5+
flake8==3.5.0

requirements.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def _dbt_sqlserver_version():
5757
]
5858
},
5959
install_requires=[
60-
'dbt-core~=0.19.0',
60+
"dbt-core~=0.19.0",
6161
"pyodbc>=4.0.27",
6262
"azure-identity>=1.4.0",
6363
]
64-
)
64+
)

tox.ini

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
[tox]
2-
skipsdist = True
3-
envlist = unit, flake8, integration-sqlserver, integration-synapse
2+
envlist = py37
43

5-
[testenv:integration-sqlserver]
6-
basepython = python3
7-
commands = /bin/bash -c '{envpython} -m pytest -v test/integration/sqlserver.dbtspec'
4+
[testenv]
5+
commands = pytest {posargs}
6+
passenv =
7+
DBT_AZURESQL_DB
8+
DBT_AZURESQL_SERVER
9+
DBT_AZURESQL_PWD
10+
DBT_AZURESQL_UID
811
deps =
9-
-r {toxinidir}/requirements.txt
10-
11-
[testenv:integration-azuresql]
12-
basepython = python3
13-
commands = /bin/bash -c '{envpython} -m pytest -v test/integration/azuresql.dbtspec'
14-
passenv = DBT_AZURESQL_DB DBT_AZURESQL_PWD DBT_AZURESQL_SERVER DBT_AZURESQL_UID
15-
deps =
16-
-r {toxinidir}/requirements.txt
17-
18-
[testenv:unit]
19-
basepython = python3
20-
commands = /bin/bash -c '{envpython} -m pytest test/unit'
21-
deps =
22-
-r {toxinidir}/requirements.txt
12+
pytest~=6.2.2
13+
pytest-dbt-adapter~=0.4.0

0 commit comments

Comments
 (0)