Problem
The core of the system is untested. Of 63 non-test Go files, only 3 packages have tests (pkg/datastore/mysql, pkg/gh, pkg/web). pkg/starter (589 lines) and pkg/runner have zero tests, including the runner-deletion safety valve.
Highest-value, lowest-cost targets (pure functions)
sanitizeRunner / sanitizeRunnerMustRunningTime / sanitizeGitHubRunner (pkg/runner/runner_delete.go:213-241) — these decide whether a runner may be deleted; a bug here can force-delete a runner with a running job.
extractWorkflowIDs (pkg/starter/starter.go:193)
ExtractRunsOnLabels (pkg/gh/webhook.go:35) — called from 4 sites.
labelsToOneLine (pkg/starter/scripts.go:124), ToName/ToUUID/ToReason (pkg/runner/util.go), GetRunnerTemporaryMode (pkg/runner/runner.go:102).
Enabler: revive the unused memory datastore
pkg/datastore/memory/memory.go implements the Datastore interface but is referenced from nowhere (dead code). Using it as a fake would let Starter.ProcessJob (pkg/starter/starter.go:212) be tested without a MySQL container.
Existing test bug to fix along the way
pkg/web/target_test.go:578 uses if strings.EqualFold(test.want, got) — it fails on a match, i.e. the condition is inverted, so the error-response assertion is effectively disabled. Should be !strings.EqualFold(...).
Problem
The core of the system is untested. Of 63 non-test Go files, only 3 packages have tests (
pkg/datastore/mysql,pkg/gh,pkg/web).pkg/starter(589 lines) andpkg/runnerhave zero tests, including the runner-deletion safety valve.Highest-value, lowest-cost targets (pure functions)
sanitizeRunner/sanitizeRunnerMustRunningTime/sanitizeGitHubRunner(pkg/runner/runner_delete.go:213-241) — these decide whether a runner may be deleted; a bug here can force-delete a runner with a running job.extractWorkflowIDs(pkg/starter/starter.go:193)ExtractRunsOnLabels(pkg/gh/webhook.go:35) — called from 4 sites.labelsToOneLine(pkg/starter/scripts.go:124),ToName/ToUUID/ToReason(pkg/runner/util.go),GetRunnerTemporaryMode(pkg/runner/runner.go:102).Enabler: revive the unused memory datastore
pkg/datastore/memory/memory.goimplements theDatastoreinterface but is referenced from nowhere (dead code). Using it as a fake would letStarter.ProcessJob(pkg/starter/starter.go:212) be tested without a MySQL container.Existing test bug to fix along the way
pkg/web/target_test.go:578usesif strings.EqualFold(test.want, got)— it fails on a match, i.e. the condition is inverted, so the error-response assertion is effectively disabled. Should be!strings.EqualFold(...).