Improve wlsc cli e2e test coverage#40753
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the Windows WSLC end-to-end (TAEF) CLI test suite to cover additional previously-untested commands/options, improving confidence for container workflow evaluation (including Podman scenarios).
Changes:
- Added multiple new WSLC CLI E2E tests covering settings reset, session list/shell/terminate, image list no-trunc, image build no-cache, image delete --no-prune, container logs --follow, container exec --detach, and several container create flags.
- Introduced a new
HostFileChangeRAII helper in the Windows test harness to safely back up and restore host files modified by tests. - Extended test cleanup to ensure newly-created images/tags are removed to keep the E2E environment stable across runs.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/windows/wslc/e2e/WSLCE2ESettingsTests.cpp | Adds E2E coverage for wslc settings reset with host settings file mutation protection. |
| test/windows/wslc/e2e/WSLCE2ESessionEnterTests.cpp | Adds E2E coverage for system session list --verbose, system session shell, and named system session terminate. |
| test/windows/wslc/e2e/WSLCE2EImageListTests.cpp | Adds E2E coverage for image list --no-trunc validating full image ID rendering. |
| test/windows/wslc/e2e/WSLCE2EImageDeleteTests.cpp | Implements image delete --no-prune E2E by tagging an alias and validating tag removal behavior. |
| test/windows/wslc/e2e/WSLCE2EImageBuildTests.cpp | Adds E2E coverage for build --no-cache behavior via non-deterministic layer generation. |
| test/windows/wslc/e2e/WSLCE2EContainerLogsTests.cpp | Adds E2E coverage for container logs -f streaming behavior. |
| test/windows/wslc/e2e/WSLCE2EContainerExecTests.cpp | Adds E2E coverage for container exec -d (detach) behavior. |
| test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp | Adds E2E coverage for create flags: --cpus, --memory, --ulimit, --entrypoint, --env-file, and -p. |
| test/windows/Common.h | Declares HostFileChange RAII utility for safely modifying host-side files in tests. |
| test/windows/Common.cpp | Implements HostFileChange backup/restore/update behavior used by new settings tests. |
dkbennett
left a comment
There was a problem hiding this comment.
There's some test redundancy here. We didn't have an explicit Session List test before, though it is used in validation, so that's fine to have the verbose validation but doing interactive session enter to validate the list output seems unnecessary.
The session targeting and terminate targeting tests are redundant and our existing tests cover that as well as elevation related scenarios
The settings test looks good, we didn't have one of those before.
@AmelBawa-msft should verify the Container tests match things in plan for validating that.
Summary of the Pull Request
Improve wslc cli e2e test coverage. (Helps podman evaluation. )
Untested commands / options after this:
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Cpus
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Cpus_Invalid
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Memory
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Memory_Invalid
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Ulimit
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Ulimit_Invalid
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Entrypoint
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_EnvFile
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_EnvFile_MissingFile
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_EnvFile_InvalidContent
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Publish_TCP
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Publish_MultipleMappings
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_Publish_Ephemeral
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_PortUdp_NotSupported
WSLCE2ETests::WSLCE2EContainerCreateTests::WSLCE2E_Container_Create_PortHostIP_NotSupported
WSLCE2ETests::WSLCE2EContainerExecTests::WSLCE2E_Container_Exec_Detach
WSLCE2ETests::WSLCE2EContainerLogsTests::WSLCE2E_Container_Logs_Follow
WSLCE2ETests::WSLCE2EGlobalTests::WSLCE2E_Session_List_Verbose
WSLCE2ETests::WSLCE2EImageBuildTests::WSLCE2E_Image_Build_NoCache_Success
WSLCE2ETests::WSLCE2EImageDeleteTests::WSLCE2E_Image_DeleteNoPrune
WSLCE2ETests::WSLCE2EImageListTests::WSLCE2E_Image_List_NoTrunc_ShowsFullImageId
WSLCE2ETests::WSLCE2ESettingsTests::WSLCE2E_Settings_Reset_RewritesFile