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.
pull/3335/head
Frans de Jonge 7 years ago
parent 2b89be4f95
commit 868860a62e

@ -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

@ -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:

@ -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

Loading…
Cancel
Save