Skip to content

Fix OSInfo assertions and tests for rolling-release distributions - #1778

Merged
Steve Lee (SteveL-MSFT) merged 3 commits into
mainfrom
copilot/fix-osinfo-version-operators-arch-linux
Oct 28, 2026
Merged

Steve Lee (SteveL-MSFT) merged 3 commits into
mainfrom
copilot/fix-osinfo-version-operators-arch-linux

Conversation

Copilot AI commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

On Arch Linux, non-numeric versions and absent codenames cause OSInfo test failures. Requested properties missing from the actual OS state also incorrectly report success.

  • State evaluation: Treat any requested-but-unreported OS property as not in the desired state.
  • Portable tests: Skip version-operator cases for non-numeric versions and codename cases when no codename is reported; retain literal version matching.
  • Regression coverage: Add deterministic rolling-release and missing-property tests, plus a CLI assertion for absent codenames.

Co-authored-by: SteveL-MSFT <11859881+SteveL-MSFT@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix version operators and codename issue for Arch Linux in OSInfo Fix OSInfo assertions and tests for rolling-release distributions Oct 28, 2026
@SteveL-MSFT
Steve Lee (SteveL-MSFT) marked this pull request as ready for review October 28, 2026 18:28
Copilot AI balanced review requested due to automatic review settings October 28, 2026 18:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The test’s -Skip:$skip is evaluated before per-case variables are available, so Rolling Release cases still run and fail on Arch Linux.

1 open issue
What changed in this PR

This PR addresses #1777 by correcting OSInfo state comparisons for missing properties and adapting tests for rolling-release distributions.

Changes:

  • Treat requested-but-unreported OS properties as not in the desired state.
  • Add conditional skips for version-operator and codename tests while retaining literal version matching.
  • Add deterministic missing-property and rolling-release tests, plus a CLI assertion for absent codenames.
File Description
resources/​osinfo/​tests/​osinfo.tests.ps1 Adds platform-dependent skip conditions and absent-codename assertions.
lib/​dsc-lib-osinfo/​src/​lib.rs Extracts state comparison logic, rejects missing requested properties, and adds regression tests.

Review effort: Balanced

Comment thread resources/osinfo/tests/osinfo.tests.ps1 Outdated
Co-authored-by: SteveL-MSFT <11859881+SteveL-MSFT@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

😲 Code Coverage Report

Changed Code Coverage

100% (100% coverage)

Metric Value
Changed lines analyzed 39
Lines covered by tests 39
Coverage percentage 100%

🔵 Full Codebase Coverage

83% (good)

Metric Value
Total executable lines 20461
Lines covered by tests 17071
Coverage percentage 83%

Changed code coverage measures only Rust lines added/modified in this PR.
Full codebase coverage measures all instrumented Rust lines across the project.

@SteveL-MSFT
Steve Lee (SteveL-MSFT) merged commit 4c6e6ab into main Oct 28, 2026
31 checks passed
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the copilot/fix-osinfo-version-operators-arch-linux branch October 28, 2026 20:40
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.

Microsoft/OSInfo: version operators and codename don’t work on rolling-release distributions like Arch Linux

3 participants