Skip to content

Fix Unix path handling in result-processor tests - #7727

Open
rosebyte wants to merge 1 commit into
dotnet:mainfrom
rosebyte:rosebyte-issue-completion-status
Open

rosebyte wants to merge 1 commit into
dotnet:mainfrom
rosebyte:rosebyte-issue-completion-status

Conversation

@rosebyte

Copy link
Copy Markdown
Member

Addresses #26.

Result-processor tests fail to generate -rp.txt files when absolute Unix input paths are interpreted as command-line options. A Windows-only guard has been masking this failure on Linux and macOS.

Changes

  • Use the supported in= and o= arguments with CmdQuoter to escape paths correctly.
  • Check the result processor's exit code and remove the Windows-only guard.
  • Add four regression cases covering multiple absolute input paths, spaces, and balanced and unmatched braces.
  • Add ten missing macOS arm64 result-summary baselines. Their metrics exactly match the existing macOS training-output baselines; shared baselines and comparison tolerances are unchanged.

Validation

  • Affected predictor tests on macOS arm64 with .NET 8: 51 passed, 0 failed, 44 existing skips.
  • All four new regression cases fail with the original helper and pass with the fix.
  • Windows and Linux have not been tested. Removing the guard also enables Linux result-summary checks, so its baselines still need validation.

Copilot AI lite review requested due to automatic review settings September 21, 2026 12:29

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.

Copilot review overview

🔵 Needs a closer look

It changes cross-platform baseline verification behavior for many predictor tests and explicitly notes Windows/Linux validation is still pending.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

This PR fixes cross-platform invocation of the internal ResultProcessor used by predictor baseline tests by ensuring absolute Unix paths are passed as values (not mis-parsed as /option switches), and by re-enabling -rp.txt generation/verification on non-Windows platforms.

Changes:

  • Update the ResultProcessor test helper to pass inputs/outputs using in= and o= with CmdQuoter, and fail the test when ResultProcessor returns a non-zero exit code.
  • Remove the Windows-only guard so -rp.txt baselines are generated and compared on Linux/macOS as well.
  • Add regression coverage for absolute paths (including spaces and braces) and add missing macOS arm64 -rp.txt baselines.
File Description
test/​Microsoft.ML.TestFramework/​BaseTestPredictorsMaml.cs Fixes ResultProcessor argument construction/quoting and enables -rp.txt checks cross-platform.
test/​Microsoft.ML.Predictor.Tests/​ResultProcessor/​TestResultProcessor.cs Adds regression test covering absolute input paths with spaces/braces.
test/​BaselineOutput/​Common/​WeightedEnsembleMulticlass/​osx-arm64/​WE-Bootstrap-TrainTest-iris-rp.txt Adds missing osx-arm64 result-processor baseline.
test/​BaselineOutput/​Common/​WeightedEnsembleMulticlass/​osx-arm64/​WE-Average-TrainTest-iris-rp.txt Adds missing osx-arm64 result-processor baseline.
test/​BaselineOutput/​Common/​WeightedEnsemble/​osx-arm64/​WE-Hetero-TrainTest-breast-cancer-rp.txt Adds missing osx-arm64 result-processor baseline.
test/​BaselineOutput/​Common/​WeightedEnsemble/​osx-arm64/​WE-AvgPer-TrainTest-breast-cancer-rp.txt Adds missing osx-arm64 result-processor baseline.
test/​BaselineOutput/​Common/​LdSvm/​osx-arm64/​LDSVM-nob-TrainTest-breast-cancer-rp.txt Adds missing osx-arm64 result-processor baseline.
test/​BaselineOutput/​Common/​LdSvm/​osx-arm64/​LDSVM-nob-CV-breast-cancer-rp.txt Adds missing osx-arm64 result-processor baseline.
test/​BaselineOutput/​Common/​LdSvm/​osx-arm64/​LDSVM-def-CV-breast-cancer-rp.txt Adds missing osx-arm64 result-processor baseline.
test/​BaselineOutput/​Common/​AveragedPerceptron/​osx-arm64/​AveragedPerceptron-TrainTest-breast-cancer.PAVcalibration-rp.txt Adds missing osx-arm64 result-processor baseline.
test/​BaselineOutput/​Common/​AveragedPerceptron/​osx-arm64/​AveragedPerceptron-TrainTest-breast-cancer.nocalibration-rp.txt Adds missing osx-arm64 result-processor baseline.
test/​BaselineOutput/​Common/​AveragedPerceptron/​osx-arm64/​AveragedPerceptron-TrainTest-breast-cancer.calibrateRandom-rp.txt Adds missing osx-arm64 result-processor baseline.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +47 to +49
string[] lines = File.ReadAllLines(outputPath).Where(line => !string.IsNullOrWhiteSpace(line)).ToArray();
Assert.Equal(4, lines.Length);
Assert.Equal("LogisticRegression", lines[0]);
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.89%. Comparing base (4c8b357) to head (35d529f).
⚠️ Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
...crosoft.ML.TestFramework/BaseTestPredictorsMaml.cs 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7727      +/-   ##
==========================================
+ Coverage   69.59%   69.89%   +0.29%     
==========================================
  Files        1484     1487       +3     
  Lines      273606   276272    +2666     
  Branches    27949    28292     +343     
==========================================
+ Hits       190408   193087    +2679     
+ Misses      75836    75689     -147     
- Partials     7362     7496     +134     
Flag Coverage Δ
Debug 69.89% <94.59%> (+0.29%) ⬆️
production 64.07% <ø> (+0.22%) ⬆️
test 89.83% <94.59%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ictor.Tests/ResultProcessor/TestResultProcessor.cs 25.26% <100.00%> (+25.26%) ⬆️
...crosoft.ML.TestFramework/BaseTestPredictorsMaml.cs 81.36% <87.50%> (+0.14%) ⬆️

... and 42 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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