Skip to content

Commit

Permalink
chore: Add pytest CI (#6840)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Feb 14, 2020
1 parent 5c069b2 commit c61797b
Showing 1 changed file with 69 additions and 12 deletions.
81 changes: 69 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c61797b

Please sign in to comment.