Skip to content

Disable python flask tests - #25519

Merged
wing328 merged 1 commit into
masterfrom
disable-test-python
Nov 2, 2026
Merged

wing328 merged 1 commit into
masterfrom
disable-test-python

Conversation

@wing328

@wing328 wing328 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

disable the test due to the following errors:

[ERROR] Failures:
[ERROR] org.openapitools.codegen.python.PythonFlaskConnexionServerCodegenTest.testControllerTestModelExampleUsesImportedName
[ERROR]   Run 1: PythonFlaskConnexionServerCodegenTest.testControllerTestModelExampleUsesImportedName:176 File 'C:\Users\User\AppData\Local\Temp\test9469312943545207622\openapi_server\test\test_default_controller.py' does not contain line [query_string = [('filter', Filter()),] expected [true] but found [false]
[ERROR]   Run 2: PythonFlaskConnexionServerCodegenTest.testControllerTestModelExampleUsesImportedName:176 File 'C:\Users\User\AppData\Local\Temp\test13514954729255540111\openapi_server\test\test_default_controller.py' does not contain line [query_string = [('filter', Filter()),] expected [true] but found [false]
[ERROR]   Run 3: PythonFlaskConnexionServerCodegenTest.testControllerTestModelExampleUsesImportedName:176 File 'C:\Users\User\AppData\Local\Temp\test10574054070658084280\openapi_server\test\test_default_controller.py' does not contain line [query_string = [('filter', Filter()),] expected [true] but found [false]

@khayashi4337, when you've time, can you please revise the test and re-enable it?

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Disables the testControllerTestModelExampleUsesImportedName test in the Python Flask generator so it stops failing in CI.

Written for commit 6f55df9. Summary will update on new commits.

View guided diff Turn on auto-fix

@wing328
wing328 marked this pull request as ready for review November 2, 2026 16:53

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFlaskConnexionServerCodegenTest.java">

<violation number="1" location="modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFlaskConnexionServerCodegenTest.java:168">
P2: This disables the only regression test that verifies model examples use the imported `Filter`/`Trace` classes; the test documents that `openapi_server.Filter()` raises `NameError`. Re-enable it and fix the generator output rather than masking the failure.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

}

@Test(description = "model examples in generated controller tests use the imported class name, not the package")
@Test(description = "model examples in generated controller tests use the imported class name, not the package", enabled = false)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This disables the only regression test that verifies model examples use the imported Filter/Trace classes; the test documents that openapi_server.Filter() raises NameError. Re-enable it and fix the generator output rather than masking the failure.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFlaskConnexionServerCodegenTest.java, line 168:

<comment>This disables the only regression test that verifies model examples use the imported `Filter`/`Trace` classes; the test documents that `openapi_server.Filter()` raises `NameError`. Re-enable it and fix the generator output rather than masking the failure.</comment>

<file context>
@@ -165,7 +165,7 @@ public void testDefaultController() throws IOException {
     }
 
-    @Test(description = "model examples in generated controller tests use the imported class name, not the package")
+    @Test(description = "model examples in generated controller tests use the imported class name, not the package", enabled = false)
     public void testControllerTestModelExampleUsesImportedName() throws IOException {
         final DefaultCodegen codegen = new PythonFlaskConnexionServerCodegen();
</file context>
Suggested change
@Test(description = "model examples in generated controller tests use the imported class name, not the package", enabled = false)
@Test(description = "model examples in generated controller tests use the imported class name, not the package")

@wing328
wing328 merged commit ec1ae58 into master Nov 2, 2026
15 checks passed
@wing328
wing328 deleted the disable-test-python branch November 2, 2026 17:02
@wing328 wing328 added this to the 7.28.0 milestone Nov 2, 2026
@khayashi4337

Copy link
Copy Markdown
Contributor

Thanks for disabling it, and sorry for the breakage on master. #25426 and #25485 were merged within a day of each other and the controller-test query rendering changed in between, so the assertion in this test went stale. I'll check what master generates now, fix the assertion, and send a PR that re-enables it.

@khayashi4337

Copy link
Copy Markdown
Contributor

Opened #25552 to fix the stale assertion and re-enable the test.

wing328 pushed a commit that referenced this pull request Nov 4, 2026
…lerTestModelExampleUsesImportedName (#25552)

The test was disabled in #25519 because its query_string assertion
expected the pre-#25485 rendering ('filter', Filter()). Object-typed
query/header parameters are now sent in their OpenAPI wire style
(form/explode pairs for the query object, a simple-style value for the
header), and the body parameter is renamed to filter_ per #25450.
Update the expectations to the current generated output while keeping
the test's purpose: model examples still use the imported class name
([Filter()], {'key': Filter()}, filter_ = Filter()), never the
package-qualified openapi_server.Filter()/openapi_server.Trace().

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants