Skip to content

Commit 3e7609b

Browse files
author
Blaine Freestone
committed
!fixup add automated
1 parent 1c8d0e1 commit 3e7609b

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

tests/determinism/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ load("@rules_scala_annex//rules:scala.bzl", "scala_library")
44
scala_library(
55
name = "tasty_test_lib",
66
srcs = ["SampleClass.scala"],
7-
scala_toolchain_name = "test_zinc_3",
87
)

tests/determinism/test

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
# Test that verifies TASTy files can be generated deterministically
55
echo "Testing TASTy file generation with Scala 3..."
66

7-
# Clean any previous builds
8-
bazel clean
9-
107
# Build the Scala 3 target, explicitly using Scala 3 toolchain
118
echo "Building target with Scala 3 toolchain..."
129
bazel build --@rules_scala_annex//rules/scala:scala-toolchain=test_zinc_3 --keep_going --remote_executor= --remote_cache= --disk_cache= :tasty_test_lib
@@ -20,9 +17,8 @@ temp_dir=$(mktemp -d)
2017

2118
cleanup() {
2219
exit_code=$?
23-
# This will be updated later to handle multiple directories
2420
for dir in "${temp_dirs[@]}"; do
25-
rm -rf "$dir" 2>/dev/null || true
21+
rm -r "$dir" 2>/dev/null || true
2622
done
2723
finish $exit_code
2824
}
@@ -61,8 +57,8 @@ temp_dirs=("$temp_dir")
6157
# Perform 4 additional builds (we already have one)
6258
for i in $(seq 2 5); do
6359
echo "Build $i/5..."
64-
bazel clean --expunge
65-
bazel build --@rules_scala_annex//rules/scala:scala-toolchain=test_zinc_3 --keep_going --remote_executor= --remote_cache= --disk_cache= :tasty_test_lib
60+
bazel clean
61+
bazel build --@rules_scala_annex//rules/scala:scala-toolchain=test_zinc_3 --remote_executor= --remote_cache= --disk_cache= :tasty_test_lib
6662

6763
# Create temp directory for this build
6864
temp_dir_n=$(mktemp -d)
@@ -75,26 +71,18 @@ for i in $(seq 2 5); do
7571
}
7672
done
7773

78-
# Cleanup function to remove temp directories
79-
cleanup() {
80-
exit_code=$?
81-
for dir in "${temp_dirs[@]}"; do
82-
rm -rf "$dir" 2>/dev/null || true
83-
done
84-
finish $exit_code
85-
}
86-
8774
# Compare all builds against the first one
8875
echo "Comparing TASTy files across all 5 builds for determinism..."
8976
all_identical=true
9077

9178
for i in $(seq 2 5); do
9279
build_num=$((i-1))
9380
echo "Comparing build 1 with build $i..."
94-
if ! diff -r "${temp_dirs[0]}" "${temp_dirs[$build_num]}" > /dev/null; then
81+
diff_output=$(diff -r "${temp_dirs[0]}" "${temp_dirs[$build_num]}" 2>&1)
82+
if [ $? -ne 0 ]; then
9583
echo "ERROR: TASTy files differ between build 1 and build $i - not deterministic"
9684
echo "Differences found:"
97-
diff -r "${temp_dirs[0]}" "${temp_dirs[$build_num]}"
85+
echo "$diff_output"
9886
all_identical=false
9987
fi
10088
done

0 commit comments

Comments
 (0)