Skip to content

Conversation

@abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Dec 2, 2025

RUST-2281

This converts all of these to using cached binaries shared across the server topology tasks:

  • the main test suite
  • openssl
  • stable API
  • in use encryption
  • load balancer
  • graviton

A lot of yaks to shave here:

  • Archiving test runner binaries turns out to be nontrivial (rustc hash, dependent libraries, etc.). Fortunately, cargo nextest has support for this.
  • Tests needed a little bit of an update to pick up paths at runtime rather than compile-time since even on the same host tag different tasks will have different paths.
  • Speaking of host tags, we were using an outdated one for rhel8.
  • Some tests (e.g. compression) use the same tasks as the main suites, so I had to use some trickery to make the archived runner portion optional.
  • cargo nextest doesn't support doctests (they're apparently built in a different and hard to manage way); we were running those alongside the main tests but that doesn't work if the run is using an archive, so I've split that out into its own lint task.

- name: check-cargo-deny
commands:
- func: "check cargo deny"
- command: shell.exec
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were tasks calling a function that itself was a single command and not used anywhere else; I got annoyed tracking down the indirections and collapsed them. I can revert this portion if you don't think it's an improvement :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I like this change - can these be subprocess.exec, though?

- command: expansions.update
params:
file: src/uri-expansions.yml
# The server needs some time after startup otherwise it won't include things like
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out the time of the compilation step between mongo orchestration and running the tests was masking this behavior; took me a while to figure out why the relevant tests were failing.

tags: [{version}, {top_name}]
depends_on:
- name: build-nextest-archive
patch_optional: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Despite the name, what this actually means is "if the named task doesn't exist in this buildvariant, don't actually depend on it".

/// let mut cs = coll.watch().session(&mut session).await?;
/// while let Some(event) = cs.next(&mut session).await? {
/// let id = bson::to_bson(&event.id)?;
/// let id = bson::serialize_to_bson(&event.id)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These failed because the new doctest target is running against bson3. I figure it's better to have the newer version be the one documented.


# This file is not created by default on Windows
echo 'export PATH="$PATH:${CARGO_HOME}/bin"' >>${CARGO_HOME}/env
echo "export CARGO_NET_GIT_FETCH_WITH_CLI=true" >>${CARGO_HOME}/env
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 was a fix for a years-old issue with git authentication on macos that's no longer a problem. Removed it because I was hitting very hard to diagnose issues with cargo not being able to locate the git binary on windows, likely something to do with cygwin path manipulation.

@abr-egn abr-egn marked this pull request as ready for review December 3, 2025 14:25
@abr-egn abr-egn requested a review from a team as a code owner December 3, 2025 14:25
@abr-egn abr-egn marked this pull request as draft December 3, 2025 14:34
@abr-egn abr-egn marked this pull request as ready for review December 4, 2025 10:22
Copy link
Contributor

@isabelatkinson isabelatkinson left a comment

Choose a reason for hiding this comment

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

nice! just a small suggestion

- name: check-cargo-deny
commands:
- func: "check cargo deny"
- command: shell.exec
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I like this change - can these be subprocess.exec, though?

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.

2 participants