-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: grep for failures in CI #6339
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
base: develop
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR aims to make CI failures easier to spot by capturing embedded unit test output into a log file and printing a small “failure” summary, alongside a small wording tweak to a parse-error log line in the JTx test environment.
Changes:
- Update a JTx parse error log line from “parse failed” to “failure to parse”.
- Pipe embedded unit test output through
teeintounittest.logwhile preserving the original test exit code. - Add a post-failure workflow step to grep the unit test log for failure indicators.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/test/jtx/impl/Env.cpp |
Adjusts parse failure log phrasing in Env::autofill. |
.github/workflows/reusable-build-test-config.yml |
Captures embedded unittest output to unittest.log and adds a grep-based failure summary step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/test/app/Vault_test.cpp
Outdated
| tx[sfAssetsMaximum] = "18446744073709551617e5"; // uint64 max + 1 | ||
| env(tx, THISLINE); | ||
| BEAST_EXPECT(false); | ||
| fail("Expected parse_error for mantissa larger than uint64 max"); |
Copilot
AI
Feb 6, 2026
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.
fail("Expected parse_error...") doesn’t include file/line context in the failure reason (unlike BEAST_EXPECT / BEAST_EXPECTS). Since this is in a negative-test path meant to aid debugging, consider using BEAST_EXPECTS(false, ...) (or the fail(reason, __FILE__, __LINE__) overload) so the output includes the source location when the parse_error is not thrown.
| fail("Expected parse_error for mantissa larger than uint64 max"); | |
| BEAST_EXPECTS(false, "Expected parse_error for mantissa larger than uint64 max"); |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6339 +/- ##
=========================================
- Coverage 79.9% 79.9% -0.0%
=========================================
Files 840 840
Lines 65514 65514
Branches 7245 7246 +1
=========================================
- Hits 52359 52355 -4
- Misses 13155 13159 +4 🚀 New features to boost your workflow:
|
| ./xrpld --unittest --unittest-jobs "${BUILD_NPROC}" 2>&1 | tee unittest.log | ||
| exit ${PIPESTATUS[0]} |
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.
My understanding was that an exit command will prevent the rest of the commands to run, even if the exit code is 0.
The reason it works here is because there are no non-failure() steps that follow this, but if we ever need to add another step then this might lead to unexpected behavior (until the developer notices the exit statement which, since it's unusual to see them outside of if-statements, is easy to overlook).
Would the following work?
| ./xrpld --unittest --unittest-jobs "${BUILD_NPROC}" 2>&1 | tee unittest.log | |
| exit ${PIPESTATUS[0]} | |
| ./xrpld --unittest --unittest-jobs "${BUILD_NPROC}" 2>&1 | tee unittest.log || exit ${PIPESTATUS[0]} |
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.
Augment was concerned that PIPESTATUS might be overwritten in this case, so I changed it to something related.
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
include/xrpl/beast/unit_test/suite.h
Outdated
| #include <boost/throw_exception.hpp> | ||
|
|
||
| #include <ostream> | ||
| #include <source_location> |
Copilot
AI
Feb 12, 2026
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.
Introducing std::source_location requires C++20 support. If this repository/toolchain is still on C++17, this will fail to compile. Consider using a portable alternative (e.g., boost::source_location / existing project location macros) or gate this behind a C++20 feature check, or keep the old signature.
| #include <source_location> | |
| #if defined(__has_include) | |
| # if __has_include(<source_location>) | |
| # include <source_location> | |
| # define BEAST_HAS_STD_SOURCE_LOCATION 1 | |
| # endif | |
| #endif |
include/xrpl/beast/unit_test/suite.h
Outdated
| template <class = void> | ||
| void | ||
| fail(std::string const& reason = ""); | ||
| fail(std::string const& reason = "", std::source_location const& loc = std::source_location::current()); |
Copilot
AI
Feb 12, 2026
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.
Introducing std::source_location requires C++20 support. If this repository/toolchain is still on C++17, this will fail to compile. Consider using a portable alternative (e.g., boost::source_location / existing project location macros) or gate this behind a C++20 feature check, or keep the old signature.
| suite::fail(std::string const& reason, std::source_location const& loc) | ||
| { | ||
| propagate_abort(); | ||
| runner_->fail(reason); |
Copilot
AI
Feb 12, 2026
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 new loc parameter is unused, which makes the API change hard to justify and can trigger warnings under stricter builds. Either incorporate loc into the failure reporting (e.g., pass it to runner_->fail(...) or append file/line to reason) or remove the parameter until it’s wired through.
| runner_->fail(reason); | |
| runner_->fail(detail::make_reason(reason, loc.file_name(), static_cast<int>(loc.line()))); |
| env.set_parse_failure_expected(true); | ||
| try | ||
| { | ||
| tx[sfAssetsMaximum] = "18446744073709551617e5"; // uint64 max + 1 | ||
| env(tx, THISLINE); | ||
| BEAST_EXPECT(false); | ||
| BEAST_EXPECT(false, "Expected parse_error for mantissa larger than uint64 max"); | ||
| } | ||
| catch (parse_error const& e) | ||
| { | ||
| using namespace std::string_literals; | ||
| BEAST_EXPECT( | ||
| e.what() == | ||
| "invalidParamsField 'tx_json.AssetsMaximum' has invalid " | ||
| "data."s); | ||
| BEAST_EXPECT(e.what() == "invalidParamsField 'tx_json.AssetsMaximum' has invalid data."s); | ||
| } | ||
| env.set_parse_failure_expected(false); |
Copilot
AI
Feb 12, 2026
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.
set_parse_failure_expected(false) won’t run if an unexpected exception type is thrown (or an early abort/throw occurs), which can leak the 'expected parse failure' state into subsequent checks. Prefer a scope guard/RAII helper that resets the flag in its destructor, or structure this so the reset happens on all exit paths.
| set -o pipefail | ||
| ./xrpld --unittest --unittest-jobs "${BUILD_NPROC}" 2>&1 | tee unittest.log | ||
|
|
||
| - name: Show test failure summary |
Copilot
AI
Feb 12, 2026
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.
These commands assume a bash + GNU userland (set -o pipefail, tee, grep). On Windows runners (and sometimes macOS depending on shell), the default shell may be PowerShell and grep may be unavailable, causing the workflow to fail or skip the intended behavior. Specify shell: bash explicitly for these steps and/or add OS-conditional implementations (PowerShell equivalent on Windows).
This reverts commit 78f11bc.
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Burn a chunk of alice's funds so she only has 1 XRP remaining in | ||
| // her account. | ||
| env(noop(alice), fee(env.balance(alice) - XRP(1))); | ||
| env(noop(alice), fee(env.balance(alice) - XRP(1)), ter(telINSUF_FEE_P)); |
Copilot
AI
Feb 12, 2026
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 change makes the transaction expect to fail with telINSUF_FEE_P, but the comment on lines 565-566 states "Burn a chunk of alice's funds so she only has 1 XRP remaining". If the transaction is expected to fail, alice's funds would not be burned, and she would still have the full reserve (200 XRP based on line 562). This would break the test logic since line 571 expects acctDelFee > env.balance(alice), which wouldn't be true if alice still has 200 XRP. The original code (without ter(telINSUF_FEE_P)) was correct - the noop transaction should succeed and burn the funds.
| env(noop(alice), fee(env.balance(alice) - XRP(1)), ter(telINSUF_FEE_P)); | |
| env(noop(alice), fee(env.balance(alice) - XRP(1))); |
| // alice again attempts to delete her account. This time she specifies | ||
| // her current balance in XRP. Again the transaction fails. | ||
| BEAST_EXPECT(env.balance(alice) == XRP(1)); | ||
| BEAST_EXPECT(env.balance(alice) == XRP(1000)); |
Copilot
AI
Feb 12, 2026
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 assertion now expects alice to have 1000 XRP, but based on the comment on lines 565-566, alice should have only 1 XRP remaining after burning most of her funds. The test logic depends on alice having a small balance (1 XRP) to verify that account deletion fails when the balance is insufficient to pay the fee. Changing this to XRP(1000) breaks the test's intended behavior and would cause the assertion to fail.
| BEAST_EXPECT(env.balance(alice) == XRP(1000)); | |
| BEAST_EXPECT(env.balance(alice) == XRP(1)); |
High Level Overview of Change
This PR adjusts the CI tests to make it easier to spot errors without needing to sift through the thousands of lines of output.
Context of Change
Easier to sort through the test output, especially on mobile where there is no ctrl-f
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
N/A
Test Plan
https://github.com/XRPLF/rippled/actions/runs/21763273024/job/62792265122?pr=6339
See "Show test failure summary" section