Skip to content

The hand-written tests is deleted on re-generation #29

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

Closed
ackintosh opened this issue Feb 17, 2019 · 1 comment
Closed

The hand-written tests is deleted on re-generation #29

ackintosh opened this issue Feb 17, 2019 · 1 comment

Comments

@ackintosh
Copy link
Contributor

Steps to reproduce

  • Regenerate the ruby client codes
$ cd kubernetes-client/gen/openapi
$ ruby.sh path/to/kubernetes-client/ruby/kubernetes/ path/to/kubernetes-client/ruby/settings


...
...
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.620 s
[INFO] Finished at: 2019-02-17T08:56:27Z
[INFO] ------------------------------------------------------------------------
---Done.
---Done.
  • Some diffs exists in the generated codes
$ cd path/to/kubernetes-client/ruby/
$ git status

On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   kubernetes/kubernetes.gemspec
        modified:   kubernetes/lib/kubernetes.rb
        deleted:    kubernetes/lib/kubernetes/api_client.rb
        deleted:    kubernetes/lib/kubernetes/config/error.rb
        deleted:    kubernetes/lib/kubernetes/config/incluster_config.rb
        deleted:    kubernetes/lib/kubernetes/config/kube_config.rb
        deleted:    kubernetes/lib/kubernetes/utils.rb
        deleted:    kubernetes/spec/config/incluster_config_spec.rb
        deleted:    kubernetes/spec/config/kube_config_spec.rb
        deleted:    kubernetes/spec/config/matchers.rb
        deleted:    kubernetes/spec/fixtures/config/kube_config_hash.rb
        deleted:    kubernetes/spec/fixtures/files/certs/ca.crt
        deleted:    kubernetes/spec/fixtures/files/certs/client.crt
        deleted:    kubernetes/spec/fixtures/files/certs/client.key
        deleted:    kubernetes/spec/fixtures/files/config/config
        deleted:    kubernetes/spec/fixtures/files/config/empty
        deleted:    kubernetes/spec/fixtures/files/tokens/token
        deleted:    kubernetes/spec/helpers/file_fixtures.rb
        deleted:    kubernetes/spec/utils_spec.rb

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        kubernetes/swagger.json.unprocessed

deleted: kubernetes/spec/config/incluster_config_spec.rb
deleted: kubernetes/spec/config/kube_config_spec.rb
deleted: kubernetes/spec/config/matchers.rb
deleted: kubernetes/spec/fixtures/config/kube_config_hash.rb
...

I guessing that the deleted files under spec folder are hand-written codes, and those were deleted by the code generation step here.

Suggestion

I think generating spec files is not necessary as the auto-generated files under spec are just skelton.

  • Remove spec from here
  • Configure the exclusion for spec files in ruby.xml

What do you think about it? I would file a PR if the suggestion is OK.

ackintosh added a commit to OpenAPITools/gen that referenced this issue Feb 23, 2019
ackintosh added a commit to OpenAPITools/gen that referenced this issue Feb 23, 2019
in order to avoid unintensional deletion of hand-written test codes.
ref kubernetes-client/ruby#29
k8s-ci-robot pushed a commit to kubernetes-client/gen that referenced this issue Feb 25, 2019
* Exclude test files from code generation

ref kubernetes-client/ruby#29

* Exclude spec folder from cleanup

in order to avoid unintensional deletion of hand-written test codes.
ref kubernetes-client/ruby#29
@ackintosh
Copy link
Contributor Author

kubernetes-client/gen#104 has been merged. 😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant