-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add testing suite with coverage of the REST API #262
Comments
👍 on the test directory/package structure, other notes below. Disconnected/in-cluster testsI'd consider keep connected (cluster-only) tests separated from the disconnected-only REST API tests at least in diferent files since I believe it would test slightly different thing (=>more than the REST API). Example package structureNote on Rich clientUsing the Rich Client with binding around each object's actions seems to me to bring more costs than benefits, details bellow.
Note, I'm not saying I don't want write the code as described above, I can and I'm ready to do that, I just want discuss it/understand thoughts behind it better first. |
Perhaps. I'm open to doing the most practical thing. I don't anticipate many tests that can only run when connected. So whatever makes sense is fine with me. I had anticipate the Tests that must be connected, would just short-circuit like:
So long as each function tests one thing, I'm fine with the (exported) entry point for the test(s) to be lifecycle oriented. I mainly want to avoid 100+ line functions or functions that are difficult to follow or troubleshoot. Mainly just want good functional decomposition.
The rich client is mainly to provide a simple way to CRUD resources outside of the API test that is testing the endpoint. Outside can mean another test, or outside the Hub repository. For example: The application test(s) may want to create Tags or Business Service. The thinking is that using the rich client to create the Tag or business service would be simple and proven. However the application test itself may not use the rich client to CRUD the application (endpoint being tested).
That is fine for the API test (testing the application endpoint) but would rather not have that everywhere else that needs to do to create an application for setup/tear-down. That said, I agree the rich client only insulates building the URL and can easily be convinced it's not worth it.
Can you elaborate?
This seems to be an argument for the Rich Client but suspect I misunderstand.
You are making good points and DEFINITELY want these comments. This was meant as a discussion springboard. |
Thanks for your responses, sounds good to me! (deleted solved parts of the conversation)
On the Rich Client / fixtures to be reasonable building blocks for other tests - I'm going to write the code do see how it looks and works and will update here. |
First part of Hub REST API test suite. Steps - the simplest CRUD for all resource types - simple seeds tests - connecting resources with refs (update tests above) - clarify non-trivial fixtures definition and tear up&down - basic integration scenarios (addons&analysis) Related to #262 --------- Signed-off-by: Marek Aufart <[email protected]>
Summary
Borrowing the goals from #241, we want to implement regression testing for the hub API by providing a suite of tests that will guarantee the hub conforms to the published API. This suite should be extensible so that new features can include test coverage for any API changes.
The details of this suite should be published in enhancements as follow-ups to konveyor/enhancements#98.
Proposed Design
The API tests should be configurable to run disconnected (outside of a cluster) or connected. When running disconnected, tests requiring a cluster will be omitted:
Packages
Example packages:
/test/api/application - contains one (or more .go files) Ex:
api_test.go
Fixtures
The test/api package will provide fixtures (mainly imported from other packages in the hub).
api
package.addon
binding).addon
binding).addon
binding).Example
test/api/fixtures/client.go
Example usage:
test/api/application/api_test.go
:The text was updated successfully, but these errors were encountered: