From ceb2b1dddff490fc2aeeb27902309d70142de013 Mon Sep 17 00:00:00 2001 From: jjudd Date: Tue, 12 Nov 2024 14:13:32 -0700 Subject: [PATCH] Try using command log instead of piping --- tests/dependencies/indirect/test | 11 ++++++----- tests/dependencies/unused/test | 6 ++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/dependencies/indirect/test b/tests/dependencies/indirect/test index 18033c0d..53cf786c 100755 --- a/tests/dependencies/indirect/test +++ b/tests/dependencies/indirect/test @@ -1,19 +1,20 @@ #!/bin/bash -e . "$(dirname "$0")"/../../common.sh +command_log="$(bazel info command_log)" + # used_deps off ! bazel build :used_deps_off_c || false -bazel build :used_deps_off_c 2>&1| grep "buildozer 'add deps @\?//dependencies/indirect:used_deps_off_a' //dependencies/indirect:used_deps_off_c" +! bazel build :used_deps_off_c && grep "buildozer 'add deps @\?//dependencies/indirect:used_deps_off_a' //dependencies/indirect:used_deps_off_c" "${command_log}" # direct_deps off ! bazel build :direct_deps_off_c || false -bazel build :direct_deps_off_c 2>&1| grep "buildozer 'remove deps //dependencies/indirect:direct_deps_off_a' //dependencies/indirect:direct_deps_off_b" +! bazel build :direct_deps_off_c && grep "buildozer 'remove deps //dependencies/indirect:direct_deps_off_a' //dependencies/indirect:direct_deps_off_b" "${command_log}" # toggle used_deps and direct_deps via --define ! bazel build --define=scala_deps_used=off :define_c || false -bazel build --define=scala_deps_used=off :define_c 2>&1| grep "buildozer 'add deps @\?//dependencies/indirect:define_a' //dependencies/indirect:define_c" +! bazel build --define=scala_deps_used=off :define_c && grep "buildozer 'add deps @\?//dependencies/indirect:define_a' //dependencies/indirect:define_c" "${command_log}" ! bazel build --define=scala_deps_direct=off :define_c || false -bazel build --define=scala_deps_direct=off :define_c 2>&1| grep "buildozer 'remove deps //dependencies/indirect:define_a' //dependencies/indirect:define_b" +! bazel build --define=scala_deps_direct=off :define_c && grep "buildozer 'remove deps //dependencies/indirect:define_a' //dependencies/indirect:define_b" "${command_log}" -bazel build --define=scala_deps_used=off --define=scala_deps_direct=off :define_c diff --git a/tests/dependencies/unused/test b/tests/dependencies/unused/test index fe7af2de..2ba2b76f 100755 --- a/tests/dependencies/unused/test +++ b/tests/dependencies/unused/test @@ -1,11 +1,13 @@ #!/bin/bash -e . "$(dirname "$0")"/../../common.sh +command_log="$(bazel info command_log)" + bazel build :0_used ! bazel build :0_unused || false -bazel build :0_unused 2>&1| grep "buildozer 'remove deps @annex_test//:org_scalacheck_scalacheck_2_13' //dependencies/unused:0_unused" +bazel build :0_unused && grep "buildozer 'remove deps @annex_test//:org_scalacheck_scalacheck_2_13' //dependencies/unused:0_unused" "${command_log}" bazel build :0_unused_whitelist bazel build :indirect_unused ! bazel build :indirect_unused_missing || false -bazel build :indirect_unused_missing 2>&1| grep "buildozer 'add deps @annex_test//:org_specs2_specs2_matcher_2_13' //dependencies/unused:indirect_unused_missing" +bazel build :indirect_unused_missing && grep "buildozer 'add deps @annex_test//:org_specs2_specs2_matcher_2_13' //dependencies/unused:indirect_unused_missing" "${command_log}" bazel build :indirect_unused_whitelist