-
Notifications
You must be signed in to change notification settings - Fork 343
fix(cli-generator): stop emitting a wire-test suite where every test fails #17568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| - summary: | | ||
| `generateWireTests: true` no longer emits a suite in which every test | ||
| fails. The harness passed `--no-pager` on every invocation, but the CLI | ||
| registers that flag only on operations that declare pagination metadata, | ||
| so on a spec with no `x-fern-pagination` markers clap rejected the whole | ||
| command line with "unexpected argument" — 100% of cases, not a subset. | ||
| The flag was also inert there: the pager only spawns under `--page-all`, | ||
| which no case passes. Reproduced end to end on the | ||
| `query-parameters-openapi:with-wire-tests` fixture (0/2 passing before, | ||
| 2/2 after); that fixture also declares no pagination, which is why the | ||
| breakage was not caught when the registration gate landed. | ||
| type: fix |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -908,7 +908,11 @@ async fn run_case(id: &str) { | |||||||||||||||
| let mut args: Vec<String> = command.chain.clone(); | ||||||||||||||||
| args.push("--base-url".to_string()); | ||||||||||||||||
| args.push(server.uri()); | ||||||||||||||||
| args.push("--no-pager".to_string()); | ||||||||||||||||
| // Deliberately no --no-pager: it is registered only on operations that | ||||||||||||||||
| // declare pagination metadata, so pushing it unconditionally made clap | ||||||||||||||||
| // reject every invocation ("unexpected argument '--no-pager'") on any spec | ||||||||||||||||
| // without pagination markers — the whole suite, not one case. It was also | ||||||||||||||||
| // inert here: the pager only spawns under --page-all, which no case passes. | ||||||||||||||||
|
Comment on lines
+911
to
+915
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 suggestion Five lines of post-mortem in every generated
Suggested change
|
||||||||||||||||
| if !case.params.is_empty() { | ||||||||||||||||
| // The CLI reads path params off the baked spec by their wire name, which | ||||||||||||||||
| // can differ from the manifest's (IR-renamed) name — remap those keys so | ||||||||||||||||
|
|
||||||||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔵 suggestion
The regex only catches string-literal pushes of the exact shape
args.push("--x".to_string()). A flag pushed viaformat!, a variable, or with different spacing silently escapes the assertion, so the guard could quietly stop guarding. Not blocking, but worth a comment noting the limitation, or broadening to match any--[a-z0-9-]+literal in therun_casebody.