-
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
Throw explicit exception if experimental_split_coverage_postprocessing is used without experimental_fetch_all_coverage_outputs #16140
Conversation
2b2d3e1
to
cb69580
Compare
Hello @blindpirate, Can you please check build failures. Thank you! |
@sgowroji The failure seems to be because CI machine is disconnected from Internet, can you give me some hints how to handle external dependencies which need to be downloaded in integration tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hello @oquenchil, Could you please guide on the above buildkite check failures. Thanks! |
Adding @c-mita |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test setup can be greatly simplified; it should be unnecessary to pull in the rules_cc
stuff.
#include "hello-greet.h" | ||
|
||
TEST(HelloTest, GetGreet) { | ||
EXPECT_EQ(get_greet("Bazel"), "Hello Bazel"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could just be return 0;
or something - the actual test result doesn't matter, and we don't want to try pulling in gtest.
@@ -111,13 +111,10 @@ public TestRunnerSpawn createTestRunnerSpawn( | |||
throws ExecException, InterruptedException { | |||
if (action.getExecutionSettings().getInputManifest() == null) { | |||
String errorMessage = "cannot run local tests with --nobuild_runfile_manifests"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this now unused local variable.
cat << EOF > hello-greet.h | ||
#ifndef LIB_HELLO_GREET_H_ | ||
#define LIB_HELLO_GREET_H_ | ||
|
||
#include <string> | ||
|
||
std::string get_greet(const std::string &thing); | ||
|
||
#endif | ||
EOF | ||
|
||
cat << EOF > hello-greet.cc | ||
#include <string> | ||
|
||
std::string get_greet(const std::string& who) { | ||
return "Hello " + who; | ||
} | ||
EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you actually want a file under test, there's no need to make it complicated; a simple int foo() { return 42; }
is more than sufficient here; we really don't care about the coverage reports, only that the flag combination raises an error,
cb69580
to
bd105cb
Compare
…g is used without experimental_fetch_all_coverage_outputs This closes bazelbuild#13185 According to bazelbuild@a445cda, The flag --experimental_split_coverage_postprocessing depends on the flag --experimental_fetch_all_coverage_outputs being enabled, but if the former one is set without the latter one, Bazel throws a quite confusing NullPointerException. Now we throw an explicit exception with proper error message.
bd105cb
to
73a8d6c
Compare
Hi @sgowroji @oquenchil @c-mita now it's all green, PTAL! |
Thank you @blindpirate ! |
…g is used without experimental_fetch_all_coverage_outputs This closes bazelbuild#13185 According to bazelbuild@e411fa7, The flag --experimental_split_coverage_postprocessing depends on the flag --experimental_fetch_all_coverage_outputs being enabled, but if the former one is set without the latter one, Bazel throws a quite confusing NullPointerException. Now we throw an explicit exception with proper error message. Closes bazelbuild#16140. PiperOrigin-RevId: 479239693 Change-Id: I5afa0ae14a3f34a0a7b21fbf4badad3d1836da95
This closes #13185
According to e411fa7,
The flag --experimental_split_coverage_postprocessing depends on the flag
--experimental_fetch_all_coverage_outputs being enabled, but if the former one
is set without the latter one, Bazel throws a quite confusing NullPointerException.
Now we throw an explicit exception with proper error message.