Skip to content

test: expand helper-module and SSH parsing coverage#6

Merged
UptimeEnforcer merged 2 commits intoBlack-HOST:mainfrom
zeroth-blip:chore/unit-test-coverage-helper-modules
Mar 13, 2026
Merged

test: expand helper-module and SSH parsing coverage#6
UptimeEnforcer merged 2 commits intoBlack-HOST:mainfrom
zeroth-blip:chore/unit-test-coverage-helper-modules

Conversation

@zeroth-blip
Copy link
Contributor

Summary

This PR expands the unit-test suite with focused coverage for helper modules and SSH-related parsing paths.

Added coverage for

  • ConfigServer::GetEthDev
  • ConfigServer::Logger
  • ConfigServer::LookupIP
  • ConfigServer::Service
  • ConfigServer::KillSSH
  • ConfigServer::regexmain

Why this change

These areas are heavy on parsing, environment-dependent behavior, and guard logic, which makes them good candidates for focused regression coverage.

The new tests aim to:

  • lock in current helper-module behavior
  • exercise fallback and failure paths
  • validate SSH log parsing across multiple real-world formats
  • catch regressions earlier with fast unit-level feedback

What is included

  • new unit tests for interface/address discovery and fallback handling
  • logger coverage for file/syslog-oriented behavior
  • lookup/service helper coverage
  • targeted KillSSH behavior coverage
  • deterministic regexmain coverage for SSH failure/accept flows and gating logic

What is not included

  • no production code changes
  • no workflow or smoke-test behavior changes

Validation

Ran locally and passed:

prove -v .github/tests/unit/getethdev.t \
  .github/tests/unit/logger.t \
  .github/tests/unit/lookupip.t \
  .github/tests/unit/service.t \
  .github/tests/unit/killssh.t \
  .github/tests/unit/regexmain.t

Result: PASS

Commits

  • test: expand unit coverage for helper modules
  • test: add killssh and regexmain coverage

@UptimeEnforcer
Copy link
Member

@zeroth-blip I'm merging this.

In checkip.t, a very clean data-driven loop (assert_cases(&checkip, [ ... ])) is used for testing variations of IPs.
It would be really nice if you can generalize this across other scripts.

@UptimeEnforcer UptimeEnforcer merged commit 7d299ce into Black-HOST:main Mar 13, 2026
19 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