Skip to content

Makes the maven plugin to generate Model-tests and API-tests in generated-test-sources#11294

Merged
wing328 merged 15 commits intoOpenAPITools:masterfrom
feech:mvn_test_path
Jan 26, 2022
Merged

Makes the maven plugin to generate Model-tests and API-tests in generated-test-sources#11294
wing328 merged 15 commits intoOpenAPITools:masterfrom
feech:mvn_test_path

Conversation

@feech
Copy link
Copy Markdown
Contributor

@feech feech commented Jan 13, 2022

The change makes the maven plugin to generate Model-tests and API-tests in generated-test-sources without changes for other generator.

Default behaviour for java generator is changing for the case when 'output' is not set.

Before, all model, api classes and tests for them went to 'target/generated-sources'
Now, model and api classes go to the same folder - 'target/generated-sources', but tests for them go to 'generated-test-sources'.

There is a new additional option for java generator - 'testOutput'to set desired location for test-classes.

If output is set and testOutput is not - generator puts all files in output directory (this will keep backward compatibility)
If testOutput is set the value overrides default behaviour for test files

closes #10917

PR checklist

  • [+] Read the contribution guidelines.
  • [+] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • [+] Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    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*.
    For Windows users, please run the script in Git BASH.
  • [+] File the PR against the correct branch: (master) 5.3.0, 6.0.x
  • [+] If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@feech
Copy link
Copy Markdown
Contributor Author

feech commented Jan 13, 2022

Hello

@nmuesch @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10)
@wing328 @dever4eg @zhuangheihei @jimschubert

might I draw your attention to the PR.

This PR aims to solve the open issue - #10917

@feech feech marked this pull request as draft January 13, 2022 20:06
@feech
Copy link
Copy Markdown
Contributor Author

feech commented Jan 13, 2022

CI-builds broken after merge from master
I wonder if someone could guide me what are the issues

@feech feech marked this pull request as ready for review January 13, 2022 20:27
@wing328
Copy link
Copy Markdown
Member

wing328 commented Jan 24, 2022

@feech when you've time, can you please resolve the merge conflicts? I'll to try to review and get it merged today. Thanks.

…to mvn_test_path

# Conflicts:
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
@feech
Copy link
Copy Markdown
Contributor Author

feech commented Jan 24, 2022

Thank you @wing328
no conflicts anymore. hopefully the build will pass soon

@wing328 wing328 changed the title Mvn test path Makes the maven plugin to generate Model-tests and API-tests in generated-test-sources Jan 26, 2022
@wing328 wing328 added this to the 5.4.0 milestone Jan 26, 2022
@wing328
Copy link
Copy Markdown
Member

wing328 commented Jan 26, 2022

cc @OpenAPITools/generator-core-team as it impacts Default Generator class.

@wing328
Copy link
Copy Markdown
Member

wing328 commented Jan 26, 2022

LGTM. Thanks for the PR.

@wing328 wing328 merged commit 34395c3 into OpenAPITools:master Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REQ] [JAVA] maven plugin generates test in generated-test-sources

2 participants