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

Restore java test code in samples #247

Open
jmini opened this issue Jun 7, 2018 · 10 comments
Open

Restore java test code in samples #247

jmini opened this issue Jun 7, 2018 · 10 comments

Comments

@jmini
Copy link
Member

jmini commented Jun 7, 2018

@cbornet :

The commit d9fe34a removed all the java samples test code

@jmini
Copy link
Member Author

jmini commented Jun 11, 2018

The real commit (the one included on the master branch) is c8c316e.


Git command to see what was modified with this commit:

git diff 5340c35ce123c18daa82f62131b3d1606bd1ceab..c8c316e41ee85a3ba1de4c39559eb8cf9a1690e4 --name-status

I will analyze the results.

@jmini
Copy link
Member Author

jmini commented Jun 13, 2018

I did some analysis and I propose to restore following files at commit c8c316e (see the list at the end of this message)

See my commit: jmini@ce671d8

Feedback is welcome.
@cbornet : have you other files in mind?

I will soon open a PR: issue247_restore-unit-test ->master.


@cbornet
Copy link
Member

cbornet commented Jun 13, 2018

There should also be tests for the petstore (PetApiTest, StoreApiTest, UserApiTest)

@jmini
Copy link
Member Author

jmini commented Jun 13, 2018

Ok I definitively need more background on this. The generated stuff is still there:

Before my commit:

Now the file still exists (introduced with e0b0248)

The package names have changed, but this is documented: New default values for the generated code


What was lost during the process are the manual written Unit tests, that are added to the sample after code generation. I thought this issue is about restoring them.


Please continue the discussion. I am not sure I got everything right.

@cbornet
Copy link
Member

cbornet commented Jun 13, 2018

The tests you see are the auto-generated tests. But for the samples we had true implementations of tests with actual assertions validating the responses. The scripts normally prevent overriding these files during generation. These tests allow to validate the generated code more deeply.

@cbornet
Copy link
Member

cbornet commented Jun 13, 2018

See this diff for a part of the code that was removed.

@jmini
Copy link
Member Author

jmini commented Jun 19, 2018

First part: #346 (can be merged without waiting for the second part).


In an other PR I will restore the removed implementation that @cbornet would like to have.

@cbornet
Copy link
Member

cbornet commented Oct 31, 2018

Did you progress on that ? We still don't have good CI tests on our Java clients...

@jmini
Copy link
Member Author

jmini commented Nov 3, 2018

I started it twice (there is a branch on my fork), but it requires some time to do it properly (to sort out what needs to be rested and what not).

The setup with the local host table (see this page) is also complicated for me (never took the time to do the setup locally)

I also wanted to run the petstore server directly (without docker), but nobody replied to the change proposed here OpenAPITools/openapi-petstore#6 (the ultimate goal is to build the petstore server and to deploy a released artifact on Maven Central - this way we can fetch it and start it on the JVM, no docker and port mapping involved)


I my opinion working on a solution as described in #689 would add more value than working on this (which does not imply that I will not solve this, both approaches are complementary)

@cbornet
Copy link
Member

cbornet commented May 10, 2019

We should work on this issue...

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

No branches or pull requests

3 participants