forked from higherkindness/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try using Bazel's command_log instead of piping
- Loading branch information
Showing
6 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
#!/bin/bash -e | ||
. "$(dirname "$0")"/../../common.sh | ||
|
||
command_log="$(bazel info command_log)" | ||
|
||
# We use nouse_action_cache + bazel shutdown here in order to prevent the skyframe | ||
# cache and the persistent action cache from being used and thus getting the | ||
# warning we want printed, printed. The alternative is to bazel clean, which | ||
# takes much longer. | ||
bazel shutdown | ||
bazel build :lib --nouse_action_cache |& grep "compiling 1 Scala source" | ||
bazel build :lib --nouse_action_cache && grep "compiling 1 Scala source" "${command_log}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
#!/bin/bash -e | ||
. "$(dirname "$0")"/../../common.sh | ||
|
||
command_log="$(bazel info command_log)" | ||
|
||
# We use nouse_action_cache + bazel shutdown here in order to prevent the skyframe | ||
# cache and the persistent action cache from being used and thus getting the | ||
# warning we want printed, printed. The alternative is to bazel clean, which | ||
# takes much longer. | ||
bazel shutdown | ||
# Using a worker here prevents a println this tests needs from making it | ||
# to the command line, so we use standalone instead. | ||
bazel build :inefficient-usage --strategy=ScalaCompile=standalone --nouse_action_cache |& \ | ||
bazel build :inefficient-usage --strategy=ScalaCompile=standalone --nouse_action_cache && \ | ||
awk ' | ||
BEGIN {z = 2} | ||
/slightly inefficient/ {z -= 1} | ||
/scalac plugin phase success/ {z -= 1} | ||
END {exit z}' | ||
END {exit z}' "${command_log}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#!/bin/bash -e | ||
. "$(dirname "$0")"/../../common.sh | ||
|
||
command_log="$(bazel info command_log)" | ||
|
||
bazel build :prefix | ||
diff <(sort expected) <( | ||
zipinfo -m -T --h-t "$(bazel info bazel-bin)/resources/prefix/prefix.jar" | sort | ||
) | ||
|
||
! bazel build :outside | ||
bazel build :outside |& grep 'does not have prefix' | ||
! bazel build :outside && grep 'does not have prefix' "${command_log}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/bash -e | ||
. "$(dirname "$0")"/../common.sh | ||
|
||
command_log="$(bazel info command_log)" | ||
|
||
bazel test :error-spec | ||
bazel test :fatal-error-spec |& grep -q 'java.lang.OutOfMemoryError' | ||
! bazel test :fatal-error-spec && grep -q 'java.lang.OutOfMemoryError' "${command_log}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
#!/bin/bash -e | ||
. "$(dirname "$0")"/../common.sh | ||
|
||
command_log="$(bazel info command_log)" | ||
|
||
# We use modify_execution_info, nouse_action_cache, and bazel shutdown here | ||
# in order to prevent the disk cache, skyframe cache, and persistent action cache | ||
# from being used for the verbosity spec worker actions and thus getting the | ||
# verbosity we want getting printed. The alternative is to bazel clean, which | ||
# takes much longer. | ||
bazel shutdown | ||
bazel build --modify_execution_info="VerbositySpecWorkerRun=+no-cache" --nouse_action_cache :verbosity-spec-target |& grep -q "Verbosity: 0" | ||
bazel build --modify_execution_info="VerbositySpecWorkerRun=+no-cache" --nouse_action_cache :verbosity-spec-target && grep -q "Verbosity: 0" "${command_log}" | ||
bazel shutdown | ||
bazel build --modify_execution_info="VerbositySpecWorkerRun=+no-cache" --nouse_action_cache --worker_verbose :verbosity-spec-target |& grep -q "Verbosity: 10" | ||
bazel build --modify_execution_info="VerbositySpecWorkerRun=+no-cache" --nouse_action_cache --worker_verbose :verbosity-spec-target && grep -q "Verbosity: 10" "${command_log}" |