forked from transferwise/pipelinewise-target-postgres
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
153 additions
and
146 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
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: Start PG test container | ||
run: docker-compose up -d --build db | ||
|
||
- 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: Pylinting | ||
run: make pylint | ||
|
||
- name: Unit Tests | ||
run: make unit_test | ||
|
||
- name: Integration Tests | ||
env: | ||
LOGGING_CONF_FILE: ./sample_logging.conf | ||
run: make integration_test | ||
|
||
- name: Shutdown PG test container | ||
run: docker-compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
venv: | ||
python3 -m venv venv ;\ | ||
. ./venv/bin/activate ;\ | ||
pip install --upgrade pip setuptools wheel ;\ | ||
pip install -e .[test] | ||
|
||
pylint: | ||
. ./venv/bin/activate ;\ | ||
pylint --rcfile .pylintrc target_postgres/ | ||
|
||
unit_test: | ||
. ./venv/bin/activate ;\ | ||
pytest --cov=target_postgres --cov-fail-under=44 tests/unit -v | ||
|
||
env: | ||
export TARGET_POSTGRES_PORT=5432 | ||
export TARGET_POSTGRES_DBNAME=target_db | ||
export TARGET_POSTGRES_USER=my_user | ||
export TARGET_POSTGRES_PASSWORD=secret | ||
export TARGET_POSTGRES_HOST=localhost | ||
export TARGET_POSTGRES_SCHEMA=public | ||
|
||
integration_test: env | ||
. ./venv/bin/activate ;\ | ||
pytest tests/integration --cov=target_postgres --cov-fail-under=87 -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3" | ||
|
||
services: | ||
db: | ||
image: postgres:12-alpine | ||
environment: | ||
POSTGRES_DB: "target_db" | ||
POSTGRES_USER: "my_user" | ||
POSTGRES_PASSWORD: "secret" | ||
ports: | ||
- 5432:5432 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.