Skip to content

Commit 0df9e19

Browse files
authored
Fix windows Buildkit CI (bazel-contrib#1649)
* make windows CI work again - windows buildkite needs batch_commands instead of shell_commands * Fixed tests to pass on windows when autocrlf=false * Added MSYS2_ARG_CONV_EXCL=* to windows CI This is needed to handle targets (with //) that are passed as args * Set PATH when running windows tests * Explicity add libxml2 to Windows CI environment
1 parent 8d9e1f8 commit 0df9e19

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.bazelci/presubmit.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ tasks:
4646
test_rules_scala_win:
4747
name: "./test_rules_scala"
4848
platform: windows
49-
shell_commands:
49+
environment:
50+
MSYS2_ARG_CONV_EXCL: "*"
51+
batch_commands:
52+
- "set PATH=/usr/bin;%PATH%" #Make sure bash uses msys commands over windows commands. (i.e. find).
53+
- "bash -lc \"pacman --noconfirm --needed -S libxml2\"" #tests require xmllint
5054
- "bash test_rules_scala.sh"
5155
test_coverage_linux_6_5_0:
5256
name: "./test_coverage"

test/src/main/scala/scalarules/test/duplicated_resources/child/ScalaLibResourcesDuplicatedTest.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import org.scalatest.funsuite._
55
class ScalaLibResourcesDuplicatedTest extends AnyFunSuite {
66

77
test("Scala library depends on resource + deps that contains same name resources, have higher priority on this target's resource.") {
8-
//Using platform dependent newline (%n)
9-
assert(get("/resource.txt") === String.format("I am a text resource from child!%n"))
8+
9+
assert(get("/resource.txt") === String.format("I am a text resource from child!\n"))
1010
}
1111

1212
private def get(s: String): String =

test/src/main/scala/scalarules/test/resources/ScalaLibResourcesFromExternalDepTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class ScalaLibResourcesFromExternalDepTest extends SpecWithJUnit {
77
"Scala library depending on resources from external resource-only jar" >> {
88
"allow to load resources" >> {
99

10-
val expectedString = String.format("A resource%n"); //Using platform dependent newline (%n)
10+
val expectedString = String.format("A resource\n");
1111
get("/resource.txt") must beEqualTo(expectedString)
1212

1313
}

test/src/main/scala/scalarules/test/resources/ScalaLibResourcesFromExternalScalaTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.scalatest.funsuite._
55
class ScalaLibResourcesFromExternalScalaTest extends AnyFunSuite {
66

77
test("Scala library depending on resources from external resource-only jar should allow to load resources") {
8-
val expectedString = String.format("A resource%n"); //Using platform dependent newline (%n)
8+
val expectedString = String.format("A resource\n");
99
assert(get("/resource.txt") === expectedString)
1010
}
1111

0 commit comments

Comments
 (0)