Skip to content

Instantly share code, notes, and snippets.

@NejcZupec
Last active November 15, 2018 16:09
Show Gist options
  • Save NejcZupec/4c8145359e740035531969485d1f1d65 to your computer and use it in GitHub Desktop.
Save NejcZupec/4c8145359e740035531969485d1f1d65 to your computer and use it in GitHub Desktop.
CircleCI Parallelization
$ circleci tests glob "test/integration/**/test_*.py"
test/integration/test_1.py
test/integration/test_2.py
test/integration/test_3.py
test/integration/test_4.py
test/integration/test_5.py
test/integration/test_6.py
test/integration/test_7.py
test/integration/test_8.py
$ circleci tests split --total 4 --index 0
test/integration/test_1.py
test/integration/test_5.py
$ CIRCLE_NODE_TOTAL=4
$ CIRCLE_NODE_INDEX=0
$ circleci tests split
test/integration/test_1.py
test/integration/test_5.py
integration-tests:
parallelism: 8
docker:
- image: circleci/python:3.7-stretch
steps:
- run:
name: Split tests and run them
command: |
TEST_FILES=$(circleci tests glob "test/integration/**/test_*.py" | circleci tests split)
bin/test.py integration "$(echo $TEST_FILES)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment