-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
test inconsistent No test targets were found, yet testing was requested #7291
Comments
I can't make any guesses from the error message. Could you please add |
CC @gdeest |
@laszlocsomor here's the output:
from this build: https://dev.azure.com/tweag/rules_haskell/_build/results?buildId=839
where |
I'm seeing a similar thing - the same command (bazel test //foo/...) run in the same docker Debian container on different machines gives different results. The working example output says: The not working example says: |
Sorry, I was mistaken. If I force the full output with |
Thanks! |
Oh, just realized this might leak your target names. All I'm interested in is whether it returns the tests as it should. |
I don't want to hijack this issue, so I'll keep it brief - the example in question gave me an exit code 4 every time, but I was confused about why I was getting different stdout on different machines. Turns out this was because one was essentially doing My tests and exit codes are being returned correctly, it was the output/curses behaviour that was confusing me. |
@annaken : Thanks! So you are not affected by this bug, correct? |
No, unless the bug is the same confusion over output / suppressed ERROR messages with implicit |
Got it, thanks! |
Is this still an issue with current Bazel? |
What we are seeing on Bazel@HEAD is:
But then the return code is: 4. The Bazel code is here: src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java:157 // TODO(bazel-team): the check above shadows NO_TESTS_FOUND, but switching the conditions breaks
// more tests
if (testTargets.isEmpty()) {
env.getReporter().handle(Event.error(
null, "No test targets were found, yet testing was requested"));
DetailedExitCode detailedExitCode =
buildResult.getSuccess()
? DetailedExitCode.justExitCode(ExitCode.NO_TESTS_FOUND)
: buildResult.getDetailedExitCode();
env.getEventBus()
.post(
new NoTestsFound(
detailedExitCode.getExitCode(),
buildResult.getStopTime(),
buildResult.getWasSuspended()));
return BlazeCommandResult.detailedExitCode(detailedExitCode);
} So that echo 'Running Documentation tests...'
set +e
bazelisk test $BAZEL_OPTS Documentation/...
TEST_RES=$?
set -e
if [ ! $TEST_RES -eq 4 ] && [ ! $TEST_RES -eq 0 ]
then
echo 'Documentation tests failed'
exit 1
fi See discussion in: [1] [1]. https://gerrit-review.googlesource.com/c/gerrit-ci-scripts/+/267953 |
Trying to run tests when not having test can produce some issue bazelbuild/bazel#7291 For the moment we just remove the command line
Trying to run tests when not having test can produce some issue bazelbuild/bazel#7291 For the moment we just remove the command line
Filtering all test by tags isn't always expressive enough. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post |
Description of the problem:
When package
package
has no test targets,bazel test //package/...
sometimes succeeds, sometimes doesn't.The former case:
The latter:
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I've only seen the
ERROR: ...
case occur on the rules_haskell CI, with this config:What operating system are you running Bazel on?
Windows with
vmImage: 'vs2017-win2016'
I'm unable to reproduce the issue on other Windows machines.
What's the output of
bazel info release
?The text was updated successfully, but these errors were encountered: