-
Notifications
You must be signed in to change notification settings - Fork 14
binary.sh.tpl doesn't check that arguments are passed when used as a test #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@JasonLunn This makes sense, would you mind opening a PR for this? We'll also need to do the same in |
Will do. On the subject of how I got here, it appears that the reason I don't get any args to For argument's sake, let's say my test rules reads like this:
My casual reading of https://github.com/bazel-contrib/rules_ruby/blob/main/docs/rules.md#rb_test had left me with the impression that Maybe the examples could be extended to demonstrate how minitest users (and anyone that is used to executing their tests without an explicit Ruby binary) should construct their test rules. |
I haven't thought about this scenario and now I think the code should be changed so that if both
Maybe @noahkawasakigoogle was running into a similar issue in #223. His proposal for |
Additional details discussed in bazel-contrib/rules_ruby#233 and bazel-contrib/rules_ruby#223 Restoring tests revealed latent bug in JRuby's `RubyMessage#convert` that was exposed by the introduction `test_to_hash` while tests were not running; fix included. Closes #21733 COPYBARA_INTEGRATE_REVIEW=#21733 from protocolbuffers:fix_rb_test 3f8418f PiperOrigin-RevId: 758470283
Additional details discussed in bazel-contrib/rules_ruby#233 and bazel-contrib/rules_ruby#223 Restoring tests revealed latent bug in JRuby's `RubyMessage#convert` that was exposed by the introduction `test_to_hash` while tests were not running; fix included. Closes #21733 COPYBARA_INTEGRATE_REVIEW=#21733 from protocolbuffers:fix_rb_test 3f8418f PiperOrigin-RevId: 758470283
) Additional details discussed in bazel-contrib/rules_ruby#233 and bazel-contrib/rules_ruby#223 Restoring tests revealed latent bug in JRuby's `RubyMessage#convert` that was exposed by the introduction `test_to_hash` while tests were not running; fix included. Closes protocolbuffers#21733 COPYBARA_INTEGRATE_REVIEW=protocolbuffers#21733 from protocolbuffers:fix_rb_test 3f8418f PiperOrigin-RevId: 758470283
It is possible to end up in a situation where an
rb_test
rule produces a shell script frombinary.sh.tpl
that never receives arguments. In this case, executing the rule results in a false negative - in other words,bazel test
will pass even though the Ruby test has never been executed because the only thing that runs isbundle exec ruby
which returns successfully.I'm still trying to determine what I've done in my local setup to misconfigure the
rb_test
in this way, but having defense in depth could help others avoid losing the same time that I have tracking this down.Something like:
This approach would rely on
TEST_BINARY
(set bytest-setup.sh
) to be present so that the check for missing arguments doesn't apply to vanillarb_binary
rules.WDYT, @p0deje ?
The text was updated successfully, but these errors were encountered: