Skip to content

Add test coverage for CalculateStorageSize and FormatDuration utility functions#5

Merged
AlbinJohns-wk merged 3 commits intotest-ut-workflow-v2from
copilot/sub-pr-4
Dec 12, 2025
Merged

Add test coverage for CalculateStorageSize and FormatDuration utility functions#5
AlbinJohns-wk merged 3 commits intotest-ut-workflow-v2from
copilot/sub-pr-4

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 12, 2025

  • Analyze the repository and recent commits
  • Identify newly added functions (CalculateStorageSize and FormatDuration)
  • Check current test coverage (both at 0%)
  • Create comprehensive test cases for CalculateStorageSize
  • Create comprehensive test cases for FormatDuration
  • Verify all tests pass
  • Confirm coverage >90% for newly added functions
  • Verify overall package coverage improvement
  • Remove *.out from .gitignore as coverage files are temporary

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…unctions

- Added TestCalculateStorageSize with 17 test cases covering:
  - Valid sizes with binary units (Gi, Mi, Ti, Ki)
  - Valid sizes with decimal units (G, M, T, k)
  - Various edge cases (zero, single byte, etc.)
  - Error cases (empty string, invalid formats, negative values)
- Added TestFormatDuration with 26 test cases covering:
  - Milliseconds formatting
  - Seconds only formatting
  - Minutes only formatting
  - Minutes and seconds formatting
  - Hours only formatting
  - Hours and minutes formatting
  - Large durations
- Achieved >90% coverage for both functions:
  - CalculateStorageSize: 90.9%
  - FormatDuration: 100.0%
- Overall package coverage increased from 74.8% to 96.4%

Co-authored-by: AlbinJohns-wk <220135713+AlbinJohns-wk@users.noreply.github.com>
Copilot AI changed the title [WIP] Test UT workflow v2 for code changes Add test coverage for CalculateStorageSize and FormatDuration utility functions Dec 12, 2025
Copilot AI requested a review from AlbinJohns-wk December 12, 2025 13:40
@AlbinJohns-wk
Copy link
Copy Markdown
Owner

@copilot instead of adding comment on the gitignore just delete the coverage files and don't commit them manually

The coverage files were temporary and shouldn't be tracked. Removed the gitignore entry as requested.

Co-authored-by: AlbinJohns-wk <220135713+AlbinJohns-wk@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Dec 12, 2025

@copilot instead of adding comment on the gitignore just delete the coverage files and don't commit them manually

Removed the *.out entry from .gitignore. The coverage files were temporary and are no longer present in the repository. Commit: 5db03fe

@AlbinJohns-wk AlbinJohns-wk marked this pull request as ready for review December 12, 2025 13:47
@AlbinJohns-wk AlbinJohns-wk merged commit 3b7ce6a into test-ut-workflow-v2 Dec 12, 2025
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.

2 participants