cleanup tests that are now useless (#31098)

* disable that onoe

* e2e tests catch this

* rm more useless checks
old-commit-hash: 78e20cff3906ee76c356e8bdef920397e60389b4
This commit is contained in:
Adeeb Shihadeh
2024-01-21 14:49:57 -08:00
committed by GitHub
parent 13896fad3d
commit 5e9dc2c415
4 changed files with 3 additions and 37 deletions
+1 -13
View File
@@ -109,7 +109,7 @@ TEST_CASE("Parser::cmdline") {
test_cmdline(std::string("a\0b\0c\0\0\0", 9), {"a", "b", "c"});
}
TEST_CASE("buildProcLogerMessage") {
TEST_CASE("buildProcLoggerMessage") {
MessageBuilder msg;
buildProcLogMessage(msg);
@@ -137,18 +137,6 @@ TEST_CASE("buildProcLogerMessage") {
REQUIRE(p.getState() == 'R');
REQUIRE_THAT(p.getExe().cStr(), Catch::Matchers::Contains("test_proclog"));
REQUIRE_THAT(p.getCmdline()[0], Catch::Matchers::Contains("test_proclog"));
} else {
std::string cmd_path = "/proc/" + std::to_string(p.getPid()) + "/cmdline";
if (util::file_exists(cmd_path)) {
std::ifstream stream(cmd_path);
auto cmdline = Parser::cmdline(stream);
REQUIRE(cmdline.size() == p.getCmdline().size());
for (int i = 0; i < p.getCmdline().size(); ++i) {
// do not check the cmdline of pytest as it will change.
if (cmdline[i].find("[pytest") || std::string(p.getCmdline()[i]).find("[pytest")) continue;
REQUIRE(cmdline[i] == p.getCmdline()[i].cStr());
}
}
}
}
}