Consolidate redundant unit and e2e tests (cbor, http, logger, receipts)#8026
Draft
achamayou wants to merge 10 commits into
Draft
Consolidate redundant unit and e2e tests (cbor, http, logger, receipts)#8026achamayou wants to merge 10 commits into
achamayou wants to merge 10 commits into
Conversation
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
…fact Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
achamayou
commented
Jul 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates several redundant tests across the Python e2e suite and C++ unit tests, aiming to reduce duplicated coverage while keeping the same behavioral checks in fewer places.
Changes:
- Refactors
tests/e2e_logging.pyreceipt testing by folding deterministic “fresh tx” coverage intotest_random_receiptsvia a helper that returns additional seqnos to validate. - Consolidates/streamlines multiple C++ unit tests using
DOCTEST_SUBCASE/SUBCASEpatterns (HTTP header parsing and CBOR helpers). - Moves the JSON logger format test into the existing logger unit test file and removes the standalone
logger_json_testtarget.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e_logging.py | Reworks receipt testing to reuse test_random_receipts with an additional batch of freshly-issued tx seqnos. |
| src/http/test/http_test.cpp | Consolidates parse_want_repr_digest coverage into a single test case with subcases. |
| src/ds/test/logger.cpp | Adds JSON log format validation into existing logger unit tests. |
| src/ds/test/logger_json_test.cpp | Removes the now-redundant standalone JSON logger unit test. |
| src/crypto/test/cbor.cpp | Merges duplicated make_signed tests into one test case with subcases. |
| CMakeLists.txt | Removes the logger_json_test unit-test target. |
| .gitignore | Adds ignore entry for a logger test output file. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
achamayou
commented
Jul 6, 2026
- src/crypto/test/cbor.cpp: parameterize the make_signed test using doctest's DOCTEST_VALUE_PARAMETERIZED_DATA pattern instead of manual SUBCASEs. - src/ds/test/logger.cpp: restore global logger config (loggers and level) at the end of the custom log format test via an RAII guard, to avoid leaking state into other test cases. - tests/e2e_logging.py: wait for the last issued transaction to commit in issue_txs_for_receipt_check before returning, to avoid flaky NOT_FOUND historical receipt lookups for COSE-only builds.
Member
Author
|
Paused on doctest update |
- e2e_logging: assert receipts for known-committed seqnos are actually verified (require_additional_receipts) instead of silently skipping on poll timeout - logger test: use PID-based temp file and clear the logger set for isolation from other test cases in the shared binary - cbor test: clarify make_signed test variable names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates several redundant/duplicated tests across the C++ unit test suite and the Python e2e suite, keeping the same behavioural coverage in fewer, clearer test cases.
Changes
src/crypto/test/cbor.cpp: merges the two separatemake_signedpositive/negative test cases into a single parameterized test, using doctest'sDOCTEST_VALUE_PARAMETERIZED_DATApattern.src/http/test/http_test.cpp: consolidates theparse_want_repr_digesttest cases into a single test with subcases, removing duplicated setup.src/ds/test/logger.cpp/src/ds/test/logger_json_test.cpp: moves the standalone JSON log format test into the existing logger unit test file, removing the now-redundantlogger_json_testbinary/target. The moved test now uses RAII guards to reliably restore global logger configuration (loggers, log level) andstd::cout's redirected buffer, even if aREQUIREfails or an exception is thrown.CMakeLists.txt: removes thelogger_json_testunit-test target (superseded by the above).tests/e2e_logging.py: folds the deterministic "fresh tx" receipt checks fromtest_receiptsintotest_random_receiptsvia a newissue_txs_for_receipt_checkhelper, which issues a batch of transactions and waits for the last one to commit (viainfra.commit.wait_for_commit) before returning their seqnos - avoiding flakyNOT_FOUNDhistorical receipt lookups for not-yet-committed COSE receipts.Testing
cbor_test: 61/61 test cases, 553/553 assertions passing.logger_test: 4/4 test cases, 61/61 assertions passing.tests/e2e_logging.py: syntax/lint-checked (py_compile,ruff); full e2e coverage exercised via existing CI.scripts/ci-checks.sh -f(C++/Python formatting, ASCII, copyright) run clean.