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

Cleanup test code and add tests for rate limits #2602

Merged
merged 16 commits into from
Jan 8, 2024

Conversation

pkukielka
Copy link
Contributor

@pkukielka pkukielka commented Jan 8, 2024

Test plan

No needed, those are just changes for the tests.

Changes:

  • TestClient code moved to completely to it's own class
  • Rate limit test added
  • In case of Polly error we print out more helpful warning message

public accessToken?: string
public info: ClientInfo

constructor(name: string, accessToken?: string) {
Copy link
Member

Choose a reason for hiding this comment

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

FYI, you can use public/private readonly to avoid declaring separate properties. Similar to case classes

Suggested change
constructor(name: string, accessToken?: string) {
constructor(public readonly name: string, public readonly accessToken?: string) {

@@ -103,7 +103,9 @@ recordings.
To fix this problem, update the HTTP recordings with the following command:

```sh
export SRC_ACCESS_TOKEN=sgp_YOUR_ACCESS_TOKEN # redacted in the recordings
# tokens are redacted in the recordings
export SRC_ACCESS_TOKEN_WITH_RATE_LIMIT=sgp_YOUR_ACCESS_TOKEN_WITH_RATE_LIMIT
Copy link
Member

Choose a reason for hiding this comment

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

@pkukielka pkukielka force-pushed the pkukielka/improve-agent-tests branch from 889cd28 to 5565c36 Compare January 8, 2024 12:44
super()

this.name = name
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed.

@pkukielka pkukielka merged commit cf6be7f into main Jan 8, 2024
16 checks passed
@pkukielka pkukielka deleted the pkukielka/improve-agent-tests branch January 8, 2024 16:03
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.

None yet

2 participants