test: Add structural tests, CI, and Codecov coverage (with make build fixes) - #2
Merged
Merged
Conversation
Saggre
force-pushed
the
feature/fix-makefile-build-and-test
branch
from
August 7, 2026 16:15
a41bd54 to
af985bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds professional structural tests, CI, and coverage reporting, and fixes the broken
maketargets found while getting the tool to run.Tests
Structural unit tests (Go
testing, standard library only, table-driven with subtests) for the parser's core, build/arch-specific logic:readelf: ELF segment lookup, virtual-address math, little-endian encoding.parser: thesshkeystruct offset parsing that recovers the shielded blob and 16 KB prekey, including invalid-prekey-length, out-of-range-pointer, and truncated-buffer edge cases, plus byte-search and integer reads.The functions under test are at 100% statement coverage; the end-to-end test (
make test) covers the real recovery path against a generatedssh-agentcore dump.CI and coverage
.github/workflows/ci.yml: aunitjob runs the tests with the race detector and coverage on every push and pull request and uploads to Codecov; anintegrationjob runs the end-to-end test.codecov/codecov-action@v5), no disposable branch or self-hosted badge JSON.codecov.ymlmarks coverage informational so it never fails CI.Makefile fixes
make buildno longer starts with a host-sidego buildat the repo root (nogo.modthere); it builds the container images, so no host Go toolchain is needed.make testno longer points at a non-existent./test-dump-generator/dump.sh.make test-unit,make test-cover, andmake test-all.README and LICENSE
This branch also carries the full
README.md(with badges and a Testing section) and the MITLICENSE, which originated in the separate README PR (#1). Since that content is included and current here, #1 can be closed as superseded once this merges.One-time Codecov setup
Codecov needs the repo activated once at https://app.codecov.io (sign in with GitHub), then add a
CODECOV_TOKENrepository secret. When the repo is made public, uploads become tokenless and the badge is public with no token in the URL.Testing done
Verified locally on x86_64 Linux with Docker 29.6.1:
go test -race -covermode=atomic ./...(ingolang:1.23): all tests pass,go vetclean, coverage profile generated.make testend-to-end: recovered key byte-identical to the original (matching SSH fingerprint).make build: builds both images with no host Go.actionlint(clean);codecov.ymlYAML validated.