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

Commit 6ee312c

Browse files
committed
rabbitmq-build.mk: Enable cth_styledout on Travis and Concourse
The goal of this hook is to change the default output of common_test on stdout to something colored and concise. The HTML reports still contain everything. This hook only works with Erlang 19.2+. With previous version, it will be a no-op and the outout will remain unchanged. With this change, we restore the default verbosity of common_test on Concourse. It means way too many messages with Erlang up-to 19.1 but that's ok. On Travis, we keep the lowered verbosity because we could reach the limit set by Travis. Note that the verbosity affects both stdout and the HTML reports so on Concourse, we should have more data to debug failures. While here, reorganize a bit the common_flags to separate each "topic". [#138917395]
1 parent 18a9f90 commit 6ee312c

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

mk/rabbitmq-build.mk

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,40 @@ ERLC_OPTS += $(RMQ_ERLC_OPTS)
4444
TEST_ERLC_OPTS += $(RMQ_ERLC_OPTS)
4545

4646
# --------------------------------------------------------------------
47-
# Common test flags.
47+
# Common Test flags.
4848
# --------------------------------------------------------------------
4949

50-
# Enable the cth_fail_fast common_test hook on Concourse.
50+
# Enable the following common_test hooks on Travis and Concourse:
5151
#
52-
# This hook will make sure the first failure puts an end to the
53-
# testsuites; ie. all remaining tests are skipped.
52+
# cth_fail_fast
53+
# This hook will make sure the first failure puts an end to the
54+
# testsuites; ie. all remaining tests are skipped.
55+
#
56+
# cth_styledout
57+
# This hook will change the output of common_test to something more
58+
# consise and colored.
5459

55-
ifdef CONCOURSE
56-
TEST_DEPS += cth_fail_fast
60+
CTH_DEPS = cth_fail_fast cth_styledout
5761
dep_cth_fail_fast = git https://github.com/rabbitmq/cth_fail_fast.git master
58-
CT_OPTS += -ct_hooks cth_fail_fast
62+
dep_cth_styledout = git https://github.com/rabbitmq/cth_styledout.git master
63+
CTH_OPTS = -ct_hooks cth_fail_fast and cth_styledout
64+
65+
ifdef TRAVIS
66+
TEST_DEPS += $(CTH_DEPS)
67+
CT_OPTS += $(CTH_OPTS)
68+
endif
69+
ifdef CONCOURSE
70+
TEST_DEPS += $(CTH_DEPS)
71+
CT_OPTS += $(CTH_OPTS)
5972
endif
6073

61-
# Disable most messages on Travis and Concourse.
74+
# Disable most messages on Travis because it might exceed the limit
75+
# set by Travis.
6276
#
63-
# On CI, set $RABBITMQ_CT_SKIP_AS_ERROR so that any skipped
64-
# testsuite/testgroup/testcase is considered an error.
77+
# On Concourse, we keep the default verbosity. With Erlang 19.2+, the
78+
# cth_styledout hook will change the output to something concise and all
79+
# messages are available in in HTML reports. With Erlang up-to 19.1,
80+
# stdout will be flooded with messages, but we'll live with that.
6581
#
6682
# CAUTION: All arguments after -erl_args are passed to the emulator and
6783
# common_test doesn't interpret them! Therefore, all common_test flags
@@ -73,17 +89,25 @@ CT_QUIET_FLAGS = -verbosity 50 \
7389

7490
ifdef TRAVIS
7591
CT_OPTS += $(CT_QUIET_FLAGS)
76-
export RABBITMQ_CT_SKIP_AS_ERROR = true
77-
endif
78-
ifdef CONCOURSE
79-
CT_OPTS += $(CT_QUIET_FLAGS)
80-
export RABBITMQ_CT_SKIP_AS_ERROR = true
8192
endif
8293

8394
# Enable JUnit-like report on Jenkins. Jenkins parses those reports so
8495
# the results can be browsed from its UI. Furthermore, it displays a
8596
# graph showing evolution of the results over time.
97+
8698
ifdef JENKINS_HOME
8799
CT_OPTS += -ct_hooks cth_surefire
100+
endif
101+
102+
# On CI, set $RABBITMQ_CT_SKIP_AS_ERROR so that any skipped
103+
# testsuite/testgroup/testcase is considered an error.
104+
105+
ifdef TRAVIS
106+
export RABBITMQ_CT_SKIP_AS_ERROR = true
107+
endif
108+
ifdef CONCOURSE
109+
export RABBITMQ_CT_SKIP_AS_ERROR = true
110+
endif
111+
ifdef JENKINS_HOME
88112
export RABBITMQ_CT_SKIP_AS_ERROR = true
89113
endif

0 commit comments

Comments
 (0)