Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit d711016

Browse files
committed
rabbitmq-build.mk: Format -ct_hooks value dynamically
... instead of hardcoding the value. This flag takes a list of hooks separated by `and`. This formatting should really go into Erlang.mk which would accept a `$(CT_HOOKS)` variable. For instance, `$(CT_OPTS)` was broken with Jenkins because multiple `ct_hooks` were passed instead of using the `and` syntax.
1 parent 5b14e4f commit d711016

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

mk/rabbitmq-build.mk

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,34 @@ TEST_ERLC_OPTS += $(RMQ_ERLC_OPTS)
5656
# cth_styledout
5757
# This hook will change the output of common_test to something more
5858
# concise and colored.
59+
#
60+
# On Jenkins, in addition to those common_test hooks, enable JUnit-like
61+
# report. Jenkins parses those reports so the results can be browsed
62+
# from its UI. Furthermore, it displays a graph showing evolution of the
63+
# results over time.
5964

60-
CTH_DEPS = cth_fail_fast cth_styledout
61-
dep_cth_fail_fast = git https://github.com/rabbitmq/cth_fail_fast.git master
62-
dep_cth_styledout = git https://github.com/rabbitmq/cth_styledout.git master
63-
CTH_OPTS = -ct_hooks cth_fail_fast and cth_styledout
65+
CT_HOOKS ?=
6466

67+
RMQ_CT_HOOKS = cth_fail_fast cth_styledout
6568
ifdef TRAVIS
66-
TEST_DEPS += $(CTH_DEPS)
67-
CT_OPTS += $(CTH_OPTS)
69+
CT_HOOKS += $(RMQ_CT_HOOKS)
70+
TEST_DEPS += $(RMQ_CT_HOOKS)
6871
endif
6972
ifdef CONCOURSE
70-
TEST_DEPS += $(CTH_DEPS)
71-
CT_OPTS += $(CTH_OPTS)
73+
CT_HOOKS += $(RMQ_CT_HOOKS)
74+
TEST_DEPS += $(RMQ_CT_HOOKS)
75+
endif
76+
ifdef JENKINS_HOME
77+
CT_HOOKS += cth_surefire $(RMQ_CT_HOOKS)
78+
TEST_DEPS += $(RMQ_CT_HOOKS)
7279
endif
7380

81+
dep_cth_fail_fast = git https://github.com/rabbitmq/cth_fail_fast.git master
82+
dep_cth_styledout = git https://github.com/rabbitmq/cth_styledout.git master
83+
84+
CT_HOOKS_PARAM_VALUE = $(patsubst %,and %,$(CT_HOOKS))
85+
CT_OPTS += -ct_hooks $(wordlist 2,$(words $(CT_HOOKS_PARAM_VALUE)),$(CT_HOOKS_PARAM_VALUE))
86+
7487
# Disable most messages on Travis because it might exceed the limit
7588
# set by Travis.
7689
#
@@ -91,14 +104,6 @@ ifdef TRAVIS
91104
CT_OPTS += $(CT_QUIET_FLAGS)
92105
endif
93106

94-
# Enable JUnit-like report on Jenkins. Jenkins parses those reports so
95-
# the results can be browsed from its UI. Furthermore, it displays a
96-
# graph showing evolution of the results over time.
97-
98-
ifdef JENKINS_HOME
99-
CT_OPTS += -ct_hooks cth_surefire
100-
endif
101-
102107
# On CI, set $RABBITMQ_CT_SKIP_AS_ERROR so that any skipped
103108
# testsuite/testgroup/testcase is considered an error.
104109

0 commit comments

Comments
 (0)