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

[Golang][client] fix file suffix for _test.go #449

Merged

Conversation

grokify
Copy link
Member

@grokify grokify commented Jul 3, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.1.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

@antihax
@bvwells

Description of the PR

Fixes #448

Adds an extra _ suffix to string returned by toModelFilename and toApiFilename if the suffix is _test resulting in a model or API file that ends in _test.go which is ignored by the Go compiler.

samples/client/petstore/go/go-petstore was rebuilt from scratch by bin/go-petstore.sh, aside from samples/client/petstore/go/go-petstore/api/swagger.yaml which is useful. May be worthwhile to have that auto-added along with openapi.yaml.

@antihax
Copy link
Contributor

antihax commented Jul 3, 2018

looks good. thanks

@grokify
Copy link
Member Author

grokify commented Jul 4, 2018

All tests passed, but not at the same time yet.

Occasionally, Circle CI cannot retrieve Java dependencies, Shippable runs into a race condition and Travis CI times out.

Here are example messages for reference.

Shippable - Build #1192.1

[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.2.15.v20160210:start (start-jetty) on project spring-mvc-j8-localdatetime: Failure: ShutdownMonitorThread already started -> [Help 1]

Travis CI - Build #1135

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

@grokify
Copy link
Member Author

grokify commented Jul 4, 2018

@antihax @bvwells @wing328

All tests are passing with no conflicts.

Rebuilding due to addition of new test testFilenames in GoClientCodegenTest.java.

@wing328 wing328 added this to the 3.1.0 milestone Jul 5, 2018
@grokify grokify changed the title [Golang][client] add file suffix fix for _test.go [Golang][client] fix file suffix for _test.go Jul 5, 2018
@wing328
Copy link
Member

wing328 commented Jul 5, 2018

Shippable CI error is not related to the change so merging this into master. Thanks for the enhancement.

@wing328 wing328 merged commit 33fcd28 into OpenAPITools:master Jul 5, 2018
jimschubert added a commit to jimschubert/openapi-generator that referenced this pull request Jul 7, 2018
* master: (116 commits)
  3.1.0 release (OpenAPITools#486)
  Fix broken link to openapi generator plugin README (OpenAPITools#484)
  show warning message for nodejs server only (OpenAPITools#481)
  Add grokify to Go technical committee (OpenAPITools#479)
  [Slim] Improve codebase decouple (OpenAPITools#438)
  Ensure typescript samples are up to date (OpenAPITools#444)
  Update README.md
  [Golang][client] delete sample output dir before rebuild (OpenAPITools#477)
  update petstore samples (OpenAPITools#478)
  Revert "Improve Docker Tags (OpenAPITools#390)"
  update go client test dependencies (OpenAPITools#468)
  [Golang][client] fix for schema definition name `file` (OpenAPITools#433)
  Fix '.travis' file (syntax)
  make LICENSE GitHub display compatible (OpenAPITools#467)
  Improve Docker Tags (OpenAPITools#390)
  [Golang][client] fix file suffix for _test.go (OpenAPITools#449)
  Remove copy section (OpenAPITools#463)
  Add link to presentation (OpenAPITools#465)
  Use postProcessOperationsWithModels(Map, List) (OpenAPITools#431)
  [C] Adding petstore sample written in C (OpenAPITools#306)
  ...
@grokify grokify deleted the go/client/fix/filename-test-suffix branch July 7, 2018 06:00
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* add file suffix fix for _test.go

* Trigger CI due to previous Shippable race condition

* Trigger CI due to previous Shippable race condition

* Trigger CI due to previous Travis CI stall

* Trigger CI due to previous Travis CI stall

* Trigger CI due to previous Shippable race condition

* add Go client test testFilenames
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.

[Golang][client] Non-test files should not end in _test.go
3 participants