diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-07-02 22:45:59 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-07-02 22:45:59 +0100 |
| commit | 409e41d1d97b180233be778a2d23ba0b4328b5c2 (patch) | |
| tree | d8f0572b631ead78d4f0046c79b2596341aa37c7 | |
| parent | fbb5038105e26e07d34184544ea4c70892acef92 (diff) | |
| download | webstat-409e41d1d97b180233be778a2d23ba0b4328b5c2.tar.bz2 webstat-409e41d1d97b180233be778a2d23ba0b4328b5c2.tar.xz webstat-409e41d1d97b180233be778a2d23ba0b4328b5c2.zip | |
Replace use of CAUSEPARSEFAIL in sample strings
Use of that as a http_verb doesn't actually cause parse failure (whether
it should or not is another matter)
So it's replaced with CAUSEINSERTFAIL in one case (it does cause this)
and in the parse failure test the whole line is ripped out.
| -rw-r--r-- | test/test-ingest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test-ingest.cpp b/test/test-ingest.cpp index 7aa099e..b2e1e3e 100644 --- a/test/test-ingest.cpp +++ b/test/test-ingest.cpp @@ -409,10 +409,10 @@ BOOST_AUTO_TEST_CASE(ParkLogLine) BOOST_AUTO_TEST_CASE(ParkLogLineOnError, *boost::unit_test::depends_on("I/ParkLogLine")) { BOOST_REQUIRE(existingEntities->empty()); - constexpr std::string_view LOGLINE_BAD_VERB - = R"LOG(git.randomdan.homeip.net 98.82.40.168 1755561576768318 CAUSEPARSEFAIL "/repo/gentoobrowse-api/commit/gentoobrowse-api/unittests/fixtures/756569aa764177340726dd3d40b41d89b11b20c7/app-crypt/pdfcrack/Manifest" "?h=gentoobrowse-api-0.9.1&id=a2ed3fd30333721accd4b697bfcb6cc4165c7714" HTTP/1.1 200 1884 107791 "-" "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Amazonbot/0.1; +https://developer.amazon.com/support/amazonbot) Chrome/119.0.6045.214 Safari/537.36")LOG"; - BOOST_REQUIRE_NO_THROW(ingestLogLines(dbpool->get().get(), {std::string {LOGLINE_BAD_VERB}})); + constexpr std::string_view UNPARSABLE_LINE = "UNPARSABLE"; + BOOST_REQUIRE_NO_THROW(ingestLogLines(dbpool->get().get(), {std::string {UNPARSABLE_LINE}})); BOOST_CHECK_EQUAL(stats.linesParseFailed, 1); + BOOST_CHECK(existingEntities->empty()); } BOOST_AUTO_TEST_CASE(IngestParked, *boost::unit_test::depends_on("I/ParkLogLine")) @@ -562,7 +562,7 @@ BOOST_AUTO_TEST_CASE(RetryUninsertableStillUninsertable) { auto dbconn = dbpool->get(); constexpr std::string_view LOGLINE_UNINSERTABLE - = R"LOG(git.randomdan.homeip.net 98.82.40.168 1755561576768318 CAUSEPARSEFAIL "/repo/gentoobrowse-api/commit/gentoobrowse-api/unittests/fixtures/756569aa764177340726dd3d40b41d89b11b20c7/app-crypt/pdfcrack/Manifest" "?h=gentoobrowse-api-0.9.1&id=a2ed3fd30333721accd4b697bfcb6cc4165c7714" HTTP/1.1 200 1884 107791 "-" "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Amazonbot/0.1; +https://developer.amazon.com/support/amazonbot) Chrome/119.0.6045.214 Safari/537.36" "text/plain")LOG"; + = R"LOG(git.randomdan.homeip.net 98.82.40.168 1755561576768318 CAUSEINSERTFAIL "/repo/gentoobrowse-api/commit/gentoobrowse-api/unittests/fixtures/756569aa764177340726dd3d40b41d89b11b20c7/app-crypt/pdfcrack/Manifest" "?h=gentoobrowse-api-0.9.1&id=a2ed3fd30333721accd4b697bfcb6cc4165c7714" HTTP/1.1 200 1884 107791 "-" "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Amazonbot/0.1; +https://developer.amazon.com/support/amazonbot) Chrome/119.0.6045.214 Safari/537.36" "text/plain")LOG"; Entity uninsertable {{}, {}, EntityType::UninsertableLine, LOGLINE_UNINSERTABLE}; storeNewEntity(dbconn.get(), uninsertable); BOOST_REQUIRE(uninsertable.id); |
