Gate publish-to-gallery.yml on the full cross-platform test matrix - #29
Open
juemerson-at-purestorage wants to merge 1 commit into
Open
Conversation
The publish workflow's test step ran only on ubuntu-latest with a single Pester invocation, which (a) fails outright since it never installs Posh-SSH (Get-PfbApiTokenViaSsh.Tests.ps1 mocks New-SSHSession, which Pester can't mock unless the module is resolvable), and (b) even once fixed would only test 1 of the 4 OS/PowerShell-edition combinations the module claims to support -- real platform-specific bugs (SecureString truncation on Linux/macOS, a Windows PowerShell 5.1 crash) have previously only surfaced on non-ubuntu runners. Turn cross-platform-tests.yml into a reusable workflow (workflow_call) and have publish-to-gallery.yml's publish job depend on it via needs, instead of duplicating a subset of its test setup inline. Fixes dmann000#26
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.
Closes #26
Problem
publish-to-gallery.yml's test step ran only onubuntu-latestwith asingle Pester invocation. That step was already broken -- it never
installed Posh-SSH, and
Get-PfbApiTokenViaSsh.Tests.ps1mocksNew-SSHSession, which Pester can only mock if the module isresolvable. On top of that, even a fixed single-platform step would
only cover 1 of the 4 OS/PowerShell-edition combinations the module
claims to support -- this repo has already hit real platform-specific
bugs (SecureString truncation on Linux/macOS, a Windows PowerShell 5.1
crash) that only a non-ubuntu runner surfaced.
Fix
workflow_calltocross-platform-tests.ymlso it can beinvoked as a reusable workflow.
publish-to-gallery.ymlnow has atestjob that callscross-platform-tests.yml, and thepublishjob depends on it vianeeds: test. The old single-platform Pester/Posh-SSH step wasremoved entirely -- no test logic is duplicated across the two files.
actions/checkoutfromv4tov7inpublish-to-gallery.ymlto match
update-api-capability-map.yml.Test plan
v0.0.0-test-26) to my fork to fire thereal
push: tags: v*trigger end-to-end. All 4testjobscenarios passed (windows/Windows PowerShell 5.1, windows/pwsh,
ubuntu/pwsh, macos/pwsh), confirming the
workflow_calllinkworks and the YAML parses correctly.
https://github.com/juemerson-at-purestorage/fb-powershell/actions/runs/29935387950
publishjob correctly no-op'd (repository guard) since the forkisn't the official upstream repo.