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

fix(Activity Tracker): re-gen service after recent API changes #135

Merged
merged 2 commits into from
Jul 9, 2021

Conversation

yingwang-us
Copy link
Member

@yingwang-us yingwang-us commented Jul 6, 2021

PR summary

add endpoint sdk functions based on 2 new endpoints api for atracker service

PR Checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Current vs new behavior

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

unit test results:

yings-mbp:atrackerv1 yingwang@us.ibm.com$ go test
Running Suite: AtrackerV1 Suite
===============================
Random Seed: 1625603641
Will run 91 of 91 specs

•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
Ran 91 of 91 Specs in 3.505 seconds
SUCCESS! -- 91 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
ok  	github.com/IBM/platform-services-go-sdk/atrackerv1	3.986s

integration test results:

yings-mbp:platform-services-go-sdk yingwang@us.ibm.com$ go test github.com/IBM/platform-services-go-sdk/atrackerv1 -tags="integration" -v
=== RUN   TestAtrackerV1
Running Suite: AtrackerV1 Suite
===============================
Random Seed: 1625603255
Will run 106 of 106 specs

Service URL: http://localhost:6969
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
Ran 106 of 106 Specs in 9.148 seconds
SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestAtrackerV1 (9.45s)
PASS
ok  	github.com/IBM/platform-services-go-sdk/atrackerv1	(cached)

@yingwang-us yingwang-us requested a review from padamstx July 6, 2021 20:36
@Andras-Csanyi Andras-Csanyi self-requested a review July 8, 2021 12:04
@Andras-Csanyi
Copy link
Contributor

Andras-Csanyi commented Jul 8, 2021

I reached out to Ying via Slack and asked for the api def file was used to re-gen the sdk. The activity repo has an, seemingly, outdated one.

Copy link
Contributor

@Andras-Csanyi Andras-Csanyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

I'd like to ask you to add further test cases to the integration suite covering 400, 403 and 404 status codes for both new operation. If you can test easily and programmatically 429 then please add that too.

We'd like to achieve that all the status codes mentioned in the api definition file are exercised by integration tests. There are exceptions like 401, but we can live with that.

You can find examples (link below), especially how to create a new client not having enough rights to do things so the server returns 403.
https://github.com/IBM/platform-services-go-sdk/blob/main/catalogmanagementv1/catalog_management_v1_integration_new_test.go

Feel free to ping me if you need any help.

Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
I agree with @Andras-Csanyi that it would be good to augment the integration tests to include negative tests that exercise each of the error status codes that are explicitly defined in the API definition. We haven't always done this in the SDK int tests, but it's a good practice to follow going forward. I'll approve now to avoid a re-review assuming these negative tests are added.

@yingwang-us
Copy link
Member Author

yingwang-us commented Jul 8, 2021

@Andras-Csanyi @padamstx thanks for reviewing, I have add some 20+ negative test cases (400, 404, 403) for integration tests. For the 2 new Endpoints APIs, it seems hard to simulate 400 error and 404 error is removed from apidoc, so I just include 403 negative tests for them. Please help review, thanks.

here are new integration test results:

Yings-MacBook-Pro:platform-services-go-sdk yingwang@us.ibm.com$ go test github.com/IBM/platform-services-go-sdk/atrackerv1 -tags="integration" -v
=== RUN   TestAtrackerV1
Running Suite: AtrackerV1 Suite
===============================
Random Seed: 1625783375
Will run 129 of 129 specs

Service URL: http://localhost:6969
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
Ran 129 of 129 Specs in 9.984 seconds
SUCCESS! -- 129 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestAtrackerV1 (10.13s)
PASS
ok  	github.com/IBM/platform-services-go-sdk/atrackerv1	(cached)

Copy link
Contributor

@Andras-Csanyi Andras-Csanyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good!
Thank you for adding the negative tests!

@Andras-Csanyi Andras-Csanyi merged commit 7723b9e into main Jul 9, 2021
ibm-devx-sdk pushed a commit that referenced this pull request Jul 9, 2021
## [0.19.1](v0.19.0...v0.19.1) (2021-07-09)

### Bug Fixes

* **activity tracker:** re-gen service after recent API changes ([#135](#135)) ([7723b9e](7723b9e))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 0.19.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Andras-Csanyi Andras-Csanyi deleted the regen-atracker-0706 branch July 9, 2021 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants