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

minor: refactor faas tests to validate metadata #1228

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Oct 16, 2024

This is preliminary to RUST-2000, which will need this kind of observability. (And we probably should have been doing it from the start anyway.)

@@ -335,6 +335,9 @@ pub(crate) struct Handshaker {
http_client: crate::runtime::HttpClient,
}

#[cfg(test)]
pub(crate) static METADATA: std::sync::OnceLock<ClientMetadata> = std::sync::OnceLock::new();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This gives me the heebie-jeebies but since it's explicitly test-restricted and a lot less disruptive than trying to propagate the computed metadata back up the ownership/worker hierarchy it seemed the less-bad option.

@abr-egn abr-egn marked this pull request as ready for review October 16, 2024 18:40
@abr-egn
Copy link
Contributor Author

abr-egn commented Oct 17, 2024

evergreen retry

@@ -335,6 +335,10 @@ pub(crate) struct Handshaker {
http_client: crate::runtime::HttpClient,
}

#[cfg(test)]
#[allow(clippy::incompatible_msrv)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be fine since we only test on the latest release and cfg(test) isn't transitive, so someone using <1.70 (when OnceLock was introduced) can still use the mongodb crate fine, including in their tests.

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.

1 participant