Skip to content

Commit

Permalink
Test that ScalaCheckDeps outputs aren't inputs to other actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaden Peterson authored and jjudd committed Nov 12, 2024
1 parent ce737b0 commit 3704408
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/dependencies/validation_action/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load("@rules_scala_annex//rules:scala.bzl", "scala_library")

scala_library(
name = "validation_action",
scala = "//scala:2_13",
tags = ["manual"],
)
24 changes: 24 additions & 0 deletions tests/dependencies/validation_action/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -e
. "$(dirname "$0")"/../../common.sh

scalacheckdeps_outputs="$(
bazel aquery 'mnemonic("^ScalaCheckDeps$", //dependencies/validation_action)' |
grep -oP '(?<=^ Outputs: \[).*(?=\]$)' |
sed 's/, /\n/g' |
sort -u
)"

action_inputs="$(
bazel aquery '//dependencies/validation_action' |
grep -oP '(?<=^ Inputs: \[).*(?=\]$)' |
sed 's/, /\n/g' |
sort -u
)"

common_files="$(comm -12 <(echo "$scalacheckdeps_outputs") <(echo "$action_inputs"))"

if [ -n "$common_files" ]; then
echo "Found some ScalaCheckDeps outputs that are the inputs to other actons:"
echo "$common_files"
exit 1
fi

0 comments on commit 3704408

Please sign in to comment.