Skip to content

Commit 404f35d

Browse files
authored
test: Grep for failures in CI (#6339)
This change adjusts the CI tests to make it easier to spot errors, without needing to sift through the thousands of lines of output.
1 parent 2e595b6 commit 404f35d

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/reusable-build-test-config.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,21 @@ jobs:
229229
env:
230230
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
231231
run: |
232-
./xrpld --unittest --unittest-jobs "${BUILD_NPROC}"
232+
set -o pipefail
233+
./xrpld --unittest --unittest-jobs "${BUILD_NPROC}" 2>&1 | tee unittest.log
233234
235+
- name: Show test failure summary
236+
if: ${{ failure() && !inputs.build_only }}
237+
working-directory: ${{ runner.os == 'Windows' && format('{0}/{1}', env.BUILD_DIR, inputs.build_type) || env.BUILD_DIR }}
238+
run: |
239+
if [ ! -f unittest.log ]; then
240+
echo "unittest.log not found; embedded tests may not have run."
241+
exit 0
242+
fi
243+
244+
if ! grep -E "failed" unittest.log; then
245+
echo "Log present but no failure lines found in unittest.log."
246+
fi
234247
- name: Debug failure (Linux)
235248
if: ${{ failure() && runner.os == 'Linux' && !inputs.build_only }}
236249
run: |

src/test/app/Vault_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5340,20 +5340,20 @@ class Vault_test : public beast::unit_test::suite
53405340
env.close();
53415341

53425342
// 2. Mantissa larger than uint64 max
5343+
env.set_parse_failure_expected(true);
53435344
try
53445345
{
53455346
tx[sfAssetsMaximum] = "18446744073709551617e5"; // uint64 max + 1
53465347
env(tx, THISLINE);
5347-
BEAST_EXPECT(false);
5348+
BEAST_EXPECTS(false, "Expected parse_error for mantissa larger than uint64 max");
53485349
}
53495350
catch (parse_error const& e)
53505351
{
53515352
using namespace std::string_literals;
53525353
BEAST_EXPECT(
5353-
e.what() ==
5354-
"invalidParamsField 'tx_json.AssetsMaximum' has invalid "
5355-
"data."s);
5354+
e.what() == "invalidParamsField 'tx_json.AssetsMaximum' has invalid data."s);
53565355
}
5356+
env.set_parse_failure_expected(false);
53575357
}
53585358
}
53595359

0 commit comments

Comments
 (0)