You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got the same error, on windows trying to run jest tests.
So I tried to add copy_to_bin as you suggested @alexeagle but after some digging I found that jest is executed in C:\users\$USER\_bazel_$USER\u3lrkeg4\execroot\<workspace-name>\bazel-out\x64_windows-fastbuild\bin\test.bat.runfiles\<workspace-name> which is empty.
The directory C:\users\$USER\_bazel_$USER\u3lrkeg4\execroot\<workspace-name>\bazel-out\x64_windows-fastbuild\bin\ seems well populated.
I found in the source, there is a comment about Windows
@alexeagle When I go the folder examples/jest in the rules_nodejs (stable branch) and running bazel run :test it is working fine on macOS and Linux but on windows, it is failing with:
I think I found somehow the issue:
If I run bazel run //:test it will fail with the above error
If I rerun bazel run //:test --enable_runfiles with the enable_runfiles flag It will fail differently with:
ERROR: Manifest file c:\Users\ADMINI~1\_BAZEL~1\rgyky3dz\execroot\EXAMPL~1\bazel-out\x64_windows-fastbuild\bin\test.bat.runfiles\examples_jest\test.bat.runfiles_manifest does not exist.
And When I run now the first command without the runfiles flag it will pass bazel run //:test
After a bazel clean The first issue with Can't find a root directory while resolving a config file path. occurs again.
When I run it with verbose logs you can see that in the failing case it uses the module_mappings.json from a different location. This is the only difference I can see with --define=VERBOSE_LOGS=1
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!
Activity
alexeagle commentedon Dec 20, 2019
I suspect you need to copy jest.config.js to the output folder and then reference that copy.
See https://github.com/bazelbuild/rules_nodejs/blob/master/docs/Built-ins.md#copy_to_bin
Socolin commentedon May 14, 2020
Hello
I got the same error, on windows trying to run jest tests.
So I tried to add
copy_to_binas you suggested @alexeagle but after some digging I found that jest is executed inC:\users\$USER\_bazel_$USER\u3lrkeg4\execroot\<workspace-name>\bazel-out\x64_windows-fastbuild\bin\test.bat.runfiles\<workspace-name>which is empty.The directory
C:\users\$USER\_bazel_$USER\u3lrkeg4\execroot\<workspace-name>\bazel-out\x64_windows-fastbuild\bin\seems well populated.I found in the source, there is a comment about Windows
https://github.com/bazelbuild/rules_nodejs/blob/master/examples/jest/BUILD.bazel#L14
So I tried to add this argument and ran
bazel test test --enable_runfiles. Then I get another errorDo you have any hint, about what could go wrong ?
lukasholzer commentedon Sep 4, 2020
@alexeagle When I go the folder
examples/jestin the rules_nodejs (stable branch) and runningbazel run :testit is working fine on macOS and Linux but on windows, it is failing with:I think I found somehow the issue:
If I run
bazel run //:testit will fail with the above errorIf I rerun
bazel run //:test --enable_runfileswith the enable_runfiles flag It will fail differently with:And When I run now the first command without the runfiles flag it will pass
bazel run //:testAfter a
bazel cleanThe first issue withCan't find a root directory while resolving a config file path.occurs again.lukasholzer commentedon Sep 4, 2020
Addition:
When I run it with verbose logs you can see that in the failing case it uses the
module_mappings.jsonfrom a different location. This is the only difference I can see with--define=VERBOSE_LOGS=1Failing:
[link_node_modules.js] manifest file C:/users/administrator/_bazel_administrator/rgyky3dz/execroot/examples_jest/bazel-out/x64_windows-fastbuild/bin/_test.module_mappings.jsonPassing
[link_node_modules.js] manifest file c:/users/admini~1/_bazel~1/rgyky3dz/execroot/exampl~1/bazel-out/x64_windows-fastbuild/bin/test.bat.runfiles/examples_jest/_test.module_mappings.jsonfix(examples): fix jest example on windows
fix(examples): fix jest example on windows
github-actions commentedon Nov 6, 2020
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
github-actions commentedon Nov 20, 2020
This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?"
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
fix(examples): fix jest example on windows
fix: test file pattern (bazel-contrib#2089)