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

Capture loop var in TestClientDisabledRedirects #20466

Merged
merged 1 commit into from
May 2, 2023
Merged

Conversation

mpalmi
Copy link
Contributor

@mpalmi mpalmi commented May 2, 2023

Without this change, test failures only report the last value of name:

 /Users/mpalmi/scm/vault-enterprise/api/client_test.go:258: Disabled redirects: Moved permanently: expected 3 request(s) but got 1
    /Users/mpalmi/scm/vault-enterprise/api/client_test.go:258: Disabled redirects: Moved permanently: expected 5 request(s) but got 1
    /Users/mpalmi/scm/vault-enterprise/api/client_test.go:258: Disabled redirects: Moved permanently: expected 4 request(s) but got 1
    /Users/mpalmi/scm/vault-enterprise/api/client_test.go:258: Disabled redirects: Moved permanently: expected 6 request(s) but got 2

Capturing the loop var results in the following output:

  /Users/mpalmi/scm/vault-enterprise/api/client_test.go:258: Disabled redirects: Temporary Redirect: expected 5 request(s) but got 1
    /Users/mpalmi/scm/vault-enterprise/api/client_test.go:258: Disabled redirects: Found: expected 4 request(s) but got 1
    /Users/mpalmi/scm/vault-enterprise/api/client_test.go:258: Disabled redirects: Moved permanently: expected 3 request(s) but got 1
    /Users/mpalmi/scm/vault-enterprise/api/client_test.go:258: Enable redirects: Moved permanently: expected 6 request(s) but got 2

@mpalmi mpalmi requested a review from a team May 2, 2023 17:24
@mpalmi mpalmi enabled auto-merge (squash) May 2, 2023 17:25
Copy link
Contributor

@VioletHynes VioletHynes left a comment

Choose a reason for hiding this comment

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

Nice catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants