From 23cc9bd6bee1f765c28075b7ad31503392680cdf Mon Sep 17 00:00:00 2001 From: Lukas Holzer Date: Tue, 8 Sep 2020 14:05:29 +0000 Subject: [PATCH] fix(examples): fix jest example on windows Fixes #1454 --- examples/jest/BUILD.bazel | 4 ---- internal/node/launcher.sh | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/jest/BUILD.bazel b/examples/jest/BUILD.bazel index 5b08c594f4..4192246a18 100644 --- a/examples/jest/BUILD.bazel +++ b/examples/jest/BUILD.bazel @@ -19,10 +19,6 @@ jest_test( ] + glob(["__snapshots__/*.snap"]), jest_config = ":jest.config.js", tags = [ - # Need to set the pwd to avoid jest needing a runfiles helper - # Windows users with permissions can use --enable_runfiles - # to make this test work - "no-bazelci-windows", # TODO: why does this fail almost all the time, but pass on local Mac? "no-bazelci-mac", ], diff --git a/internal/node/launcher.sh b/internal/node/launcher.sh index de6ea0094c..2c7bb4347c 100644 --- a/internal/node/launcher.sh +++ b/internal/node/launcher.sh @@ -149,14 +149,18 @@ fi # Export the location of the runfiles helpers script export BAZEL_NODE_RUNFILES_HELPER=$(rlocation "TEMPLATED_runfiles_helper_script") -if [[ "${BAZEL_NODE_RUNFILES_HELPER}" != /* ]] && [[ ! "${BAZEL_NODE_RUNFILES_HELPER}" =~ ^[A-Z]:[\\/] ]]; then +# Paths can be with lower and upper case on windows because of the msys64 package in the powershell +# https://regex101.com/r/c0Gjn8/1/ +if [[ "${BAZEL_NODE_RUNFILES_HELPER}" != /* ]] && [[ ! "${BAZEL_NODE_RUNFILES_HELPER}" =~ ^[A-Za-z]:[\/\\] ]]; then export BAZEL_NODE_RUNFILES_HELPER=$(pwd)/${BAZEL_NODE_RUNFILES_HELPER} fi # Export the location of the require patch script as it can be used to bootstrap # node require patch if needed export BAZEL_NODE_PATCH_REQUIRE=$(rlocation "TEMPLATED_require_patch_script") -if [[ "${BAZEL_NODE_PATCH_REQUIRE}" != /* ]] && [[ ! "${BAZEL_NODE_PATCH_REQUIRE}" =~ ^[A-Z]:[\\/] ]]; then +# Paths can be with lower and upper case on windows because of the msys64 package in the powershell +# https://regex101.com/r/c0Gjn8/1/ +if [[ "${BAZEL_NODE_PATCH_REQUIRE}" != /* ]] && [[ ! "${BAZEL_NODE_PATCH_REQUIRE}" =~ ^[A-Za-z]:[\/\\] ]]; then export BAZEL_NODE_PATCH_REQUIRE=$(pwd)/${BAZEL_NODE_PATCH_REQUIRE} fi