Skip to content

Add src/... to test_rules_scala, fix Windows break #1724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/java/io/bazel/rulesscala/worker/WorkerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ public void work(String[] args) {
}
};

String contents = "line 1\n--flag_1\nsome arg\n";
String contents = String.join(
System.getProperty("line.separator"),
"line 1",
"--flag_1",
"some arg",
""); // The output will always have a line separator at the end.

Files.write(tmpFile, contents.getBytes(StandardCharsets.UTF_8));

Expand All @@ -69,8 +74,8 @@ public void work(String[] args) {
WorkerProtocol.WorkResponse response =
WorkerProtocol.WorkResponse.parseDelimitedFrom(helper.responseIn);

assertEquals(response.getExitCode(), 0);
assertEquals(response.getOutput(), contents);
assertEquals(0, response.getExitCode());
assertEquals(contents, response.getOutput());
} finally {
Files.deleteIfExists(tmpFile);
}
Expand Down
15 changes: 8 additions & 7 deletions test_rules_scala.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ test_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/test/shell
# shellcheck source=./test_runner.sh
. "${test_dir}"/test_runner.sh
runner=$(get_test_runner "${1:-local}")
test_output_flag="--test_output=errors"

. "${test_dir}"/test_bzlmod_macros.sh
$runner bazel build test/...
#$runner bazel build "test/... --all_incompatible_changes"
$runner bazel test test/...
$runner bazel test third_party/...
$runner bazel build "src/... test/..."
#$runner bazel build "src/... test/... --all_incompatible_changes"
$runner bazel test "${test_output_flag} src/... test/..."
$runner bazel test "${test_output_flag} third_party/..."
$runner bazel build "--extra_toolchains=//test/toolchains:high_level_transitive_deps_strict_deps_error -- test/..."
$runner bazel build "--extra_toolchains=//scala:minimal_direct_source_deps -- test/..."
#$runner bazel build "--extra_toolchains=//test/toolchains:high_level_transitive_deps_strict_deps_error --all_incompatible_changes -- test/..."
$runner bazel test "--extra_toolchains=//test/toolchains:high_level_transitive_deps_strict_deps_error -- test/..."
$runner bazel test "--extra_toolchains=//scala:minimal_direct_source_deps -- test/..."
$runner bazel test "${test_output_flag} --extra_toolchains=//test/toolchains:high_level_transitive_deps_strict_deps_error -- test/..."
$runner bazel test "${test_output_flag} --extra_toolchains=//scala:minimal_direct_source_deps -- test/..."
$runner bazel build "test_expect_failure/missing_direct_deps/internal_deps/... --strict_java_deps=warn --extra_toolchains=//test/toolchains:high_level_transitive_deps_strict_deps_warn"
$runner bazel build //test_expect_failure/proto_source_root/... --strict_proto_deps=off
$runner bazel test //test/... --extra_toolchains="//test_expect_failure/plus_one_deps:plus_one_deps"
$runner bazel test "$test_output_flag" //test/... --extra_toolchains="//test_expect_failure/plus_one_deps:plus_one_deps"
$runner bazel build test:ScalaBinaryInGenrule --nolegacy_external_runfiles
$runner bazel build //test_statsfile:Simple_statsfile
$runner bazel build //test_statsfile:SimpleNoStatsFile_statsfile --extra_toolchains="//test/toolchains:enable_stats_file_disabled_toolchain"
Expand Down