This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from transferwise/circleci-update
update circle ci config
- Loading branch information
Showing
1 changed file
with
41 additions
and
28 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,39 +1,52 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
|
||
references: | ||
container_config: &container_config | ||
docker: | ||
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:tap-tester | ||
# Main Python container | ||
- image: circleci/python:3.6.2 | ||
environment: | ||
TAP_MYSQL_PORT: 3306 | ||
TAP_MYSQL_USER: root | ||
TAP_MYSQL_PASSWORD: my-secret-passwd | ||
TAP_MYSQL_HOST: test_mysql | ||
|
||
# MariaDB service container image used as test source database | ||
- image: mariadb:10.2.26 | ||
name: test_mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: my-secret-passwd | ||
MYSQL_DATABASE: tap_mysql_test | ||
ports: | ||
- 3306:3306 | ||
command: --default-authentication-plugin=mysql_native_password --log-bin=mysql-bin --binlog-format=ROW | ||
|
||
jobs: | ||
test: | ||
<<: *container_config | ||
|
||
steps: | ||
- checkout | ||
- run: | ||
name: 'Get environment variables' | ||
command: | | ||
aws s3 cp s3://com-stitchdata-dev-deployment-assets/environments/tap-tester/sandbox dev_env.sh | ||
- run: | ||
name: 'Setup virtual env' | ||
command: | | ||
virtualenv -p python3 ~/.virtualenvs/tap-mysql | ||
source ~/.virtualenvs/tap-mysql/bin/activate | ||
pip install . | ||
pip install pylint | ||
pylint tap_mysql -d C,W,unexpected-keyword-arg,duplicate-code | ||
python3 -m venv ./virtualenvs/tap-mysql | ||
. ./virtualenvs/tap-mysql/bin/activate | ||
pip3 install --upgrade pip | ||
pip3 install .[test] | ||
- run: | ||
name: 'Unit Tests' | ||
name: 'Pylinting' | ||
command: | | ||
source ~/.virtualenvs/tap-mysql/bin/activate | ||
pip install nose | ||
source dev_env.sh | ||
nosetests | ||
- add_ssh_keys | ||
. ./virtualenvs/tap-mysql/bin/activate | ||
pylint --rcfile .pylintrc tap_mysql/ | ||
- run: | ||
name: 'Integration Tests' | ||
name: 'Tests' | ||
command: | | ||
source ~/.virtualenvs/tap-tester/bin/activate | ||
source dev_env.sh | ||
run-a-test --tap=tap-mysql \ | ||
--target=target-stitch \ | ||
--orchestrator=stitch-orchestrator \ | ||
[email protected] \ | ||
--password=$SANDBOX_PASSWORD \ | ||
--client-id=50 \ | ||
tap_tester.suites.mysql | ||
. ./virtualenvs/tap-mysql/bin/activate | ||
nosetests -c .noserc tests | ||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
- build |