diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..2d8b89c1af --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,47 @@ +version: 2 +jobs: + build: + docker: + - image: bcgovimages/von-image:py36-1.8-0 + steps: + - checkout + - restore_cache: + keys: + - v2-pip-dependencies-{{ .Branch }}-{{ checksum "agent/requirements.txt" }}-{{ checksum "agent/requirements.dev.txt" }} + - v2-pip-dependencies-{{ .Branch }}- + - run: + name: Install Python Dependencies + command: | + cd agent + python3 -m venv venv + . venv/bin/activate + pip install \ + -r requirements.txt \ + -r requirements.dev.txt \ + pytest + + - save_cache: + paths: + - agent/venv + key: v2-pip-dependencies-{{ .Branch }}-{{ checksum "agent/requirements.txt" }}-{{ checksum "agent/requirements.dev.txt" }} + + - run: + name: Run Agent Tests + command: | + mkdir test-reports + mkdir test-reports/pytest + cd agent + . venv/bin/activate + pytest + + - run: + name: Push to Codecov.io + command: | + bash <(curl -s https://codecov.io/bash) + + - store_test_results: + path: test-reports + + - store_artifacts: + path: test-reports + diff --git a/agent/setup.cfg b/agent/setup.cfg index f1dd6ac854..e1c8a5fb7d 100644 --- a/agent/setup.cfg +++ b/agent/setup.cfg @@ -1,6 +1,6 @@ [tool:pytest] testpaths = indy_catalyst_agent -addopts = --cov-config .coveragerc --cov=indy_catalyst_agent --cov-report term --flake8 +addopts = --quiet --junitxml=../test-reports/pytest/junit.xml --cov-config .coveragerc --cov=indy_catalyst_agent --cov-report term --cov-report xml --flake8 [flake8] # https://github.com/ambv/black#line-length