Repository navigation
Disabled python tests that require python3 - #25556
Conversation
There was a problem hiding this comment.
2 issues 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/AbstractPythonConnexionServerCodegenTest.java">
<violation number="1" location="modules/openapi-generator/src/test/java/org/openapitools/codegen/python/AbstractPythonConnexionServerCodegenTest.java:1007">
P2: `assertPythonSyntaxValid` already skips when `python3` is unavailable, so this annotation disables generated-test syntax validation even on capable runners. Remove `enabled = false` to retain the check where the toolchain exists.</violation>
<violation number="2" location="modules/openapi-generator/src/test/java/org/openapitools/codegen/python/AbstractPythonConnexionServerCodegenTest.java:1124">
P2: This annotation suppresses substantial Java-only title-literal and HTML-escaping coverage along with the `python3`-dependent AST check. Keep the test enabled and isolate the AST evaluation into a separately skippable test (or replace it with Java-side parsing).</violation>
</file>
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
View guided diff | Turn on auto-fix | Re-trigger cubic
| } | ||
|
|
||
| @Test(description = "info.title is embedded in generated Python source as a Python string literal, not HTML-escaped") | ||
| @Test(description = "info.title is embedded in generated Python source as a Python string literal, not HTML-escaped", enabled = false) |
There was a problem hiding this comment.
P2: This annotation suppresses substantial Java-only title-literal and HTML-escaping coverage along with the python3-dependent AST check. Keep the test enabled and isolate the AST evaluation into a separately skippable test (or replace it with Java-side parsing).
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/AbstractPythonConnexionServerCodegenTest.java, line 1124:
<comment>This annotation suppresses substantial Java-only title-literal and HTML-escaping coverage along with the `python3`-dependent AST check. Keep the test enabled and isolate the AST evaluation into a separately skippable test (or replace it with Java-side parsing).</comment>
<file context>
@@ -1121,7 +1121,7 @@ public void testAiohttpRequirementsIncludePythonDateutil() throws IOException {
}
- @Test(description = "info.title is embedded in generated Python source as a Python string literal, not HTML-escaped")
+ @Test(description = "info.title is embedded in generated Python source as a Python string literal, not HTML-escaped", enabled = false)
public void testInfoTitleEmbeddedAsPythonStringLiteral() throws IOException, InterruptedException {
// spec title: Tom & Jerry <Service> 'quoted' "dquoted" \path
</file context>
| } | ||
|
|
||
| @Test(description = "generated tests for content (application/json) header params are valid Python syntax; kept in a separate test so a missing python3 toolchain skips only this check") | ||
| @Test(description = "generated tests for content (application/json) header params are valid Python syntax; kept in a separate test so a missing python3 toolchain skips only this check", enabled = false) |
There was a problem hiding this comment.
P2: assertPythonSyntaxValid already skips when python3 is unavailable, so this annotation disables generated-test syntax validation even on capable runners. Remove enabled = false to retain the check where the toolchain exists.
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/AbstractPythonConnexionServerCodegenTest.java, line 1007:
<comment>`assertPythonSyntaxValid` already skips when `python3` is unavailable, so this annotation disables generated-test syntax validation even on capable runners. Remove `enabled = false` to retain the check where the toolchain exists.</comment>
<file context>
@@ -1004,7 +1004,7 @@ public void testJsonContentHeaderParamsUseJsonLiteralInGeneratedTests() throws I
}
- @Test(description = "generated tests for content (application/json) header params are valid Python syntax; kept in a separate test so a missing python3 toolchain skips only this check")
+ @Test(description = "generated tests for content (application/json) header params are valid Python syntax; kept in a separate test so a missing python3 toolchain skips only this check", enabled = false)
public void testJsonContentHeaderParamsGeneratedTestsCompile() throws IOException, InterruptedException {
String specPath = "src/test/resources/3_0/python/connexion-json-header-test-values.yaml";
</file context>
| @Test(description = "generated tests for content (application/json) header params are valid Python syntax; kept in a separate test so a missing python3 toolchain skips only this check", enabled = false) | |
| @Test(description = "generated tests for content (application/json) header params are valid Python syntax; kept in a separate test so a missing python3 toolchain skips only this check") |
|
Thanks for flagging this, and sorry for the trouble. I'll send a follow-up PR that:
|
@khayashi4337 please move the tests to github workflow instead, e.g. create a new one for your tests based on https://github.com/OpenAPITools/openapi-generator/blob/master/.github/workflows/samples-python-fastapi-server.yaml
as unlikely every openapi generator users have
python3installed.PR checklist
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.
Summary by cubic
Disables two Python codegen tests that require a
python3toolchain, so the test suite no longer fails on environments without it.enabled = falseand are skipped during CI runs.info.titleembedding) is retained by the test specs themselves; only the compile-time validation is skipped.Written for commit e1cd2fd. Summary will update on new commits.