| name | fixture-add |
| description | Scaffold a new YAML test fixture and register its path constant in testutil/test_constants.go |
The user provides: fixture type and content description.
Steps:
-
Choose the correct subdirectory under testdata/yaml-fixtures/:
- GitHub Action →
actions/javascript/, actions/composite/, or actions/docker/
- Invalid/error case →
actions/invalid/ or error-scenarios/
- Config file →
configs/
- Dependency-heavy action →
dependencies/
-
Create the YAML fixture file following the naming convention of existing fixtures in that directory.
Inspect one existing fixture file first to match the YAML structure and formatting.
-
Add a constant to testutil/test_constants.go following the TestFixture<Name> pattern,
pointing to the path relative to testdata/yaml-fixtures/ (e.g. "actions/composite/my-fixture.yml").
-
Run go build ./testutil/... to verify it compiles.
-
Show the user the usage pattern:
testutil.WriteActionFixture(t, tmpDir, testutil.TestFixture<Name>)
testutil.MustReadFixture(testutil.TestFixture<Name>)