From 45f9443d553bf782e9dfcc96aea0056056c821dc Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 16 Jun 2020 08:23:40 -0700 Subject: [PATCH] fix(builtin): scrub node-patches VERBOSE_LOGS when asserting on stderr In the ubuntu1804_debug job on circleci we run with --define=VERBOSE_LOGS=1 but it produces extra stuff in stderr --- internal/node/test/BUILD.bazel | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/node/test/BUILD.bazel b/internal/node/test/BUILD.bazel index 334251940d..414e2e31ad 100644 --- a/internal/node/test/BUILD.bazel +++ b/internal/node/test/BUILD.bazel @@ -283,10 +283,20 @@ nodejs_binary( entry_point = "terser_diagnostics_stats.js", ) +# When we build with --define=VERBOSE_LOGS=1 there is some extra stuff printed to stderr +# We don't care to assert about that, and it has machine-local paths so we can't assert +# on the exact content either. +genrule( + name = "scrub_verbose_logs_stderr", + srcs = [":diagnostics.out"], + outs = [":diagnostics.scrubbed.out"], + cmd = "grep -v 'bazel node patches enabled' $< > $@", +) + generated_file_test( name = "stderr_output_test", src = "stderr_output_test.golden", - generated = ":diagnostics.out", + generated = ":diagnostics.scrubbed.out", ) nodejs_binary(