| name | add-acceptance-test |
| description | Write CI-executable acceptance/integration tests for protocol or end-to-end changes (TR-F022). Use whenever a milestone subtask needs CI-backed acceptance, covering test/integration integration tests and unit tests. |
Skill: Write CI Automated Acceptance Tests
Feature ID: TR-F022 | Scope: all protocol / end-to-end acceptance
Goal
Every milestone subtask's acceptance criteria must be backed by a CI-executable test. This skill explains where the two test types live and how to write them.
Two test types
1. Unit / logic acceptance - *_test.go
- Same package as the code under test; the CI
test job runs go test -short ./....
- For: pure logic, attribute encode/decode, validators, config parsing, etc.
- How-to: see
../write-go-tests/SKILL.md.
2. End-to-end / protocol acceptance - test/integration/
Pre-research
view test/integration/main_test.go # harness usage
view test/integration/radius_test.go # RADIUS end-to-end template
grep_search "INTEGRATION_REQUIRED" --include test/**
view Makefile # test / test-integration-pg targets
Local run
go test ./...
make test-integration-pg
go test -tags=integration -count=1 -v ./test/integration/...
Steps to add an end-to-end acceptance case
- Create or extend
<feature>_test.go under test/integration/, with //go:build integration as the first line.
- Reuse the
main_test.go harness to create data and start services; drive real packets for the new feature (e.g. EAP-TLS / CoA) following the existing radius_test.go pattern.
- Assert both success and failure paths (reject reasons, timeouts, NAS rejects, etc.).
- Do not
t.Parallel() for cases that serially depend on global state (see the comments in radius_test.go).
- Confirm the CI
integration job covers the path (it runs all of ./test/integration/... by default; no CI change needed).
Boundaries
- Integration cases must not depend on external public services; provide dependencies via a service container / compose.
- Do not weaken assertions or skip failure paths just to pass.
Acceptance