-
Notifications
You must be signed in to change notification settings - Fork 20
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
Adapt crowd-bitbucket e2e tests to Bitbucket 9.4.0 #440
Conversation
} | ||
defer resp.Body.Close() | ||
if resp.StatusCode != http.StatusOK { | ||
return "", fmt.Errorf("authentication failed: status code %d", resp.StatusCode) |
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.
Do you think it's worth passing out response body as well? We can then have more detailed message on the actual error.
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.
Typically 401 or 403 are easy to understand but let's print body as well in case it's a non 200 response.
test/e2etest/crowd_test.go
Outdated
@@ -242,7 +253,7 @@ func crowdTests(t *testing.T, testConfig TestConfig, bitbucketURL string, crowdU | |||
|
|||
// get BITBUCKETSESSIONID to use in the header in subsequent calls | |||
// even though basic auth works, atl_token is different each time | |||
bitbucketSessionID := getBitbucketSessionID(bitbucketURL, "admin", testConfig.BitbucketPassword) | |||
bitbucketSessionID, _ := getBitbucketSessionID(bitbucketURL, "admin", testConfig.BitbucketPassword) |
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.
We're not processing err here even though we have various errors returning from the method?
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.
🤦 yup, fixed now, added require nil validation instead.
Checklist