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 ticket API test #477

Merged
merged 6 commits into from
Oct 12, 2023
Merged

🌱 add ticket API test #477

merged 6 commits into from
Oct 12, 2023

Conversation

khareyash05
Copy link
Contributor

Add the ticket API Test

Signed-off-by: Yash Khare <[email protected]>
Signed-off-by: Yash Khare <[email protected]>
Copy link
Member

@aufi aufi left a 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{
{
Copy link
Member

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.

assert.Must(t, Identity.Create(&identity))

// create a sample tracker for the ticket.
tracker := api.Tracker{
Copy link
Member

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.

Copy link
Contributor Author

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 ?

Copy link
Contributor Author

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?

Copy link
Member

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!

}

// List Tickets.
got, err := Ticket.List()
Copy link
Member

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.

@khareyash05 khareyash05 requested a review from aufi August 25, 2023 14:36
Copy link
Member

@aufi aufi left a 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.

test/api/ticket/api_test.go Show resolved Hide resolved
test/api/ticket/api_test.go Show resolved Hide resolved
createdTickets = append(createdTickets, r)

// List Tickets.
got, err := Ticket.List()
Copy link
Member

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.

@khareyash05 khareyash05 requested a review from aufi October 5, 2023 04:59
Copy link
Member

@aufi aufi left a 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.

@aufi aufi merged commit aae707c into konveyor:main Oct 12, 2023
11 checks passed
aufi pushed a commit to aufi/tackle2-hub that referenced this pull request Oct 30, 2023
Add the ticket API Test

---------

Signed-off-by: Yash Khare <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants