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

Adapt crowd-bitbucket e2e tests to Bitbucket 9.4.0 #440

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

bianchi2
Copy link
Collaborator

@bianchi2 bianchi2 commented Dec 9, 2024

  • disable websudo
  • use different api to get BITBUCKETSESSIONID (login call)

Checklist

  • I have successful end to end tests run (with & without domain)
  • I have added unit tests (if applicable)

@bianchi2 bianchi2 changed the title Adapt crowd-bitbucket tests to Bitbucket 9.4.0 Adapt crowd-bitbucket e2e tests to Bitbucket 9.4.0 Dec 9, 2024
@bianchi2 bianchi2 added the e2e label Dec 9, 2024
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("authentication failed: status code %d", resp.StatusCode)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@@ -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)
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@bianchi2 bianchi2 added e2e and removed e2e labels Dec 10, 2024
@bianchi2 bianchi2 added e2e and removed e2e labels Dec 10, 2024
@bianchi2 bianchi2 merged commit d0620ed into main Dec 12, 2024
4 checks passed
@bianchi2 bianchi2 deleted the fix-bitbucket-tests branch December 12, 2024 02:36
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.

2 participants