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

chore: Add pytest CI #6840

Merged
merged 6 commits into from Feb 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
81 changes: 69 additions & 12 deletions .circleci/config.yml
@@ -1,18 +1,8 @@
version: 2
jobs:
build:
dependencies:
docker:
- image: circleci/python:3.7.4-node
environment:
APP_CONFIG: config.TestingConfig
DATABASE_URL: postgresql://postgres@localhost/test
TEST_DATABASE_URL: postgresql://postgres@localhost/test
# Services
- image: circleci/postgres:11.5-alpine-ram
environment:
POSTGRES_USER: postgres
POSTGRES_DB: test
- image: circleci/redis:5.0.6-alpine

working_directory: ~/code

Expand All @@ -32,7 +22,7 @@ jobs:
python3 -m venv venv
. venv/bin/activate
pip install --exists-action w -r requirements/tests.txt

- run:
name: Install Node Dependencies
command: yarn
Expand All @@ -45,10 +35,77 @@ jobs:
- ~/.yarn/bin
key: v1.3-dependencies-{{ checksum "requirements/tests.txt" }}-{{ checksum "package.json" }}

dredd:
docker:
- image: circleci/python:3.7.4-node
environment:
APP_CONFIG: config.TestingConfig
DATABASE_URL: postgresql://postgres@localhost/test
TEST_DATABASE_URL: postgresql://postgres@localhost/test
# Services
- image: circleci/postgres:11.5-alpine-ram
environment:
POSTGRES_USER: postgres
POSTGRES_DB: test
- image: circleci/redis:5.0.6-alpine

working_directory: ~/code

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1.3-dependencies-{{ checksum "requirements/tests.txt" }}-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1.3-dependencies-

- run:
name: Create API blueprint
command: npx aglio --input docs/api/api_blueprint_source.apib --compile --output docs/api/api_blueprint.apib

- run:
name: Test API Doc
command: . venv/bin/activate && npx dredd

pytype:
docker:
- image: circleci/python:3.7.4-node

working_directory: ~/code

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1.3-dependencies-{{ checksum "requirements/tests.txt" }}-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1.3-dependencies-

- restore_cache:
keys:
- v1-pytype

- run:
name: Test pytype
command: . venv/bin/activate && pytype

- save_cache:
paths:
- ./.pytype
key: v1-pytype

workflows:
version: 2
build-and-test:
jobs:
- dependencies
- dredd:
requires:
- dependencies
- pytype:
requires:
- dependencies