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

Add CSV Application Import test #388

Closed
aufi opened this issue Jun 12, 2023 · 0 comments · Fixed by #390
Closed

Add CSV Application Import test #388

aufi opened this issue Jun 12, 2023 · 0 comments · Fixed by #390
Labels
test/api Hub API tests-related work

Comments

@aufi
Copy link
Member

aufi commented Jun 12, 2023

There is a feature that allows upload CSV with Applications and related resources to populate the application inventory in the Hub. Write an API test that will upload sample CSV and verify created resources in the Hub.

For most of things follow what you learned in #370, just updating binding pakage is not needed in this case, the CSV can be uploaded with RichClient.Client HTTP methods. Suggested test structure is similar to previous PR, but expecting to specify list of TestCases (path to import CSV file and applications, dependencies, etc. expected be created) instead of samples.

Resources:

Example upload with curl: curl -F "file=@import.csv" http://localhost:8080/importsummaries/upload (not for test, just to show how the request should look like)

Part of konveyor/operator#220 for @khareyash05

@aufi aufi added the test/api Hub API tests-related work label Jun 12, 2023
@aufi aufi closed this as completed in #390 Jul 3, 2023
aufi pushed a commit that referenced this issue Jul 3, 2023
Closes #388 

Work Done as of now
1. Created a sample of data to be passed in `samples.go`
2. Initialized RichClient.Client
3. Uploaded CSV using FilePost
4. Get contents of `/importsummaries` 
5. Compare Applications and Dependencies with the output of the API
6. Compare valid count with no. of Applications and Dependencies
7. Added checks for all routes
8. Download the CSV
9. Compare informations of CSV's

---------

Signed-off-by: Yash Khare <yash2010118@akgec.ac.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test/api Hub API tests-related work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant