Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit ff920b0

Browse files
mromaszewiczclaude
andcommitted
refactor: switch test fixtures to use external runtime package
Configure all test fixtures (except parameters/) to import the generated runtime package instead of inlining runtime code. This reduces bloat in generated test files and exercises the external runtime code path. The parameters/ tests remain in inline mode to maintain coverage of the extract+DCE pipeline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d24950b commit ff920b0

91 files changed

Lines changed: 1968 additions & 2306 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# oapi-codegen internal tests
2+
3+
Please note, we have a number of directories here, testing various topics.
4+
Try to find an existing topic to extend when making new tests, or if the
5+
topic is unrelated to what we have, make a new one.
6+
7+
Wherever tests depend on the runtime package, we import our pre-generated
8+
runtime package from the repo root, except parameter tests, where
9+
we generate it inline, since we want to test that code path and dead code elimination,
10+
both of which are most heavily exercised in parameters code.

experimental/codegen/internal/test/callbacks/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ generation:
44
callback-initiator: true
55
callback-receiver: true
66
server: std-http
7+
runtime-package:
8+
path: github.com/oapi-codegen/oapi-codegen-exp/experimental/runtime

experimental/codegen/internal/test/callbacks/output/callbacks.gen.go

Lines changed: 7 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package: output
2+
output: output/types.gen.go
3+
generation:
4+
runtime-package:
5+
path: github.com/oapi-codegen/oapi-codegen-exp/experimental/runtime

experimental/codegen/internal/test/components/composition/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// oneOf/anyOf patterns, enums, readOnly/writeOnly, and x-go-name.
33
package composition
44

5-
//go:generate go run ../../../../../cmd/oapi-codegen -package output -output output/types.gen.go spec.yaml
5+
//go:generate go run ../../../../../cmd/oapi-codegen -config config.yaml spec.yaml

0 commit comments

Comments
 (0)