Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up tox ini #105

Merged
merged 73 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
7c29fbf
Remove skipdist
JCZuurmond Feb 11, 2021
90d0eaa
Remove editable flag
JCZuurmond Feb 11, 2021
a0f6098
Add space after -r
JCZuurmond Feb 11, 2021
089a303
Remove redundancy of command
JCZuurmond Feb 11, 2021
95ef130
Remove basepython
JCZuurmond Feb 11, 2021
128b36b
Update dependencies
JCZuurmond Feb 11, 2021
769948a
Remove duplicate requirements
JCZuurmond Feb 11, 2021
f272aac
Install requirements.txt in deps
JCZuurmond Feb 11, 2021
b24d54e
Have test env only
JCZuurmond Feb 11, 2021
e78bd18
Use posargs in circleci
JCZuurmond Feb 11, 2021
17f7bda
Add pytest to requirements.txt
JCZuurmond Feb 11, 2021
a4f740a
Install minimally needed packages in tox
JCZuurmond Feb 11, 2021
8b73ad0
Rename requirements to dev_requirements
JCZuurmond Feb 11, 2021
0118899
Change order of deps
JCZuurmond Feb 11, 2021
0ee10f3
Remove pip install from circle ci
JCZuurmond Feb 11, 2021
f0cbaa0
Make deps multiline
JCZuurmond Feb 11, 2021
7dec753
Add python images to be sure multiple versions are available
JCZuurmond Feb 11, 2021
b6c8317
Move images down
JCZuurmond Feb 11, 2021
ce4cd67
Run only for python 37
JCZuurmond Feb 11, 2021
85f33c4
Fix versions in dev_requirements
JCZuurmond Feb 13, 2021
0b02e09
Let version in setup.py be lower bounded
JCZuurmond Feb 13, 2021
a727d7e
Change dbt version to allow for patches only
JCZuurmond Feb 14, 2021
b83ede5
Remove certifi
JCZuurmond Feb 14, 2021
bceaaaa
Remove dbt debug
JCZuurmond Feb 14, 2021
4bf9a26
Fix indentation
JCZuurmond Feb 14, 2021
e64f5d0
Set back dbt debug
JCZuurmond Feb 14, 2021
f3ca75a
Add dbt env to tox
JCZuurmond Feb 14, 2021
6036a7d
Add dbt environment
JCZuurmond Feb 14, 2021
1cac631
Try dbt env in circleci
JCZuurmond Feb 14, 2021
72b86ab
Merge branch 'master' of github.com:dbt-msft/dbt-sqlserver into clean…
JCZuurmond Feb 14, 2021
bf656fa
Update unit test
JCZuurmond Feb 14, 2021
b586e56
Use dbt env
JCZuurmond Feb 14, 2021
a17bb8f
Add change log entry
JCZuurmond Feb 14, 2021
6e12def
Use tox dbt environment
JCZuurmond Feb 14, 2021
cf2f40c
Add environment to tox tests
JCZuurmond Feb 14, 2021
e3c21c1
Make single line commands compose one line
JCZuurmond Feb 14, 2021
9b5f93f
Rename py37 to testenv
JCZuurmond Feb 14, 2021
932fb43
Remove tox dbt env
JCZuurmond Feb 14, 2021
9aac92d
Add install dbt-sqlserver
JCZuurmond Feb 14, 2021
4d24878
Move install dbt-sqlserver down
JCZuurmond Feb 14, 2021
e90a6eb
Add passenv
JCZuurmond Feb 14, 2021
794a6c9
Print dbt version
JCZuurmond Feb 14, 2021
e652ba0
Fix circleci
JCZuurmond Feb 14, 2021
26f2780
Print dbt version sooner
JCZuurmond Feb 14, 2021
88f6b7d
Run uninstall dbt
JCZuurmond Feb 14, 2021
6495a25
Add which dbt
JCZuurmond Feb 14, 2021
1cc601f
Add DBT_AZURESQL_SERVER env
JCZuurmond Feb 14, 2021
6f55f8b
Add PWD and UID envs
JCZuurmond Feb 14, 2021
29316ea
correct category
dataders Feb 14, 2021
226f35c
deprecated
dataders Feb 14, 2021
6bf6542
extraneous check
dataders Feb 15, 2021
4bf8887
Change base image to debian latetst
JCZuurmond Feb 15, 2021
2745bd8
Remove requirements
JCZuurmond Feb 15, 2021
1fb8353
Merge branch 'clean-up-tox-ini' of github.com:JCZuurmond/dbt-sqlserve…
JCZuurmond Feb 15, 2021
c72119c
Revert changes to docker file
JCZuurmond Feb 15, 2021
cb25c02
Add upgrade dbt step
JCZuurmond Feb 15, 2021
d9d1717
Remove pyodbc image
JCZuurmond Feb 15, 2021
adf4e45
Remove upgrade dbt
JCZuurmond Feb 15, 2021
80c4dd2
Remove pyodbc from unit job
JCZuurmond Feb 15, 2021
d12a1e2
Add python image
JCZuurmond Feb 15, 2021
de0a9e8
Add pip install tox to unit test
JCZuurmond Feb 15, 2021
04681ba
Add sql server to unit job
JCZuurmond Feb 15, 2021
8127bb2
Install odbc
JCZuurmond Feb 15, 2021
6699419
Add sudo
JCZuurmond Feb 15, 2021
870b283
Reuse parts of other jobs
JCZuurmond Feb 15, 2021
1ded9d7
Add sudo to python install
JCZuurmond Feb 15, 2021
50c41fa
Reset circleci
JCZuurmond Feb 15, 2021
41f3919
Upgrade dbt in other jobs
JCZuurmond Feb 15, 2021
aa9f4ac
Remove wrongly pasted step
JCZuurmond Feb 15, 2021
5cab4d4
Rename step
JCZuurmond Feb 15, 2021
fc8e233
Fix dbt compile
JCZuurmond Feb 15, 2021
aa8771a
Set back cd
JCZuurmond Feb 15, 2021
5f0bfd2
Remove executors
JCZuurmond Feb 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
JCZuurmond marked this conversation as resolved.
Show resolved Hide resolved
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
dataders marked this conversation as resolved.
Show resolved Hide resolved
connection-sqlserver:
<<: *sqlserver
steps:
- run: *install-git
- run: *upgrade-dbt
- checkout
- python/install-packages:
JCZuurmond marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -12,6 +12,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