mcp: extend test version regex to match -rc.N suffix#36142
Merged
Conversation
The MCP datadriven tests strip version strings to <VERSION> for stable output. The regex matched -dev.N but not -rc.N, so on release-qualification builds (e.g. v26.21.0-rc.1) the suffix leaked through, producing <VERSION>-rc.1 and failing the snapshot. Caught by test/121029 (v26.21.0-rc.1) on test_mcp_agent and test_mcp_developer.
antiguru
approved these changes
Apr 18, 2026
def-
approved these changes
Apr 18, 2026
def-
reviewed
Apr 18, 2026
| /// Helper to set up an MCP test server and run datadriven tests. | ||
| fn run_mcp_datadriven(testdata_path: &str, harness: test_util::TestHarness) { | ||
| let version_re = Regex::new(r#"\d+\.\d+\.\d+(\.\d+)?(-dev(\.\d+)?)?"#).unwrap(); | ||
| let version_re = Regex::new(r#"\d+\.\d+\.\d+(\.\d+)?(-(dev|rc)(\.\d+)?)?"#).unwrap(); |
Contributor
There was a problem hiding this comment.
Why don't we use something like a proper semver library intead? Regex is brittle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The MCP datadriven tests in
src/environmentd/tests/server.rsstrip versionstrings to
<VERSION>for stable expected output. The regex handled-dev.Nbut not
-rc.N:Caught by test/121029 (v26.21.0-rc.1) on
test_mcp_agentandtest_mcp_developer.Tips for reviewer
mainand-devbuilds is unchanged.main, it should be cherry-picked onto the v26.21.0-rc.1 release branch so RC qualification can complete green. Earlier RC branches (v26.20, v26.19, v26.18) likely also need the cherry-pick if any further qualification work is planned on them.Checklist
$T ⇔ Proto$Tmapping (possibly in a backwards-incompatible way), then it is tagged with aT-protolabel. (N/A)