Skip to content

Conversation

@mvadari
Copy link
Collaborator

@mvadari mvadari commented Feb 6, 2026

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

  • Chore (no impact to binary, e.g. .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

@mvadari mvadari added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Feb 6, 2026
@mvadari mvadari added Trivial Simple change with minimal effect, or already tested. Only needs one approval. and removed DraftRunCI Normally CI does not run on draft PRs. This opts in. labels Feb 6, 2026
@mvadari mvadari marked this pull request as ready for review February 6, 2026 19:52
Copilot AI review requested due to automatic review settings February 6, 2026 19:52
@mvadari mvadari changed the title grep for failures chore: grep for failures in CI Feb 6, 2026
Copy link

Copilot AI left a 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 tee into unittest.log while 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.

Copilot AI review requested due to automatic review settings February 6, 2026 20:11
Copy link

Copilot AI left a 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.

tx[sfAssetsMaximum] = "18446744073709551617e5"; // uint64 max + 1
env(tx, THISLINE);
BEAST_EXPECT(false);
fail("Expected parse_error for mantissa larger than uint64 max");
Copy link

Copilot AI Feb 6, 2026

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.

Suggested change
fail("Expected parse_error for mantissa larger than uint64 max");
BEAST_EXPECTS(false, "Expected parse_error for mantissa larger than uint64 max");

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.9%. Comparing base (e11f619) to head (d4bc64b).

Additional details and impacted files

Impacted file tree graph

@@            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     

see 5 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mvadari mvadari requested a review from bthomee February 9, 2026 18:21
Comment on lines 232 to 233
./xrpld --unittest --unittest-jobs "${BUILD_NPROC}" 2>&1 | tee unittest.log
exit ${PIPESTATUS[0]}
Copy link
Collaborator

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?

Suggested change
./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]}

Copy link
Collaborator Author

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.

Copilot AI review requested due to automatic review settings February 12, 2026 21:59
Copy link

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings February 12, 2026 22:08
Copy link

Copilot AI left a 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 <boost/throw_exception.hpp>

#include <ostream>
#include <source_location>
Copy link

Copilot AI Feb 12, 2026

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.

Suggested change
#include <source_location>
#if defined(__has_include)
# if __has_include(<source_location>)
# include <source_location>
# define BEAST_HAS_STD_SOURCE_LOCATION 1
# endif
#endif

Copilot uses AI. Check for mistakes.
template <class = void>
void
fail(std::string const& reason = "");
fail(std::string const& reason = "", std::source_location const& loc = std::source_location::current());
Copy link

Copilot AI Feb 12, 2026

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.

Copilot uses AI. Check for mistakes.
suite::fail(std::string const& reason, std::source_location const& loc)
{
propagate_abort();
runner_->fail(reason);
Copy link

Copilot AI Feb 12, 2026

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.

Suggested change
runner_->fail(reason);
runner_->fail(detail::make_reason(reason, loc.file_name(), static_cast<int>(loc.line())));

Copilot uses AI. Check for mistakes.
Comment on lines 4976 to 4988
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);
Copy link

Copilot AI Feb 12, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines +232 to +235
set -o pipefail
./xrpld --unittest --unittest-jobs "${BUILD_NPROC}" 2>&1 | tee unittest.log

- name: Show test failure summary
Copy link

Copilot AI Feb 12, 2026

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).

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 12, 2026 22:17
Copy link

Copilot AI left a 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));
Copy link

Copilot AI Feb 12, 2026

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.

Suggested change
env(noop(alice), fee(env.balance(alice) - XRP(1)), ter(telINSUF_FEE_P));
env(noop(alice), fee(env.balance(alice) - XRP(1)));

Copilot uses AI. Check for mistakes.
// 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));
Copy link

Copilot AI Feb 12, 2026

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.

Suggested change
BEAST_EXPECT(env.balance(alice) == XRP(1000));
BEAST_EXPECT(env.balance(alice) == XRP(1));

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Trivial Simple change with minimal effect, or already tested. Only needs one approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants