From fb0d2aa1a2bdd73c8ec723069e90d4db846213cd Mon Sep 17 00:00:00 2001 From: Jaden Peterson Date: Wed, 13 Nov 2024 13:44:45 -0500 Subject: [PATCH] Fixed various failing tests These tests were looking in the wrong output directory, which has changed now that we're using a configuration setting to determine the Scala compiler. --- tests/compile/srcjar/test | 8 +++++--- tests/plugins/semanticdb/test | 7 ++++--- tests/resources/maven/test | 2 +- tests/resources/plain/test | 6 ++++-- tests/resources/prefix/test | 2 +- tests/resources/reference_conf/test | 6 ++++-- tests/scaladoc/test | 2 +- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/tests/compile/srcjar/test b/tests/compile/srcjar/test index 00d1c74fe..a2831c523 100755 --- a/tests/compile/srcjar/test +++ b/tests/compile/srcjar/test @@ -1,20 +1,22 @@ #!/bin/bash -e . "$(dirname "$0")"/../../common.sh +package_output_directory='../../bazel-bin/compile/srcjar' + zip -FSr example.srcjar Example.scala META-INF/MANIFEST.MF bazel build :lib-srcjar diff <( sort expected) <( - zipinfo -m -T --h-t "$(bazel info bazel-bin)/compile/srcjar/lib-srcjar.jar" | sort + zipinfo -m -T --h-t "$package_output_directory/lib-srcjar.jar" | sort ) zip -FSr example-sources.jar Example.scala META-INF/MANIFEST.MF bazel build :lib-sources-jar diff <( sort expected) <( - zipinfo -m -T --h-t "$(bazel info bazel-bin)/compile/srcjar/lib-sources-jar.jar" | sort + zipinfo -m -T --h-t "$package_output_directory/lib-sources-jar.jar" | sort ) zip -FSr example-src.jar Example.scala META-INF/MANIFEST.MF bazel build :lib-src-jar diff <( sort expected) <( - zipinfo -m -T --h-t "$(bazel info bazel-bin)/compile/srcjar/lib-src-jar.jar" | sort + zipinfo -m -T --h-t "$package_output_directory/lib-src-jar.jar" | sort ) diff --git a/tests/plugins/semanticdb/test b/tests/plugins/semanticdb/test index fbcf104f1..d93bae1a8 100755 --- a/tests/plugins/semanticdb/test +++ b/tests/plugins/semanticdb/test @@ -18,10 +18,11 @@ check_semanticdb_info() { bazel build ":semanticdb-$1-semanticdb-info" output_path="$bazel_bin/plugins/semanticdb/semanticdb-$1-semanticdb-info.txt" - semanticdb_file_directory="bazel-out/k8-fastbuild/bin/plugins/semanticdb/semanticdb-$1/semanticdb/META-INF/semanticdb/plugins/semanticdb" + reported_semanticdb_files="$(jq -r '.semanticDbFiles[]' "$output_path" | sed -E 's_^bazel-out/[^\n/]+/bin/__g')" + semanticdb_file_directory="plugins/semanticdb/semanticdb-$1/semanticdb/META-INF/semanticdb/plugins/semanticdb" - [ "$(jq ".targetRoot" "$output_path")" = "\"plugins/semanticdb/semanticdb-$1/semanticdb\"" ] - [ "$(jq -c ".semanticDbFiles" "$output_path")" = "[\"$semanticdb_file_directory/A.scala.semanticdb\",\"$semanticdb_file_directory/B.scala.semanticdb\"]" ] + [ "$(jq '.targetRoot' "$output_path")" = "\"plugins/semanticdb/semanticdb-$1/semanticdb\"" ] + [ "$reported_semanticdb_files" = "$semanticdb_file_directory/A.scala.semanticdb"$'\n'"$semanticdb_file_directory/B.scala.semanticdb" ] } bazel build :semanticdb-2_13 diff --git a/tests/resources/maven/test b/tests/resources/maven/test index 7b10ed912..0c9f426b1 100755 --- a/tests/resources/maven/test +++ b/tests/resources/maven/test @@ -3,5 +3,5 @@ bazel build :maven diff <(sort expected) <( - zipinfo -m -T --h-t "$(bazel info bazel-bin)/resources/maven/maven.jar" | sort + zipinfo -m -T --h-t "../../bazel-bin/resources/maven/maven.jar" | sort ) diff --git a/tests/resources/plain/test b/tests/resources/plain/test index 073e488ff..91ac2a164 100755 --- a/tests/resources/plain/test +++ b/tests/resources/plain/test @@ -1,12 +1,14 @@ #!/bin/bash -e . "$(dirname "$0")"/../../common.sh +package_output_directory='../../bazel-bin/resources/plain' + bazel build :plain diff <(sort expected_plain) <( - zipinfo -m -T --h-t "$(bazel info bazel-bin)/resources/plain/plain.jar" | sort + zipinfo -m -T --h-t "$package_output_directory/plain.jar" | sort ) bazel build :merged diff <(sort expected_merged) <( - zipinfo -m -T --h-t "$(bazel info bazel-bin)/resources/plain/merged.jar" | sort + zipinfo -m -T --h-t "$package_output_directory/merged.jar" | sort ) diff --git a/tests/resources/prefix/test b/tests/resources/prefix/test index ccff72bec..6b13b4851 100755 --- a/tests/resources/prefix/test +++ b/tests/resources/prefix/test @@ -3,7 +3,7 @@ bazel build :prefix diff <(sort expected) <( - zipinfo -m -T --h-t "$(bazel info bazel-bin)/resources/prefix/prefix.jar" | sort + zipinfo -m -T --h-t "../../bazel-bin/resources/prefix/prefix.jar" | sort ) ! bazel build :outside diff --git a/tests/resources/reference_conf/test b/tests/resources/reference_conf/test index 3f9169f6b..922eb73b0 100755 --- a/tests/resources/reference_conf/test +++ b/tests/resources/reference_conf/test @@ -1,12 +1,14 @@ #!/bin/bash -e . "$(dirname "$0")"/../../common.sh +package_output_directory='../../bazel-bin/resources/reference_conf' + bazel build :plain_java diff <(sort expected_plain) <( - zipinfo -m -T --h-t "$(bazel info bazel-bin)/resources/reference_conf/libplain_java.jar" | sort + zipinfo -m -T --h-t "$package_output_directory/libplain_java.jar" | sort ) bazel build :plain diff <(sort expected_plain) <( - zipinfo -m -T --h-t "$(bazel info bazel-bin)/resources/reference_conf/plain.jar" | sort + zipinfo -m -T --h-t "$package_output_directory/plain.jar" | sort ) diff --git a/tests/scaladoc/test b/tests/scaladoc/test index ef3acd7a5..94fe1ccf4 100755 --- a/tests/scaladoc/test +++ b/tests/scaladoc/test @@ -2,4 +2,4 @@ . "$(dirname "$0")"/../common.sh bazel build :a_doc -grep -q '//scaladoc:a_doc' "$(bazel info bazel-bin)/scaladoc/html/index.html" +grep -q '<title>//scaladoc:a_doc' "../bazel-bin/scaladoc/html/index.html"