Skip to content
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

Dart fix template tests #4015

Merged
merged 4 commits into from Oct 2, 2019

Conversation

@nickmeinhold
Copy link
Contributor

commented Oct 1, 2019

PR checklist

Description of the PR

fixes #3816

Currently there are no tests run by CI for the second stage of the code generation (the templates). I found a set of tests for the petstore api client library that were previously disabled, presumably as they were hitting the live endpoint and so were flaky.

I wrote a fake http client and recorded some of the responses from the live server so the tests don't use a live endpoint. So currently the only tests are e2e tests that were adapted to use stubbed responses. While pushing data around as a smoke test might have some value, more testing is required. This is at least a step in the right direction.

- removed from samples/client/petstore/dart2 :
  - purge_test.sh (doesn't seem to be used and not helpful)
  - openapi folder (is to be re-generated with more meaningful name)
- updated dart2-petstore.sh to generate client library with new name
- used updated shell script to re-generate client library
- updated CI/.drone.yml to use the new client library for tests
- skipped all of the tests that hit a live endpoint
- made a fake http client that can be set to check for expected values
   and/or return a provided response
- added some files with test data recorded from live api calls
- updated the README to reflect changes to tests
@wing328

This comment has been minimized.

Copy link
Member

commented Oct 2, 2019

This is at least a step in the right direction.

Definitely. Thanks for this enhancement to better test the Dart client.

@wing328 wing328 added this to the 4.1.3 milestone Oct 2, 2019
@wing328 wing328 merged commit 41acae1 into OpenAPITools:master Oct 2, 2019
5 checks passed
5 checks passed
Shippable Run 10877 status is SUCCESS.
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/drone/pr Build is passing
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Jesse0Michael added a commit to Jesse0Michael/openapi-generator that referenced this pull request Oct 3, 2019
* Clean up samples directory before fixing tests

- removed from samples/client/petstore/dart2 :
  - purge_test.sh (doesn't seem to be used and not helpful)
  - openapi folder (is to be re-generated with more meaningful name)
- updated dart2-petstore.sh to generate client library with new name
- used updated shell script to re-generate client library
- updated CI/.drone.yml to use the new client library for tests

* Update petstore tests to use faked http client

- skipped all of the tests that hit a live endpoint
- made a fake http client that can be set to check for expected values
   and/or return a provided response
- added some files with test data recorded from live api calls
- updated the README to reflect changes to tests

* Update .drone.yml so CI will run the tests
Jesse0Michael added a commit to Jesse0Michael/openapi-generator that referenced this pull request Oct 3, 2019
* Clean up samples directory before fixing tests

- removed from samples/client/petstore/dart2 :
  - purge_test.sh (doesn't seem to be used and not helpful)
  - openapi folder (is to be re-generated with more meaningful name)
- updated dart2-petstore.sh to generate client library with new name
- used updated shell script to re-generate client library
- updated CI/.drone.yml to use the new client library for tests

* Update petstore tests to use faked http client

- skipped all of the tests that hit a live endpoint
- made a fake http client that can be set to check for expected values
   and/or return a provided response
- added some files with test data recorded from live api calls
- updated the README to reflect changes to tests

* Update .drone.yml so CI will run the tests
@wing328

This comment has been minimized.

Copy link
Member

commented Oct 4, 2019

@nickmeinhold thanks for the PR, which has been included in the v4.1.3 release: https://twitter.com/oas_generator/status/1180123829626003456

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.