-
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 ticket API test #477
Conversation
Signed-off-by: Yash Khare <[email protected]>
Signed-off-by: Yash Khare <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR, overall looks good.
) | ||
|
||
var Samples = []api.Ticket{ | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about typical values of the Ticket, but values of most of fields below might need be updated. Need find some example values.
test/api/ticket/api_test.go
Outdated
assert.Must(t, Identity.Create(&identity)) | ||
|
||
// create a sample tracker for the ticket. | ||
tracker := api.Tracker{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Tracker fields might be better re-used from from Tracker API test Samples instead of writing it here as well as in List test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall i run a loop for tracker samples ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or shall i use only one tracker from the sample?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tracker from sample should be enough!
test/api/ticket/api_test.go
Outdated
} | ||
|
||
// List Tickets. | ||
got, err := Ticket.List() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There two additional filters in List actions - by application and tracker - https://github.com/konveyor/tackle2-hub/blob/main/api/ticket.go#L74-L79. Maybe it is not required for simple test, but might be worth for adding those.
Signed-off-by: Yash Khare <[email protected]>
Signed-off-by: Yash Khare <[email protected]>
Signed-off-by: Yash Khare <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for update, please check the Ticket List action with filter parameters like Tracker and Application.
createdTickets = append(createdTickets, r) | ||
|
||
// List Tickets. | ||
got, err := Ticket.List() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no filtering parameter (like Application or Tracker ID), the filter is on API side in List action. Unless filter parameters are sent to API, I'm not sure how the filtering is tested.
Signed-off-by: Yash Khare <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for update, LGTM.
Add the ticket API Test --------- Signed-off-by: Yash Khare <[email protected]>
Add the ticket API Test