Repository: kudu Updated Branches: refs/heads/master a81d80a79 -> 0dcf16673
[tools] fix glog output colorizing for kudu CLI tests This patch adds the '--nocolorlogtostderr' flag to every invocation of the kudu CLI tool run by the kudu::tools::RunKuduTool() function. Prior to this fix, the following tests would fail if running in the environment where the GLOG_colorlogtostderr variable is set to 1: ToolTest.TestTopLevelHelp ToolTest.TestModeHelp ToolTest.TestActionHelp ToolTest.TestActionMissingRequiredArg Change-Id: I6635955182e8fdbb4406c9909a7a09a7d3a55955 Reviewed-on: http://gerrit.cloudera.org:8080/10865 Reviewed-by: Adar Dembo <a...@cloudera.com> Tested-by: Kudu Jenkins Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/0dcf1667 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/0dcf1667 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/0dcf1667 Branch: refs/heads/master Commit: 0dcf166730c81fa07039788215279ef0bcfc03fe Parents: a81d80a Author: Alexey Serbin <aser...@cloudera.com> Authored: Tue Jul 3 18:18:06 2018 -0700 Committer: Alexey Serbin <aser...@cloudera.com> Committed: Wed Jul 4 01:49:32 2018 +0000 ---------------------------------------------------------------------- src/kudu/tools/tool_test_util.cc | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/0dcf1667/src/kudu/tools/tool_test_util.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/tool_test_util.cc b/src/kudu/tools/tool_test_util.cc index 60da0bb..8f7318f 100644 --- a/src/kudu/tools/tool_test_util.cc +++ b/src/kudu/tools/tool_test_util.cc @@ -54,6 +54,12 @@ Status RunKuduTool(const vector<string>& args, string* out, string* err, total_args.emplace_back("--unlock_unsafe_flags"); total_args.emplace_back("--never_fsync"); + // Do not colorize glog's output (i.e. messages logged via LOG()) even + // if the GLOG_colorlogtostderr environment variable is set. This is to avoid + // failing of tests that depend on the exact output from the tool + // (e.g., the exact location of some substring/character in the output line). + total_args.emplace_back("--nocolorlogtostderr"); + total_args.insert(total_args.end(), args.begin(), args.end()); return Subprocess::Call(total_args, in, out, err); }