@@ -4,6 +4,8 @@ cur_path := $(abspath $(lastword $(MAKEFILE_LIST)))
44cur_dir := $(dir $(cur_path ) )
55cur_base := $(notdir $(cur_path ) )
66
7+ export PATH := $(shell npm bin) :$(PATH )
8+
79# Use this variable for invoking the test runner
810export MOCHA := $(shell npm bin) /mocha
911
@@ -15,21 +17,32 @@ export MOCHA := $(shell npm bin)/mocha
1517# one: most important version, stable version for smoke test
1618#
1719# Default is all, but it can be overriden from the command line
18- TARGET_VERSIONS? = all
20+ TARGET_VERSIONS ?= all
1921configure_targets = $(if $(filter one,$(TARGET_VERSIONS ) ) ,$(1 ) ,$(if $(filter some,$(TARGET_VERSIONS ) ) ,$(2 ) ,)$(if $(filter all,$(TARGET_VERSIONS ) ) ,$(3 ) ,) )
2022
2123# Every library instrumentation should have a subrecipe in its directory
2224# containing the target test_suite_<LIBRARY_NAME>
2325# and should append <LIBRARY_NAME> to the variable `targets`
24- include $(cur_dir ) /*/*.mk
26+ ifndef TARGET_LIBRARIES
27+ include $(cur_dir)/*/*.mk
28+ else
29+ include $(patsubst %, $(cur_dir)/%/*.mk, $(TARGET_LIBRARIES))
30+ endif
31+
32+ # Used for running tests in parallel if possible which will speed up the job on
33+ # CircleCI.
34+ NODE_INDEX ?= 0
35+ NODE_TOTAL ?= 1
2536
26- # We have a common package json for every test suite, because it is much more
27- # fast this way. Of course you could install other dependencies in the test
28- # suites. This is actually needed for versioning.
37+ # We have a common package json for every test suite, because it is faster
38+ # this way. Of course you could install other dependencies in the test suites.
39+ # This is actually needed for versioning.
2940before :
41+ @node --version
42+ @npm --version
3043 npm i
3144
32- test : $(targets:%=test_suite_% )
45+ test : $(shell $( cur_dir ) /distribute-tasks.py $( NODE_INDEX ) $( NODE_TOTAL ) $( targets:%=test_suite_% ) )
3346
3447# On best practices for writing a test suite for an instrumentation, please
3548# see mysql/mysql.mk
0 commit comments