Skip to content

Round durations and sizes before picking the unit (tester-army/e2e#2096) - #2189

Merged
kblok merged 1 commit into
mainfrom
fix/2173-round-before-unit
Nov 23, 2026
Merged

kblok merged 1 commit into
mainfrom
fix/2173-round-before-unit

Conversation

@kblok

@kblok kblok commented Nov 23, 2026

Copy link
Copy Markdown
Member

What

Durations and sizes are rounded before the unit is picked, so 999.6 ms reads 1.0s (not 1000ms), 9999.6 ms in --debug reads 10.0s, 59.96 s reads 1m 0s, and a cache size just under 1 MiB reads 1.0 MiB (not 1024.0 KiB).

Closes #2173

Upstream parity

Verdict: full port of the applicable parts of e2e-inc/e2e@634d060 (#2096).

  • debug.ts formatMs -> DebugTrace.FormatMs
  • markdown-text.ts formatDuration -> MarkdownText.FormatDuration
  • cli/format-bytes.ts formatBytes extracted from cache.ts -> src/E2E.Cli/FormatBytes.cs (FormatBytes.Format; the class cannot share its method's name in C#, a .NET-only naming concern), used by CacheCommand

Upstream tests

Upstream Port
debug.test.ts formatMs tests/E2E.Tests/Debug/FormatMsTests.cs
cli-cache-bytes.test.ts formatBytes tests/E2E.Cli.Tests/CliCacheBytes/FormatBytesTests.cs
markdown-duration.test.ts formatDuration tests/E2E.Tests/MarkdownDuration/FormatDurationTests.cs

The three pass. Other tests in E2E.Tests that launch Chromium fail in this sandbox (unrelated).

Not ported

  • html-reporter formatSize and bench-ab markdown.ts: no counterpart in the port (named in the issue for html-reporter; bench-ab is an upstream script). No docs change: no public API or documented behavior changed.

Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2b958f8 and dac49cc.

Files selected for processing: 7

  • src/E2E.Cli/CacheCommand.cs
  • src/E2E.Cli/FormatBytes.cs
  • src/E2E/Internal/DebugTrace.cs
  • src/E2E/Report/MarkdownText.cs
  • tests/E2E.Cli.Tests/CliCacheBytes/FormatBytesTests.cs
  • tests/E2E.Tests/Debug/FormatMsTests.cs
  • tests/E2E.Tests/MarkdownDuration/FormatDurationTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@kblok
kblok merged commit 9abdcda into main Nov 23, 2026
5 checks passed
@kblok
kblok deleted the fix/2173-round-before-unit branch November 23, 2026 17:21
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.

Upstream: round durations and sizes before picking the unit (tester-army/e2e#2096)

2 participants