Repository navigation
Fix tests that never ran in CI until Discovery stopped failing - #8
Merged
Merged
Conversation
These tests were hidden by the Discovery failures fixed in the previous commit, and fail now that they run: - Build the -Exclude test paths with Join-Path instead of "$Folder\*.log". On Linux and macOS the backslash isn't a path separator, so the pattern never matched the files. - Get the module path from the module itself when importing it into a new runspace. Get-Module Watch returns nothing from inside InModuleScope now that the staged copy (imported globally) is removed before the source is imported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MFNjHmNmZhLMjcqfcoYzw6
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.
Follow-up to #7. Before #7, every test file under
Tests/PrivateandTests/Publicfailed Pester Discovery on all platforms, so their tests never ran. Now that they run, three fail in the master build:Skip-ExcludedItem.Tests.ps1,Watch-Command.Tests.ps1), Linux and macOS: the pattern was built as"$Folder\*.log". A backslash isn't a path separator there, so it never matched. Both tests now useJoin-Path $Folder '*.log'.Watch-Command.Tests.ps1), all platforms:(Get-Module Watch).Pathreturned$nullfrom insideInModuleScopeonce the globally imported staged module was removed before importing the source. The test now uses the module's own path ($ExecutionContext.SessionState.Module.Path).Windows PowerShell 5.1 coverage was already back to 99.71% in the #7 run.
Testing
Ran CI's build flow (
CombineFunctionsAndStagethenTest) on Linux with PowerShell 7.4: the three tests above now pass. Two other tests (the-AsStringexclusion and the table-view render) fail only in that headless container. They passed on all three CI runners, so they are not changed here. This PR's CI run is the check on Windows, Windows PowerShell 5.1 and macOS.Generated by Claude Code