Repository navigation
test: make achievement count fixture independent of the clock - #695
Merged
Merged
Conversation
(cherry picked from commit a74c1aa)
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the complete fixture change and traced the achievement timestamp scan and existing assertions.
- Deterministic timestamp: Sets the old log's
CreatedAtUtcto noon UTC on its fixed date, matching the adjacent helper and removing execution-hour dependence without weakening assertions or changing production code. - Validation: All 42
AchievementProgressServiceTestspassed withdotnet test tests/Orbit.Application.Tests --filter "FullyQualifiedName~AchievementProgressServiceTests" -m:1. The full solution suite was not rerun during this review.
gpt-6.1-sol | 𝕏
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




The achievement count test used a wall-clock creation timestamp for its old log, so its zero early-log assertion failed when the suite ran before 7 AM UTC. Set that timestamp to noon UTC on the fixed log date in
tests/Orbit.Application.Tests/Gamification/AchievementProgressServiceTests.cs.This carries commit
a74c1aa52e2cc0fc151dd0c1d30fb5a38e4f2fd9from orbit-api#694 withgit cherry-pick -x, committed here ascb3250714bc0d4237d05319bb70e875d3e111875. It uses the same timestamp fixture pattern as the adjacent streak helper. Product code and assertions are unchanged. The #746 sync can skip this commit onceredesign/maincarries the same change; #1156 needs no ordering gate.Test evidence
AchievementProgressServiceTests.LoadAsync_WithHabits_MapsEveryCountToItsMetric. The continuation work order records that the previous worker ran the unchanged test before the fix, observed it fail before 7 AM UTC with "Expected metrics.EarlyLogs to be 0, but found 1", then observed 42 focused tests pass after the fix. The exact historical command and red log were not retained for this continuation, so this is the prior worker's reported evidence. The retained green log confirms 42 passed, zero failed. No strengthened assertion was needed: the existing assertion already catches the clock-dependent fixture defect.env -u LANG dotnet build Orbit.slnx: exit 0, zero errors.env -u LANG dotnet test: exit 0, 7,116 passed, zero failed or skipped.env LC_ALL=en_US.UTF-8 dotnet build Orbit.slnx: exit 0, zero errors.env LC_ALL=en_US.UTF-8 dotnet test: exit 0, 7,116 passed, zero failed or skipped.git diff HEAD^ HEAD --checkpasses; the two added lines contain no comments. No DTO, minimum-version, user-date, background-job, or external-interface changes.Closes thomasluizon/orbit-tickets#1156