Skip to content

[BUG][SCALAZ] tests are failing with generator 4.2.0 #4072

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

Closed
3 tasks done
Fjolnir-Dvorak opened this issue Oct 5, 2019 · 5 comments
Closed
3 tasks done

[BUG][SCALAZ] tests are failing with generator 4.2.0 #4072

Fjolnir-Dvorak opened this issue Oct 5, 2019 · 5 comments
Milestone

Comments

@Fjolnir-Dvorak
Copy link
Contributor

Fjolnir-Dvorak commented Oct 5, 2019

Bug Report Checklist

  • What's the version of OpenAPI Generator used?
    Latest master (4.2.0-SNAPSHOT)
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
[error] /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala:68: not found: type ListBuffer
[error]   def findPetsByStatus(host: String, status: List[String] = new ListBuffer[String]() )(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = {
[error]                                                                 ^
[error] /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala:89: not found: type ListBuffer
[error]   def findPetsByTags(host: String, tags: List[String] = new ListBuffer[String]() )(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = {
[error]                                                             ^
[error] /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala:235: not found: type ListBuffer
[error]   def findPetsByStatus(status: List[String] = new ListBuffer[String]() )(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = {
[error]                                                   ^
[error] /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala:256: not found: type ListBuffer
[error]   def findPetsByTags(tags: List[String] = new ListBuffer[String]() )(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = {
[error]                                               ^
[warn] two warnings found
[error] four errors found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 16 s, completed Oct 5, 2019 6:14:02 PM
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:764)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:711)
	at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:289)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (sbt-test) on project scalaz-petstore-client: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :scalaz-petstore-client
Exited with code 1
Description

Scalaz is not building against the current openapi-generator. The golden files are from openapi-generator-3.0.0 which means that the scalaz tests are testing against invalid code...

Suggest a fix

Fix tests or remove tests / golden files to no longer test this generator in CircleCI

References:

CircleCI run: https://circleci.com/gh/OpenAPITools/openapi-generator/9310?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
Tested in Pull request #4071 (comment)

@jimschubert
Copy link
Member

The issue was that this was never one of our "popular" generators, and so wasn't regenerated and checked on every PR/commit. CI does verify compilation, but the compilation is only against the outputs of the last time the generator was modified.

There were issues with the generator (i.e. not handling defaulted values for things like arrays), and issues with other changes (new previously unsupported functionality added to the shared openapi YAML file, Java-only imports in DefaultCodegen).

The workaround here would be for users to use openapi-generator 3.0.0 until my fix in #4508 is released.

@jimschubert jimschubert added this to the 4.2.2 milestone Nov 17, 2019
@jimschubert
Copy link
Member

I've merged #4508.

Can you re-evaluate latest master in your changes?

@Fjolnir-Dvorak
Copy link
Contributor Author

I am currently trying to update the branches and fix all the new bugs which were introduced. As soon as the tests are working again I will test it against scala. Thank you for the fix so far

@wing328 wing328 modified the milestones: 4.2.2, 4.2.3 Dec 2, 2019
@jimschubert jimschubert modified the milestones: 4.2.3, 4.2.2 Jan 29, 2020
@jimschubert
Copy link
Member

The fix for this was merged and released in 4.2.2 (see 10f1787)

I've updated the milestone back to 4.2.2 because this bug was already documented in our 4.2.2 Release Notes.

@Fjolnir-Dvorak
Copy link
Contributor Author

Thank you jimschubert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants