Skip to content

Gate publish-to-gallery.yml on the full cross-platform test matrix - #29

Open
juemerson-at-purestorage wants to merge 1 commit into
dmann000:mainfrom
juemerson-at-purestorage:fix/publish-workflow-posh-ssh-gate
Open

Gate publish-to-gallery.yml on the full cross-platform test matrix#29
juemerson-at-purestorage wants to merge 1 commit into
dmann000:mainfrom
juemerson-at-purestorage:fix/publish-workflow-posh-ssh-gate

Conversation

@juemerson-at-purestorage

Copy link
Copy Markdown
Collaborator

Closes #26

Problem

publish-to-gallery.yml's test step ran only on ubuntu-latest with a
single Pester invocation. That step was already broken -- it never
installed Posh-SSH, and Get-PfbApiTokenViaSsh.Tests.ps1 mocks
New-SSHSession, which Pester can only mock if the module is
resolvable. 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

  • Added workflow_call to cross-platform-tests.yml so it can be
    invoked as a reusable workflow.
  • publish-to-gallery.yml now has a test job that calls
    cross-platform-tests.yml, and the publish job depends on it via
    needs: test. The old single-platform Pester/Posh-SSH step was
    removed entirely -- no test logic is duplicated across the two files.
  • Bumped actions/checkout from v4 to v7 in publish-to-gallery.yml
    to match update-api-capability-map.yml.

Test plan

  • Pushed a throwaway tag (v0.0.0-test-26) to my fork to fire the
    real push: tags: v* trigger end-to-end. All 4 test job
    scenarios passed (windows/Windows PowerShell 5.1, windows/pwsh,
    ubuntu/pwsh, macos/pwsh), confirming the workflow_call link
    works and the YAML parses correctly.
    https://github.com/juemerson-at-purestorage/fb-powershell/actions/runs/29935387950
  • publish job correctly no-op'd (repository guard) since the fork
    isn't the official upstream repo.
  • Tag deleted from the fork after validation.

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
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.

publish-to-gallery.yml test gate is missing Posh-SSH

1 participant