Skip to content

Test/reporting topn deterministic ordering#794

Merged
Baskarayelu merged 2 commits into
Remitwise-Org:mainfrom
happyboy24:test/reporting-topn-deterministic-ordering
Jun 19, 2026
Merged

Test/reporting topn deterministic ordering#794
Baskarayelu merged 2 commits into
Remitwise-Org:mainfrom
happyboy24:test/reporting-topn-deterministic-ordering

Conversation

@happyboy24

Copy link
Copy Markdown
Contributor

Deterministic Top-N ordering is implemented and documented.

Changes made:

reporting/src/lib.rs
get_top_bills_report: deterministic order = amount desc, tie-break id asc.
get_top_savings_report: deterministic order = target_amount desc, tie-break id asc.
Fixed a mis-indentation issue that could nest TopNBillsReport under a previous item.
docs/top-n-report-ordering.md
Documents the Top-N sorting + tie-break contract and cap/partial semantics.
reporting/src/tests.rs
Added mocks BillsTieAllEqual and SavingsTieAllEqual plus tests:
test_top_n_reports_tie_break_is_deterministic_bills
test_top_n_reports_tie_break_is_deterministic_savings
These assert deterministic ordering across repeated calls and correct tie-break when all amounts/targets are equal.
closes #761

@Baskarayelu

Copy link
Copy Markdown
Contributor

deterministic ordering + tie-break for the top-N reports removes a real source of flaky output. merging 👍

@Baskarayelu Baskarayelu merged commit 6af9567 into Remitwise-Org:main Jun 19, 2026
4 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reporting: add deterministic ordering and tie-break tests for get_top_bills_report and get_top_savings_report

2 participants