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
DEBUG: Rule '_main~_repo_rules~bazel_bats' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1698393980 +0000"
DEBUG: Repository _main~_repo_rules~bazel_bats instantiated at:
<builtin>: in<toplevel>
Repository rule git_repository defined at:
/private/var/tmp/_bazel_nyap/7eb50fa838052a8fa44693f01a28f8d0/external/bazel_tools/tools/build_defs/repo/git.bzl:189:33: in<toplevel>
ERROR: no such package '@@[unknown repo 'bats_core' requested from @@_main~_repo_rules~bazel_bats]//': The repository '@@[unknown repo 'bats_core' requested from @@_main~_repo_rules~bazel_bats]' could not be resolved: No repository visible as '@bats_core' from repository '@@_main~_repo_rules~bazel_bats'
ERROR: /Users/nyap/tasks/bash-mock/BUILD.bazel:8:10: every rule of type _bats_test implicitly depends upon the target '@@[unknown repo 'bats_core' requested from @@_main~_repo_rules~bazel_bats]//:bats', but this target could not be found because of: no such package '@@[unknown repo 'bats_core' requested from @@_main~_repo_rules~bazel_bats]//': The repository '@@[unknown repo 'bats_core' requested from @@_main~_repo_rules~bazel_bats]' could not be resolved: No repository visible as '@bats_core' from repository '@@_main~_repo_rules~bazel_bats'
ERROR: Analysis of target '//:bats_test' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.748s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: No test targets were found, yet testing was requested
Can README.md include instructions using MODULE.bazel?
The text was updated successfully, but these errors were encountered:
Hello. It's not going to work with modules, since that requires all the sub-repos to be modules as well; or a special extension setup which I think is not worth the effort.
Not sure what your use case is, but after having quite a blast with trying to migrate some of my repos to modules I've concluded that it's too early to do so. It is OK to use both WORKSPACE and MODULE, and for the time being I'd recommend using bazel-bats through WORKSPACE only.
But if you have a firm requirement to use this code through MODULE, may I suggest contributing a fix?
It looks like https://docs.aspect.build/rulesets/aspect_bazel_lib/docs/bats/ has a different implementation of bats_test (it doesn't have a deps setting; instead what would go into deps needs to be part of data) and that rule can be used via bzlmod
MODULE.bazel
has:When I run
bazel test ...
, it errors with:Can
README.md
include instructions usingMODULE.bazel
?The text was updated successfully, but these errors were encountered: