Skip to content

fix: feature-matrix CI failures for minimal and rvm test combos#708

Draft
anakrish wants to merge 1 commit into
microsoft:mainfrom
anakrish:fix-feature-matrix-ci
Draft

fix: feature-matrix CI failures for minimal and rvm test combos#708
anakrish wants to merge 1 commit into
microsoft:mainfrom
anakrish:fix-feature-matrix-ci

Conversation

@anakrish
Copy link
Copy Markdown
Collaborator

@anakrish anakrish commented May 4, 2026

Fixes the failures in the tests/feature-matrix weekly CI run (run #25244035824).

Root Causes

1. Missing per-feature skip logic in interpreter tests ("minimal" job)

Tests for time, semver, glob, uuid, and regex builtins ran even when those features weren't enabled. The existing skip logic only handled the no_std case.

2. test_utils module unavailable to integration tests ("library", "observability", "cherry-picked builtins" jobs)

test_utils was gated behind cfg(any(test, all(feature = "yaml", feature = "std"))). Since cfg(test) doesn't apply to the library when compiled for integration tests, it required the yaml product feature. Integration tests with rvm but without yaml couldn't access the module.

Fix

  • Add per-feature #[cfg(not(feature = "..."))] skip blocks for time, semver, glob, uuid, and regex builtin tests.
  • Introduce a zero-dep test-utils feature that exposes test_utils without requiring yaml.
  • Replace serde_yaml usage in test_utils::match_values with serde_json (always available) so the module has no optional-dep requirements.
  • Update the feature-matrix workflow to add test-utils to rvm-based jobs.

@anakrish anakrish requested a review from Copilot May 4, 2026 20:38
@anakrish
Copy link
Copy Markdown
Collaborator Author

anakrish commented May 4, 2026

@copilot review this PR using code-review skill and using deep-review skill

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes weekly tests/feature-matrix CI failures by properly skipping builtin-specific interpreter tests when features are disabled, and by making test_utils available to integration tests without requiring the yaml feature.

Changes:

  • Added per-feature skip logic for interpreter YAML tests when time, semver, glob, uuid, or regex are not enabled.
  • Introduced a test-utils feature to expose test_utils to integration tests without depending on yaml.
  • Updated test_utils::match_values to use serde_json output and updated the feature-matrix workflow to enable test-utils for rvm jobs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/tests/interpreter/mod.rs Adds feature-gated skip blocks so minimal feature sets don’t run builtin-specific tests.
src/test_utils.rs Removes serde_yaml dependency in diff output by switching to serde_json.
src/lib.rs Exposes test_utils under the new test-utils feature for integration tests.
Cargo.toml Declares the new test-utils feature.
.github/workflows/feature-matrix.yml Enables test-utils in relevant CI feature-matrix jobs.
Comments suppressed due to low confidence (1)

src/tests/interpreter/mod.rs:1

  • The skip checks use file.contains(...), which can produce false positives (e.g., a directory name containing the substring) and can be brittle across path formats. Also, file.contains(\"regex/\") depends on / separators and may not match if file can contain platform separators or normalized paths. Prefer matching on Path components or using stricter checks like ends_with for specific files and starts_with(\"regex/\") on a normalized forward-slash path (or a Path prefix check).
// Copyright (c) Microsoft Corporation.

Comment thread src/lib.rs
#[cfg(feature = "azure_policy")]
pub mod target;
#[cfg(any(test, all(feature = "yaml", feature = "std")))]
#[cfg(any(test, feature = "test-utils", all(feature = "yaml", feature = "std")))]
Comment on lines +647 to +650
if file.contains("globmatch.yaml") {
std::println!("skipped {file} without glob feature.");
return Ok(());
}
Comment on lines +664 to +667
if file.contains("regex/") {
std::println!("skipped {file} without regex feature.");
return Ok(());
}
Comment on lines +614 to +668
#[cfg(not(feature = "time"))]
{
let skip = [
"add_date.yaml",
"date.yaml",
"clock.yaml",
"diff.yaml",
"format.yaml",
"now_ns.yaml",
"parse_duration_ns.yaml",
"parse_ns.yaml",
"parse_rfc3339_ns.yaml",
"weekday.yaml",
];
for s in skip {
if file.contains(s) {
std::println!("skipped {file} without time feature.");
return Ok(());
}
}
}
#[cfg(not(feature = "semver"))]
{
let skip = ["semver/compare.yaml", "semver/is_valid.yaml"];
for s in skip {
if file.contains(s) {
std::println!("skipped {file} without semver feature.");
return Ok(());
}
}
}
#[cfg(not(feature = "glob"))]
{
if file.contains("globmatch.yaml") {
std::println!("skipped {file} without glob feature.");
return Ok(());
}
}
#[cfg(not(feature = "uuid"))]
{
let skip = ["uuid/generate.yaml", "uuid/parse.yaml"];
for s in skip {
if file.contains(s) {
std::println!("skipped {file} without uuid feature.");
return Ok(());
}
}
}
#[cfg(not(feature = "regex"))]
{
if file.contains("regex/") {
std::println!("skipped {file} without regex feature.");
return Ok(());
}
}
Comment thread src/test_utils.rs
Comment on lines 93 to +98
/// Diff-friendly equality helper used by multiple YAML suites.
pub fn match_values(computed: &Value, expected: &Value) -> Result<()> {
if computed != expected {
let expected_yaml = serde_yaml::to_string(expected)?;
let computed_yaml = serde_yaml::to_string(computed)?;
bail!("expected:\n{}computed:\n{}", expected_yaml, computed_yaml);
let expected_str = serde_json::to_string_pretty(expected)?;
let computed_str = serde_json::to_string_pretty(computed)?;
bail!("expected:\n{expected_str}\ncomputed:\n{computed_str}");
- Add per-feature skip logic in interpreter tests for time, semver,
  glob, uuid, and regex builtins when those features are not enabled.
- Introduce a zero-dep `test-utils` feature to expose the test_utils
  module to integration tests without requiring the `yaml` feature.
- Replace serde_yaml usage in test_utils with serde_json (always
  available) so the module has no optional-dep requirement.
- Update feature-matrix workflow to add test-utils to rvm-based jobs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@anakrish anakrish force-pushed the fix-feature-matrix-ci branch from dc840f0 to 6a8e0a3 Compare May 4, 2026 21:57
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