Skip to content

Commit

Permalink
Fix windows Buildkit CI (#1649)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
crt-31 authored Dec 12, 2024
1 parent 8d9e1f8 commit 0df9e19
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ tasks:
test_rules_scala_win:
name: "./test_rules_scala"
platform: windows
shell_commands:
environment:
MSYS2_ARG_CONV_EXCL: "*"
batch_commands:
- "set PATH=/usr/bin;%PATH%" #Make sure bash uses msys commands over windows commands. (i.e. find).
- "bash -lc \"pacman --noconfirm --needed -S libxml2\"" #tests require xmllint
- "bash test_rules_scala.sh"
test_coverage_linux_6_5_0:
name: "./test_coverage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import org.scalatest.funsuite._
class ScalaLibResourcesDuplicatedTest extends AnyFunSuite {

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

assert(get("/resource.txt") === String.format("I am a text resource from child!\n"))
}

private def get(s: String): String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ScalaLibResourcesFromExternalDepTest extends SpecWithJUnit {
"Scala library depending on resources from external resource-only jar" >> {
"allow to load resources" >> {

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

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.scalatest.funsuite._
class ScalaLibResourcesFromExternalScalaTest extends AnyFunSuite {

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

Expand Down

0 comments on commit 0df9e19

Please sign in to comment.