Skip to content

Refactor tests: use TAEF metadata for WSL version filtering#40140

Open
benhillis wants to merge 1 commit intomasterfrom
user/benhill/test_refactor
Open

Refactor tests: use TAEF metadata for WSL version filtering#40140
benhillis wants to merge 1 commit intomasterfrom
user/benhill/test_refactor

Conversation

@benhillis
Copy link
Copy Markdown
Member

Cherry-pick WSL1/WSL2 test changes from 9c4dba9 (feature/wsl-for-apps).

Summary

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.

Changes

  • test/windows/Common.h: New WSL1_TEST_METHOD/WSL2_TEST_METHOD/WSLC_TEST_METHOD macros; removed old WSL1_TEST_ONLY/WSL2_TEST_ONLY skip macros
  • test/windows/*.cpp: Converted all test methods to use the new macros
  • tools/test/run-tests.ps1: Auto-add /select: version filter when no user filter is specified
  • cloudtest/TestGroup.xml.in: Add version filter to TAEF args
  • test/README.md: Document new macros

@benhillis benhillis requested a review from a team as a code owner April 9, 2026 01:31
Copilot AI review requested due to automatic review settings April 9, 2026 01:31
Copy link
Copy Markdown
Contributor

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

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_METHOD macros that attach WSLVersion metadata to test methods.
  • Converts existing test methods across multiple test/windows/*.cpp files to use the new version-specific macros.
  • Adds automatic version-based /select: filtering in tools/test/run-tests.ps1 and CloudTest’s TestGroup.xml.in; updates test/README.md documentation.

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.

@benhillis benhillis force-pushed the user/benhill/test_refactor branch from 885045e to ba54393 Compare April 9, 2026 16:13
Copilot AI review requested due to automatic review settings April 9, 2026 16:15
@benhillis benhillis force-pushed the user/benhill/test_refactor branch from ba54393 to 13f4dd4 Compare April 9, 2026 16:15
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

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>
@benhillis benhillis force-pushed the user/benhill/test_refactor branch from 13f4dd4 to cff8b72 Compare April 9, 2026 20:39
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.

3 participants