srs/trunk/doc
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
..
Architecture.md GB28181: Fix bug for parsing GB to RTC. 2022-10-07 19:47:34 +08:00
CHANGELOG.md Proxy: Harden internal/env tests and add counterfeiter fakes. v7.0.144 (#4665) 2026-04-18 20:33:07 -04:00
Dockers.md Use new cache image name. v6.0.86 (#3815) 2023-10-08 07:43:14 -05:00
Features.md OpenClaw: Create knowledge base for AI robot (#4636) 2026-02-14 08:42:16 -05:00
ffmpeg-logo.png support ffmpeg filter 2013-12-01 10:54:41 +08:00
ffmpeg-min.png add drawtext filter sample 2013-12-01 12:04:00 +08:00
PERFORMANCE.md Improve README and documents with AI. v5.0.153. v6.0.43 (#3538) 2023-05-12 17:18:30 +08:00
README.md Micro changes and refines. 2022-09-30 17:57:48 +08:00
readme.txt Move doc 2020-01-26 11:14:18 +08:00
Resources.md Merge 4.0release, migrate to new website. 2022-07-31 18:34:18 +08:00
source.200kbps.768x320.flv update readme, add hls(audio-only) support to readme. update sample flv from h264+mp3 to h264+aac 2014-03-21 11:38:02 +08:00
source.flv SquashSRS4: Support RTC2RTMP. 2021-05-01 22:15:57 +08:00
srs-logo.ico Windows: Support cygwin pipline and packager. v5.0.89 (#3257) 2022-11-20 15:02:08 +08:00
srs-logo.png remove the libfreetype for it fullfill with bugs and always cause build failed. 0.9.139 2014-06-29 10:43:53 +08:00