Skip to content

Commit 927052b

Browse files
authored
Merge pull request #1995 from matthewdale/godriver3513-fix-oidc
GODRIVER-3513 Fix OIDC Evergreen task failures.
2 parents 38fb1c0 + b450dc6 commit 927052b

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

.evergreen/config.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ functions:
5757
handle-test-artifacts:
5858
- command: gotest.parse_files
5959
params:
60+
optional_output: "true"
6061
files:
6162
- "src/go.mongodb.org/mongo-driver/*.suite"
6263
- command: ec2.assume_role
@@ -1928,7 +1929,10 @@ task_groups:
19281929
- name: testoidc_task_group
19291930
setup_group_can_fail_task: true
19301931
setup_group_timeout_secs: 1800
1931-
teardown_task_can_fail_task: true
1932+
# TODO(DRIVERS-3141): Uncomment the following line once the teardown bug is
1933+
# fixed. See DRIVERS-3141 for more context.
1934+
#
1935+
# teardown_task_can_fail_task: true
19321936
teardown_group_timeout_secs: 180 # 3 minutes (max allowed time)
19331937
setup_group:
19341938
- func: setup-system

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ tasks:
199199

200200
evg-test-deployed-lambda-aws: bash ${DRIVERS_TOOLS}/.evergreen/aws_lambda/run-deployed-lambda-aws-tests.sh
201201

202-
evg-gather-test-suites: find . -name \*.suite | xargs tar czf test_suite.tgz
202+
evg-gather-test-suites: find . -name \*.suite | xargs --no-run-if-empty tar czf test_suite.tgz
203203

204204
build-kms-test: go build ${BUILD_TAGS} ./internal/cmd/testkms
205205

internal/cmd/testoidcauth/main.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package main
88

99
import (
1010
"context"
11+
"errors"
1112
"fmt"
1213
"log"
1314
"os"
@@ -1781,14 +1782,16 @@ func machine51azureWithNoUsername() error {
17811782

17821783
func machine52azureWithBadUsername() error {
17831784
opts := options.Client().ApplyURI(uriSingle)
1784-
cred := options.Credential{
1785-
AuthMechanism: "MONGODB-OIDC",
1786-
Username: "bad",
1787-
}
1788-
opts.SetAuth(cred)
1785+
17891786
if opts == nil {
17901787
return fmt.Errorf("machine_5_2: failed parsing uri: %q", uriSingle)
17911788
}
1789+
if opts.Auth == nil || opts.Auth.AuthMechanism != "MONGODB-OIDC" {
1790+
return errors.New("machine_5_2: expected URI to contain MONGODB-OIDC auth information")
1791+
}
1792+
1793+
opts.Auth.Username = "bad"
1794+
17921795
client, err := mongo.Connect(opts)
17931796
if err != nil {
17941797
return fmt.Errorf("machine_5_2: failed connecting client: %v", err)

0 commit comments

Comments
 (0)