Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
AP-1039 revamp CI (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samira-El authored Aug 12, 2021
1 parent aa89f2e commit 4b084bd
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 43 deletions.
22 changes: 4 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
version: 2
jobs:
build:
integration_tests:
docker:
- image: circleci/python:3.6.2
steps:
- checkout

- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install .[test]
- run:
name: 'Check code formatting and do pylinting'
command: |
. venv/bin/activate
echo "Checking double quotes..."
find tap_snowflake tests -type f -name '*.py' | xargs unify --check-only
echo "Running pylint..."
pylint tap_snowflake tests
command: make venv

- run:
name: 'Integration Tests'
command: |
. venv/bin/activate
export LOGGING_CONF_FILE=$(pwd)/sample_logging.conf
nosetests --where=tests/integration/
make integration_test
workflows:
version: 2
build:
jobs:
- build
- integration_tests
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
pull_request:
push:
branches:
- master

jobs:
lint_and_test:
name: Linting and Testing
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.6, 3.7, 3.8 ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup virtual environment
run: make venv

- name: Code formatting
run: make format

- name: Pylinting
run: make pylint

# No unit tests :(
# - name: Unit Tests
# run: make unit_test
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
venv:
python3 -m venv venv ;\
. ./venv/bin/activate ;\
pip install --upgrade pip setuptools wheel ;\
pip install -e .[test]

format:
. ./venv/bin/activate ;\
find tap_snowflake tests -type f -name '*.py' | xargs unify --check-only

pylint:
. ./venv/bin/activate ;\
pylint --rcfile pylintrc tap_snowflake/

unit_test:
. ./venv/bin/activate ;\
pytest tests/unit

integration_test:
. ./venv/bin/activate ;\
pytest tests/integration/ -vv --cov tap_snowflake
39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@ installation instructions for [Mac](http://docs.python-guide.org/en/latest/start
It's recommended to use a virtualenv:

```bash
python3 -m venv venv
pip install pipelinewise-tap-snowflake
```

or

```bash
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install .
make venv
```

### Configuration
Expand Down Expand Up @@ -106,18 +96,29 @@ specified in the table's metadata as well.
export TAP_SNOWFLAKE_WAREHOUSE=<snowflake-warehouse>
```

2. Install python dependencies in a virtual env and run nose unit and integration tests
```
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install .
pip install nose
2. Install python dependencies
```bash
make venv
```

3. To run unit tests:

**PS**: There are no unit tests at the time of writing this document

```bash
make unit_test
```

4. To run Integration tests
```bash
make integration_test
```
nosetests


### To run formatting and linting:

```bash
make venv format pylint
```

## License
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup

with open('README.md') as f:
long_description = f.read()
long_description = f.read()

setup(name='pipelinewise-tap-snowflake',
version='2.0.3',
Expand All @@ -19,14 +19,14 @@
py_modules=['tap_snowflake'],
install_requires=[
'pipelinewise-singer-python==1.*',
'snowflake-connector-python[pandas]==2.3.7',
'pendulum==1.2.0',
'python-dateutil>=2.1,<2.8.2'
'snowflake-connector-python[pandas]==2.4.*',
'pendulum==1.2.0'
],
extras_require={
'test': [
'nose==1.3.7',
'pylint==2.6.0',
'pylint==2.8.*',
'pytest==6.2.*',
'pytest-cov==2.12.*',
'unify==0.5'
]
},
Expand Down

0 comments on commit 4b084bd

Please sign in to comment.