Skip to content

Conversation

@kevinAlbs
Copy link
Contributor

@kevinAlbs kevinAlbs commented Dec 4, 2025

Summary

Run OIDC machine prose tests in all supported environments.

Motivation

See DRIVERS-3197. The added testing is motivated by NODE-6962. Prior to NODE-6962, a callback used separate code path (automated_callback_workflow) from workflows configured with the ENVIRONMENT auth mechanism property (machine_workflow.ts). This resulted in a behavior difference on retry.

Some steps require a callback (e.g. "Assert that the callback was called 1 time."). Tests and steps that require a callback are marked with [callback-only] and only expected to run when testing a callback.

Testing

Prose test 3.1 acts as a regression test for NODE-6962. Testing 3.1 with ENVIRONMENT:test before NODE-6962 (branch) expectedly fails:

export ENVIRONMENT=test-property # Test ENVIRONMENT:test (not callback)
npm run check:oidc-test
# 3.1 Authentication failure with cached tokens fetch a new token and retry auth
#   MongoServerError: Authentication failed.

And after (branch) succeeds:

export ENVIRONMENT=test-property # Test ENVIRONMENT:test (not callback)
npm run check:oidc-test
# 3.1 Authentication failure with cached tokens fetch a new token and retry auth
#   ✔ successfully authenticates

Prose test updates were tested in the C driver with a custom callback and ENVIRONMENT:azure: mongodb/mongo-c-driver#2182. Testing with ENVIRONMENT:gcp is pending further work (CDRIVER-6153).


Please complete the following before merging:

Skip steps that require a custom callback on other environments.

Intended to add test coverage. The bug in NODE-6962 is triggered in test 3.1 when testing a non-callback environment.
This test only requires a callback to make assertions. But otherwise this test can run in all environments.
This required a change in the C driver. The C driver previously was reading the token file directly to populate the cache.
@kevinAlbs kevinAlbs requested review from blink1073 and durran December 4, 2025 17:48
@kevinAlbs kevinAlbs marked this pull request as ready for review December 4, 2025 17:48
@kevinAlbs kevinAlbs requested a review from a team as a code owner December 4, 2025 17:48
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! I verified that this matches the Python prose tests.

Co-authored-by: Durran Jordan <[email protected]>
@kevinAlbs kevinAlbs requested a review from durran December 16, 2025 13:37
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.

3 participants