Skip to content

Commit

Permalink
Fixed various failing tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jaden Peterson committed Nov 14, 2024
1 parent 85dd91b commit fb0d2aa
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
8 changes: 5 additions & 3 deletions tests/compile/srcjar/test
Original file line number Diff line number Diff line change
@@ -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
)
7 changes: 4 additions & 3 deletions tests/plugins/semanticdb/test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/maven/test
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
6 changes: 4 additions & 2 deletions tests/resources/plain/test
Original file line number Diff line number Diff line change
@@ -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
)
2 changes: 1 addition & 1 deletion tests/resources/prefix/test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tests/resources/reference_conf/test
Original file line number Diff line number Diff line change
@@ -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
)
2 changes: 1 addition & 1 deletion tests/scaladoc/test
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
. "$(dirname "$0")"/../common.sh

bazel build :a_doc
grep -q '<title>//scaladoc:a_doc' "$(bazel info bazel-bin)/scaladoc/html/index.html"
grep -q '<title>//scaladoc:a_doc' "../bazel-bin/scaladoc/html/index.html"

0 comments on commit fb0d2aa

Please sign in to comment.