Skip to content

Fix time-dependent test failure in playtime report test#3020

Merged
jonathangreen merged 1 commit intomainfrom
bugfix/playtime-report-test-year
Feb 2, 2026
Merged

Fix time-dependent test failure in playtime report test#3020
jonathangreen merged 1 commit intomainfrom
bugfix/playtime-report-test-year

Conversation

@jonathangreen
Copy link
Member

@jonathangreen jonathangreen commented Feb 2, 2026

Description

Replace hardcoded year '2025' with dynamically computed year based on the reporting period start date in the test_generate_playtime_reports test.

Motivation and Context

This test started failing in CI on 2026-02-01 because it had the year '2025' hardcoded in the expected folder structure assertions.

The test uses previous_months(number_of_months=1) to calculate the reporting period, which returns the start of the previous month:

  • In January 2026: Previous month = December 2025 → year = 2025 → test passed
  • In February 2026: Previous month = January 2026 → year = 2026 → test failed

How Has This Been Tested?

  • Ran the specific test locally and verified it passes:
    tox -e py312-docker -- --no-cov tests/manager/celery/tasks/test_playtime_entries.py::TestGeneratePlaytimeReport::test_generate_playtime_reports
    

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

Replace hardcoded year '2025' with dynamically computed year based
on the reporting period start date. This prevents the test from
failing when the calendar year changes.
@jonathangreen jonathangreen added the bug Something isn't working label Feb 2, 2026
@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.01%. Comparing base (45dfce6) to head (8097149).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3020      +/-   ##
==========================================
- Coverage   93.02%   93.01%   -0.02%     
==========================================
  Files         481      481              
  Lines       43564    43607      +43     
  Branches     6055     6058       +3     
==========================================
+ Hits        40526    40561      +35     
- Misses       1965     1969       +4     
- Partials     1073     1077       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@jonathangreen jonathangreen merged commit 91a5fe4 into main Feb 2, 2026
19 checks passed
@jonathangreen jonathangreen deleted the bugfix/playtime-report-test-year branch February 2, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants