Skip to content

Add tests, test-gen command, review fixes, README, CI - #4

Merged
5uck1ess merged 3 commits into
mainfrom
feature/tests-fixes-ci
Apr 3, 2026
Merged

Add tests, test-gen command, review fixes, README, CI#4
5uck1ess merged 3 commits into
mainfrom
feature/tests-fixes-ci

Conversation

@5uck1ess

@5uck1ess 5uck1ess commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • 21 unit tests for lib/ and runners/ — db CRUD, metrics, state/handoff, mock runner, permissions
  • devkit test-gen command — generate tests, run, fix failures iteratively (9th command)
  • Review fixes — dynamic default branch detection, --agents whitespace trim, status cost errors, session ID validation
  • README updated — Go CLI harness section with all 9 commands and usage examples
  • GitHub Actions CI — build + vet + test + gofmt check on push/PR

Test plan

  • CI passes on this PR (build, vet, test, format)
  • cd src && make build && ./bin/devkit --help shows 9 commands
  • go test ./... -race passes all 21 tests

5uck1ess added 3 commits April 3, 2026 01:02
- 21 unit tests for lib/ and runners/ (db, metric, state, mock runner)
- New test-gen command: generate tests, run, fix failures iteratively
- Fix review findings: dynamic default branch detection, --agents
  whitespace trimming, status cost error handling, session ID validation
- README: document Go CLI harness with all 9 commands and examples
- GitHub Actions CI: build + vet + test + format check on push/PR
…t quality

Critical:
- NewSessionID fallback now produces fixed-length 12-char hex (was PID-length)

Warnings:
- testgen: track test pass/fail, mark session "failed" if tests never pass
- testgen: handle CommitAll and GetSteps errors
- resume: compile regex at package level, normalize input to lowercase
- DefaultBranch: use TrimPrefix for slash-safe branch name parsing
- DB tests: check all setup errors via mustCreateSession/mustCreateStep helpers
- DB permissions test: handle OpenDB error, close DB, use mask comparison

Suggestions:
- TruncStr: use rune-based truncation (UTF-8 safe)
- Metric truncation test: portable printf instead of /dev/zero
- TestDetectRunners: assert runner names and Available() consistency
- CI gofmt: run once instead of three times
All 5 tri-* commands now check if the devkit binary is in PATH and
delegate to it when found — avoids output truncation, gets SQLite
session tracking, and full stdout capture for free.

Falls back to plugin-based orchestration if harness not installed.

Makefile: add link target, install prints GOPATH/bin path guidance.
@5uck1ess
5uck1ess merged commit ccc61a6 into main Apr 3, 2026
1 check failed
@5uck1ess
5uck1ess deleted the feature/tests-fixes-ci branch April 3, 2026 05: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.

1 participant