srs/.openclaw
Winlin cd11a6720f
Proxy: Harden internal/env tests and add counterfeiter fakes. v7.0.144 (#4665)
- **Refactor `internal/env` for testability.** Route every
`os`/filesystem
  call in `env.go` through swappable package-level function variables
(`getEnv`, `setEnv`, `lookupEnv`, `openFile`). Split `parseEnvFile` into
a
thin file-opening wrapper plus a pure `parseEnvReader(io.Reader)` so the
  parser can be tested directly without touching disk.
- **Hermetic tests, 96.9% coverage.** Rewrite `internal/env/env_test.go`
to
install in-memory fakes via `withFakeEnv` / `withFakeOpen` helpers that
  swap the package vars and restore them on `t.Cleanup`. Tests no longer
mutate real process env or write temp `.env` files, removing a source of
flakiness under parallel test execution. New cases cover
`NewEnvironment`,
`setEnvDefault`, `loadEnvFile` error paths, and edge cases in the
parser.
- **Counterfeiter-based fake generation.** Add `counterfeiter` as a Go
tool
dependency, a `//go:generate` directive for the `Environment` interface
  (`internal/env/gen.go`), and commit the generated
  `internal/env/envfakes/fake_environment.go` so downstream packages can
test against a spec-faithful fake instead of hand-rolling stubs. Expose
  the step as `make generate`.
- **Tooling.** `scripts/proxy-utest.sh` gains a `--coverage` / `-c` flag
  that runs `go test -coverprofile=...` across `./cmd/...` and
  `./internal/...` and prints per-function coverage via `go tool cover
  -func`. The `srs-develop` skill doc is updated to include the
  regenerate-fakes step and the new coverage flag.
- **Go version.** Bump `go.mod` to Go 1.25 (required for the `go tool`
  directive used to pin the counterfeiter CLI as a tool dep).

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 20:33:07 -04:00
..
memory Refactor bootstrap for multi-server support and add srs-develop skill. v7.0.142 (#4657) 2026-04-06 08:28:00 -04:00
skills Proxy: Harden internal/env tests and add counterfeiter fakes. v7.0.144 (#4665) 2026-04-18 20:33:07 -04:00
.gitignore Refactor bootstrap for multi-server support and add srs-develop skill. v7.0.142 (#4657) 2026-04-06 08:28:00 -04:00
.openclaw OpenClaw: Restructure workspace with symlinks, add codebase map, and rewrite AI docs. v7.0.141 (#4654) 2026-03-26 08:08:18 -04:00
AGENTS.md Rename openclaw workspace name. 2026-03-22 10:38:53 -04:00
cmake OpenClaw: Restructure workspace with symlinks, add codebase map, and rewrite AI docs. v7.0.141 (#4654) 2026-03-26 08:08:18 -04:00
cmd OpenClaw: Restructure workspace with symlinks, add codebase map, and rewrite AI docs. v7.0.141 (#4654) 2026-03-26 08:08:18 -04:00
docs OpenClaw: Restructure workspace with symlinks, add codebase map, and rewrite AI docs. v7.0.141 (#4654) 2026-03-26 08:08:18 -04:00
HEARTBEAT.md Rename openclaw workspace name. 2026-03-22 10:38:53 -04:00
IDENTITY.md Rename openclaw workspace name. 2026-03-22 10:38:53 -04:00
internal OpenClaw: Restructure workspace with symlinks, add codebase map, and rewrite AI docs. v7.0.141 (#4654) 2026-03-26 08:08:18 -04:00
MEMORY.md OpenClaw: Restructure workspace with symlinks, add codebase map, and rewrite AI docs. v7.0.141 (#4654) 2026-03-26 08:08:18 -04:00
objs OpenClaw: Restructure workspace with symlinks, add codebase map, and rewrite AI docs. v7.0.141 (#4654) 2026-03-26 08:08:18 -04:00
SOUL.md Rename openclaw workspace name. 2026-03-22 10:38:53 -04:00
TOOLS.md OpenClaw: Improve SRS support skill with docs integration, troubleshooting, and workspace updates (#4655) 2026-03-30 07:11:24 -04:00
trunk OpenClaw: Restructure workspace with symlinks, add codebase map, and rewrite AI docs. v7.0.141 (#4654) 2026-03-26 08:08:18 -04:00
USER.md OpenClaw: Improve SRS support skill with docs integration, troubleshooting, and workspace updates (#4655) 2026-03-30 07:11:24 -04:00