From 68b77ede3d95266f67b62cf59710e2d86c09dd7e Mon Sep 17 00:00:00 2001 From: Anthony Miyaguchi Date: Mon, 13 Aug 2018 16:12:58 -0700 Subject: [PATCH] Bug 1470279 - Add parallel tests in CircleCI --- .circleci/config.yml | 18 ++++++++++++++++-- tox.ini | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 293089d..9435c87 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,6 +64,7 @@ jobs: test: <<: *common_settings + parallelism: 8 steps: - checkout - run: *early_return_for_skip_tests @@ -72,8 +73,21 @@ jobs: - run: apt update && apt install -y libsnappy-dev default-jre - run: pip install tox - run: - name: tox - command: tox + name: run tests + command: | + circleci tests glob "tests/**/test*.py" > tests.txt + tox -- \ + $(circleci tests split --split-by=timings tests.txt | tr -d '\r') \ + --junitxml=test-reports/junit.xml + - store_test_results: + path: test-reports + - store_artifacts: + path: test-reports + - run: + name: Submit code coverage data + command: | + bash <(curl -s https://codecov.io/bash) + - save_cache: *save_cache_settings lint: <<: *common_settings diff --git a/tox.ini b/tox.ini index 9f1db53..20b260f 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ envlist = py27, flake8 [pytest] -addopts = --cov=mozetl tests/ +addopts = --cov=mozetl [testenv] usedevelop = True