Refactor tests: use TAEF metadata for WSL version filtering#40140
Open
Refactor tests: use TAEF metadata for WSL version filtering#40140
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Windows TAEF tests to use per-test metadata (WSLVersion) for WSL1/WSL2 filtering, shifting version selection from runtime skip macros to runner-level /select: queries (run-tests.ps1 + CloudTest).
Changes:
- Introduces
WSL1_TEST_METHOD/WSL2_TEST_METHOD/WSLC_TEST_METHODmacros that attachWSLVersionmetadata to test methods. - Converts existing test methods across multiple
test/windows/*.cppfiles to use the new version-specific macros. - Adds automatic version-based
/select:filtering intools/test/run-tests.ps1and CloudTest’sTestGroup.xml.in; updatestest/README.mddocumentation.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/test/run-tests.ps1 | Adds automatic /select: injection when no user selection is provided. |
| test/windows/Common.h | Defines new version-specific TEST_METHOD wrapper macros using TAEF metadata. |
| test/windows/UnitTests.cpp | Converts many tests to version-specific macros; adds new BytesToHex/HexToBytes tests. |
| test/windows/SimpleTests.cpp | Converts WSL2-only test method declaration to metadata-based macro. |
| test/windows/PolicyTests.cpp | Converts multiple WSL2-only policy tests to metadata-based macros. |
| test/windows/PluginTests.cpp | Converts WSL1/WSL2-specific plugin tests to metadata-based macros. |
| test/windows/NetworkTests.cpp | Removes embedded WSL2 runtime skip from helper macros and converts test methods to metadata-based macros. |
| test/windows/MountTests.cpp | Converts mount tests to metadata-based macros; removes WSL2 runtime-only checks in helpers. |
| test/windows/DrvFsTests.cpp | Converts WSL1/WSL2 DrvFs tests to metadata-based macros and removes WSL2 runtime-only checks in helpers. |
| test/README.md | Documents the new version-specific test method macros and selection behavior. |
| cloudtest/TestGroup.xml.in | Adds /select: filtering to CloudTest TAEF execution arguments. |
885045e to
ba54393
Compare
ba54393 to
13f4dd4
Compare
OneBlue
reviewed
Apr 9, 2026
Cherry-pick WSL1/WSL2 test changes from 9c4dba9 (feature/wsl-for-apps). Replace runtime WSL1_TEST_ONLY()/WSL2_TEST_ONLY() skip macros with WSL1_TEST_METHOD()/WSL2_TEST_METHOD() TAEF metadata macros. This moves version filtering to the test runner level via /select: queries, so inapplicable tests are excluded entirely instead of appearing as skipped. Updated files: - test/windows/Common.h: New macros + removed old skip macros - test/windows/*.cpp: Converted all test methods - tools/test/run-tests.ps1: Auto-add /select: when no user filter - cloudtest/TestGroup.xml.in: Add version filter to TAEF args - test/README.md: Document new macros Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
13f4dd4 to
cff8b72
Compare
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.
Cherry-pick WSL1/WSL2 test changes from 9c4dba9 (
feature/wsl-for-apps).Summary
Replace runtime
WSL1_TEST_ONLY()/WSL2_TEST_ONLY()skip macros withWSL1_TEST_METHOD()/WSL2_TEST_METHOD()TAEF metadata macros. This moves version filtering to the test runner level via/select:queries, so inapplicable tests are excluded entirely instead of appearing as skipped.Changes
test/windows/Common.h: NewWSL1_TEST_METHOD/WSL2_TEST_METHOD/WSLC_TEST_METHODmacros; removed oldWSL1_TEST_ONLY/WSL2_TEST_ONLYskip macrostest/windows/*.cpp: Converted all test methods to use the new macrostools/test/run-tests.ps1: Auto-add/select:version filter when no user filter is specifiedcloudtest/TestGroup.xml.in: Add version filter to TAEF argstest/README.md: Document new macros