Skip to content

pkg/age: add unit tests for GetAge - #1715

Open
magic-peach wants to merge 1 commit into
dapr:masterfrom
magic-peach:test/age-helper-coverage
Open

magic-peach wants to merge 1 commit into
dapr:masterfrom
magic-peach:test/age-helper-coverage

Conversation

@magic-peach

Copy link
Copy Markdown
Contributor

Description

Adds unit tests for GetAge, the age-formatting helper used in dapr list output. Covers all four unit boundaries it formats: seconds, minutes, hours, and days. This function had no prior test coverage. The test values are chosen safely under each boundary (59s, 59m, 23h) rather than exact boundary values, since GetAge uses time.Since internally and an exact boundary value can flip to the next unit depending on real elapsed wall clock time during the test run.

Issue reference

No existing issue tracks this, found while looking for untested helper functions in pkg.

Checklist

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
@magic-peach
magic-peach requested review from a team as code owners October 13, 2026 19:39
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