Skip to content

test: edge cases for MetricsParse (meminfo, loadavg, package names) - #22

Merged
wized2 merged 1 commit into
wized2:betafrom
nextammy:tests/17-metricsparse-edge-cases
Nov 14, 2026
Merged

wized2 merged 1 commit into
wized2:betafrom
nextammy:tests/17-metricsparse-edge-cases

Conversation

@nextammy

Copy link
Copy Markdown

Summary

Adds edge case tests for MetricsParse from #17, plus the small pure isValidPackageName check the issue describes, which did not exist yet. No other production code changed.

  • parseMeminfoKb: missing MemAvailable, zero MemTotal, extra whitespace
  • parseLoadavg: fewer than 3 fields, non-numeric fields, blank input
  • isValidPackageName: accepts com.example.app, rejects foo, "a b", "a;b.c", "x.y$(id)", empty, and 256+ chars

Closes #17

How tested

The full SystemMetricsParseTest class was compiled with kotlinc 2.0.21 and run under JUnit 4.13.2: 22 tests pass, 0 fail (14 existing + 8 new). Note: ./gradlew testStableDebugUnitTest could not run in this sandbox because the Gradle daemon socket fails there, so the Gradle run itself was not done. CI should run it.

Target branch

  • beta (default, new work)
  • main (stable hotfix only, explain why)

Type

  • Bug fix
  • Feature
  • Docs
  • Tests

Checklist

  • Branched from / PR targets beta unless this is a stable hotfix
  • ./gradlew testStableDebugUnitTest considered (see How tested: Gradle daemon cannot run in this sandbox, verified with kotlinc + JUnit directly)
  • No trackers / unnecessary INTERNET
  • User-facing strings externalized when practical

Adds tests for parseMeminfoKb with a missing MemAvailable line, a
zero MemTotal, and extra whitespace, plus parseLoadavg with fewer
than three fields, non-numeric fields, and blank input.

Adds the small pure isValidPackageName check the issue describes
(it did not exist yet) with tests for the accept and reject cases.

Closes wized2#17
@vercel

vercel Bot commented Nov 13, 2026

Copy link
Copy Markdown

@nextammy is attempting to deploy a commit to the wized1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@wized2 wized2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nextammy, this is a clean first PR. The tests are clear and cover every case in the issue, CI is green, and adding the small isValidPackageName helper was the right call since it did not exist yet. Edge cases beyond the list (1com.example, com..example) are a nice touch. Approved.

@wized2
wized2 merged commit c6200ec into wized2:beta Nov 14, 2026
1 of 2 checks passed
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