Fix outputted command for usage of update_failure_list.py

PiperOrigin-RevId: 654738180
pull/17501/head
Protobuf Team Bot 7 months ago committed by Copybara-Service
parent 0a917b95f2
commit d0395408aa
  1. 5
      conformance/BUILD.bazel
  2. 54
      conformance/conformance_test.cc
  3. 2
      python/google/protobuf/internal/api_implementation.cc
  4. 2
      src/google/protobuf/compiler/python/pyi_generator.cc
  5. 2
      upb/wire/eps_copy_input_stream_test.cc

@ -304,6 +304,11 @@ py_binary(
],
)
py_binary(
name = "update_failure_list",
srcs = ["update_failure_list.py"],
)
inline_sh_binary(
name = "conformance_php",
testonly = 1,

@ -70,9 +70,6 @@ bool CheckSetEmpty(const SetT& set_to_check, absl::string_view write_to_file,
absl::string_view filename = write_to_file;
if (!output_dir.empty()) {
full_filename = std::string(output_dir);
if (*output_dir.rbegin() != '/') {
full_filename.push_back('/');
}
absl::StrAppend(&full_filename, write_to_file);
filename = full_filename;
}
@ -82,7 +79,9 @@ bool CheckSetEmpty(const SetT& set_to_check, absl::string_view write_to_file,
os << v << "\n";
}
} else {
absl::StrAppendFormat(output, "Failed to open file: %s\n", filename);
absl::StrAppendFormat(output,
"Failed to open file: %s\n",
filename);
}
}
@ -468,37 +467,48 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
}
RunSuiteImpl();
if (*output_dir_.rbegin() != '/') {
output_dir_.push_back('/');
}
bool ok = true;
if (!CheckSetEmpty(
expected_to_fail_, "nonexistent_tests.txt",
absl::StrCat("These tests were listed in the failure list, but they "
"don't exist. Remove them from the failure list by "
"running:\n"
" ./update_failure_list.py ",
failure_list_filename_,
" --remove nonexistent_tests.txt"),
absl::StrCat(
"These tests were listed in the failure list, but they "
"don't exist. Remove them from the failure list by "
"running from the root of your workspace:\n"
" bazel run "
"//google/protobuf/conformance:update_failure_list -- ",
failure_list_filename_, " --remove ", output_dir_,
"nonexistent_tests.txt"),
output_dir_, &output_)) {
ok = false;
}
if (!CheckSetEmpty(
unexpected_failing_tests_, "failing_tests.txt",
absl::StrCat("These tests failed. If they can't be fixed right now, "
"you can add them to the failure list so the overall "
"suite can succeed. Add them to the failure list by "
"running:\n"
" ./update_failure_list.py ",
failure_list_filename_, " --add failing_tests.txt"),
absl::StrCat(
"These tests failed. If they can't be fixed right now, "
"you can add them to the failure list so the overall "
"suite can succeed. Add them to the failure list by "
"running from the root of your workspace:\n"
" bazel run "
"//google/protobuf/conformance:update_failure_list -- ",
failure_list_filename_, " --add ", output_dir_,
"failing_tests.txt"),
output_dir_, &output_)) {
ok = false;
}
if (!CheckSetEmpty(
unexpected_succeeding_tests_, "succeeding_tests.txt",
absl::StrCat("These tests succeeded, even though they were listed in "
"the failure list. Remove them from the failure list "
"by running:\n"
" ./update_failure_list.py ",
failure_list_filename_,
" --remove succeeding_tests.txt"),
absl::StrCat(
"These tests succeeded, even though they were listed in "
"the failure list. Remove them from the failure list by running "
"from the root of your workspace:\n"
" bazel run "
"//google/protobuf/conformance:update_failure_list -- ",
failure_list_filename_, " --remove ", output_dir_,
"succeeding_tests.txt"),
output_dir_, &output_)) {
ok = false;
}

@ -51,7 +51,7 @@ static const char kModuleDocstring[] =
"\n"
"It complements api_implementation.py by setting defaults using compile-time\n"
"constants defined in C, such that one can set defaults at compilation\n"
"(e.g. with blaze flag --copt=-DPYTHON_PROTO2_CPP_IMPL_V2).";
"(e.g. with bazel flag --copt=-DPYTHON_PROTO2_CPP_IMPL_V2).";
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef _module = {

@ -567,7 +567,7 @@ bool PyiGenerator::Generate(const FileDescriptor* file,
import_map_.clear();
// Calculate file name.
file_ = file;
// In google3, devtools/python/blaze/pytype/pytype_impl.bzl uses --pyi_out to
// In google3, devtools/python/bazel/pytype/pytype_impl.bzl uses --pyi_out to
// directly set the output file name.
std::vector<std::pair<std::string, std::string> > options;
ParseGeneratorParameter(parameter, &options);

@ -281,7 +281,7 @@ TEST(EpsCopyInputStreamTest, ZeroSize) {
// }
//
// // Test with:
// // $ blaze run --config=fuzztest third_party/upb:eps_copy_input_stream_test \
// // $ bazel run --config=fuzztest third_party/upb:eps_copy_input_stream_test \
// // -- --gunit_fuzz=
// FUZZ_TEST(EpsCopyFuzzTest, TestAgainstFakeStream)
// .WithDomains(ArbitraryEpsCopyTestScript());

Loading…
Cancel
Save