Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !4030

[FIX][WIP][CORE] Bug/golden test ignoring deleted files

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/Fjolnir-Dvorak/bug/goldenTestIgnoringDeletedFiles into master Oct 02, 2019
  • Overview 0
  • Commits 41
  • Pipelines 0
  • Changes 772+

Created by: Fjolnir-Dvorak

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, ./bin/openapi3/{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\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

The golden tests are generating new files without cleaning up no longer used files making the tests much less usefull. This Pull Request deletes the sample directory before running "ensure-up-to-date" to create a clean golden test which no longer ignores outdated files. For that I had to modify the typescript scripts since those were copying files manually into the samples directory without checking if that directory is even existing.

Changes:

  • Every maven module in samples/ is now regenerated in bin/utils/ensure-up-to-date
  • bin/utils/ensure-up-to-date is now callable from any directory instead only from project root
  • samples/* will be deleted completely on bin/utils/ensure-up-to-date
  • Files which are needed for testing are located in CI/samples.ci and are copied back into samples/ after bin/utils/ensure-up-to-date finished regenerating every client.
  • samples/ contains only clients which are golden-tested by CircleCI.
  • Every generated project in samples has to be build by the latest generator snapshot

TODOs:

  • Scalaz test was turned off for further testing since it failed. Issue for Scalaz: https://github.com/OpenAPITools/openapi-generator/issues/4072
  • Java client vertx test was turned off for further testing since it failed.
  • C test was turned off for further testing since it failed. This should be fixed in Pull request https://github.com/OpenAPITools/openapi-generator/pull/4055. Waiting for that to be merged into master to turn the test back on again.
  • if it is guaranteed that every gen-project has the latest version the versionfile should/could be removed. Each version file would have to be changed/regenerated on a new release creating a lot of changes in git.

What is not possible:

  • CI/samples.ci cannot be linked into samples/ for less disk space usage. Reasons:
    • The windows C# test has problems, even if link support is turned on for windows
    • JavaScript does not honor the directory a file is located in. It follows the symlink and fails instead of searching the current directory for dependencies / references.
  • Generated projects cannot be overridden and must be deleted instead. Reason: Some clients do not regenerate files if they already exists.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/Fjolnir-Dvorak/bug/goldenTestIgnoringDeletedFiles