Skip to content

fix(tests): stop the crypto-earnings tests expiring 30 days after they were written - #357

Merged
GeiserX merged 1 commit into
mainfrom
fix/date-bombed-fx-tests
Sep 2, 2026
Merged

fix(tests): stop the crypto-earnings tests expiring 30 days after they were written#357
GeiserX merged 1 commit into
mainfrom
fix/date-bombed-fx-tests

Conversation

@GeiserX

@GeiserX GeiserX commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Dependabot's #356 could not merge. Its required test check was red and a rerun stayed red, though it only bumps two workflow pins. The failure is on main itself, and it began on 1 September with nothing merged.

tests/test_currency_correctness.py seeded its earnings rows on the fixed dates 1 and 2 August 2026 and then read them back through get_daily_earnings(days=30), which windows on today's date. On 31 August the rows were still inside the window and the file passed. On 1 September they fell out, the control test test_real_new_tokens_are_counted got 0.0 instead of 10.0, and its two siblings that assert 0.0 kept passing without exercising anything.

This dates the rows relative to today, the way test_power.py already does. Nothing under app/ changes, so this does not cut a release. Once it is on main, @dependabot rebase on #356 gets its check green.

Summary by CodeRabbit

  • Tests
    • Updated currency correctness tests to use dates relative to the current UTC date.
    • Improved test reliability by keeping test data within the daily earnings lookback window.

…y were written

The rows in test_currency_correctness.py were pinned to 1 and 2 August
2026 and read back through get_daily_earnings(days=30), which windows on
today. From 1 September the control test got 0.0 instead of 10.0 and main
went red with nothing merged, while its two 0.0 siblings passed vacuously.
Date the rows relative to today, as test_power.py already does.
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 0802f46f-cdda-4273-ab8e-7fb8f2dff600

📥 Commits

Reviewing files that changed from the base of the PR and between 12483c8 and 2709a33.

📒 Files selected for processing (1)
  • tests/test_currency_correctness.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The currency correctness tests now derive seeded row dates from the current UTC date. The tests remain within the 30-day lookback window used by get_daily_earnings.

Changes

Currency correctness tests

Layer / File(s) Summary
Use UTC-relative test dates
tests/test_currency_correctness.py
Adds the _day(n) helper and uses _day(2) and _day(1) in the three seeded-row tests.
Estimated code review effort: 1 (Trivial) ~5 minutes

Merge Risk: ⚪ Minimal · up to 2709a

This test-only change keeps seeded earnings data inside the existing 30-day window without changing application behavior. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the test-only fix and explains that it prevents the crypto-earnings tests from expiring after 30 days. It accurately matches the main change.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/date-bombed-fx-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@GeiserX
GeiserX merged commit 5a76384 into main Sep 2, 2026
8 checks passed
@GeiserX
GeiserX deleted the fix/date-bombed-fx-tests branch September 2, 2026 19:20
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.

1 participant