diff --git a/.circleci/config.yml b/.circleci/config.yml index 32f553643..4b212f821 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,22 @@ -version: 2 +version: 2.1 + +general: + branches: + ignore: + - gh-pages + jobs: build: - branches: - ignore: - - gh-pages docker: - image: circleci/python:3.6.4 environment: SECRET_KEY: abcd + DATABASE_URL: mysql://root:password@127.0.0.1/promgen?charset=utf8mb4 + - image: mysql:5.7 + command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + environment: + MYSQL_ROOT_PASSWORD: password + MYSQL_DATABASE: test_promgen steps: - checkout - run: @@ -17,9 +26,11 @@ jobs: curl -L -s https://github.com/prometheus/prometheus/releases/download/v2.8.1/prometheus-2.8.1.linux-amd64.tar.gz |\ sudo tar -xz -C /usr/local/bin --strip-components=1 prometheus-2.8.1.linux-amd64/promtool sudo chmod +x /usr/local/bin/promtool - - run: pipenv install --dev - - run: pipenv run promgen test - - run: pipenv run coverage html -d test-results - - run: pipenv run codecov + - run: mkdir -p test-results + - run: python3 -m venv .venv + - run: .venv/bin/pip install -r docker/requirements.txt + - run: .venv/bin/pip install -e .[dev,mysql] + - run: .venv/bin/promgen test --with-xunit --xunit-file test-results/nosetests.xml --noinput + - run: .venv/bin/codecov - store_test_results: path: test-results diff --git a/setup.py b/setup.py index 215f4e0e4..366e84fdf 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ 'codecov', 'django-nose', 'nose-cov', + 'unittest-xml-reporting', ], 'docs': [ 'Sphinx',