CircleCI parallelization

* Enable parallelism in .circleci/config.yml
* Add BUSTED_SPEC_FILE to Makefile testfront
* Use it in .ci/test.sh with xargs for test parallelization

NB This is the dumb method of improving test time.
Ideally we want a workflow fan-in/fan-out approach.
This commit is contained in:
Frans de Jonge
2017-10-10 10:00:26 +02:00
parent 2b89be4f95
commit 868860a62e
3 changed files with 6 additions and 2 deletions

View File

@@ -4,4 +4,7 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=/dev/null
source "${CI_DIR}/common.sh"
make testfront
pushd koreader-emulator-x86_64-linux-gnu/koreader && {
circleci tests glob "spec/front/unit/*_spec.lua" | circleci tests split --split-by=timings --timings-type=filename | xargs -I{} sh -c 'make -C ../.. testfront BUSTED_SPEC_FILE="{}" || exit 255'
} && popd
#make testfront

View File

@@ -7,6 +7,7 @@ jobs:
EMULATE_READER: 1
# this is for shellcheck 0.4.5 and lower; can be removed for 0.4.6
LC_ALL: en_US.UTF8
parallelism: 4
steps:
- checkout
- restore_cache:

View File

@@ -102,7 +102,7 @@ testfront: $(INSTALL_DIR)/koreader/.busted
cd $(INSTALL_DIR)/koreader && ./luajit $(shell which busted) \
--sort-files \
--no-auto-insulate \
-o verbose_print --exclude-tags=notest
-o verbose_print --exclude-tags=notest $(BUSTED_SPEC_FILE)
test: $(INSTALL_DIR)/koreader/.busted
$(MAKE) -C $(KOR_BASE) test