Skip to content

Conversation

@kuhnroyal
Copy link
Contributor

@kuhnroyal kuhnroyal commented Nov 25, 2020

This PR adds a basic integration test to the Dart-dio generator.
There are no real tests for the moment but OpenApi test templates are added which generate empty test cases. Running these empty test cases at least ensures that the generated code compiles.

The PR also fixes 2 compile errors that are now catched due to the tests.

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.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. 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
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

This basically just fetches dependencies, runs the built_value generator and empty test cases. Even running empty test cases is more than is currently possible and at least finds compile errors.

There are compile errors atm which need to be fixed.
* the compile error was `serializerForType(Map<String, int>)` in `StoreApi` which needs to be  `serializerForType(Map)`
* use final instead of var in response handling
@kuhnroyal
Copy link
Contributor Author

kuhnroyal commented Nov 25, 2020

@josh-burton I have added a some integration testing and fixed 2 compile errors. One caused by the inline enum support.
Can you try to run this on your side and maybe try with one of your other PRs rebased on this?

./mvnw package
./bin/generate-samples.sh bin/configs/dart-dio.yaml
./mvnw integration-test -f samples/client/petstore/dart-dio/pom.xml
./bin/utils/export_docs_generators.sh

@kuhnroyal kuhnroyal marked this pull request as draft November 25, 2020 18:13
@kuhnroyal
Copy link
Contributor Author

CC @ircecho @swipesight @jaumard @amondnet This should be good to go as an initial starting point for integration tests for dart-dio. However these don't run automatically. What is the process there?

@kuhnroyal
Copy link
Contributor Author

@wing328 Mentioning you cause you merged all the last Dart PRs.
@agilob FYI, please review if you can spare the time.

@wing328
Copy link
Member

wing328 commented Dec 2, 2020

Can you please add the following line to https://github.com/OpenAPITools/openapi-generator/blob/master/pom.xml#L1352 so that the CI will run the tests as part of the build?

                <module>samples/client/petstore/dart-dio</module>

@wing328
Copy link
Member

wing328 commented Dec 2, 2020

@kuhnroyal thanks for the PR to add test coverage for the petstore dart-dio client 👍

@wing328 wing328 merged commit 033d985 into OpenAPITools:master Dec 2, 2020
@kuhnroyal kuhnroyal deleted the feature/dart-dio/basic-testing branch December 2, 2020 13:38
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.

2 participants