Skip to content

About

Synthetic GitHub Actions integration tests for PSModule/Release-GHRepository.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Release-GHRepository-Test

This public repository tests Release-GHRepository on GitHub Actions. It contains only synthetic data. Use it to verify a pinned action candidate before the producer publishes it. Test releases and tags belong to this repository only.

Run a case

  1. Dispatch the Shelly fixture driver from main in the producer repository. Select a scenario and, if needed, a same-repository producer PR to test. Shelly opens a fixture PR with that exact action SHA.
  2. Wait for a schema 2 release-fixture-result comment from github-actions[bot] with oracle: "success" and verified: true. Match its case ID, candidate SHA, PR head, and event. For cases that need a label, use the labeled report. The opening event without the label runs only the fixture tests.
  3. For a push case, follow the normal review rules and squash-merge the fixture PR. Run the producer driver again with the fixture PR number to verify the report for the exact squash commit. Close the missing-decision PR without merging it. Run one case at a time; each case compares the whole test release and tag inventory before and after the run.
Case Release label Expected result
preview release:patch Plan and CI pass. Publish previews the tested commit after merge and creates no tag or release.
staged release:patch After merge, Publish consumes the same-run plan and creates one stable release and tag at the tested commit.
one-step release:patch After merge, Publish calculates on demand and writes the same version Plan previewed, at the exact tested commit.
configured-default None Plan uses the explicit DefaultBump: patch. After merge, the staged publisher creates the release and tag.
missing-decision None A Calculate run with DefaultBump: patch succeeds. Without the default, Calculate fails. CI still runs and Verify confirms that no release or tag was created.
skip release:skip Plan returns skip. CI passes and Publish does not run. The release and tag inventory is unchanged.
ci-failure release:patch The PR can pass CI. After merge, CI fails deliberately on the pushed commit. Publish does not run and the inventory is unchanged.

Use Verify the fixture result or its PR report as the verdict. The overall run fails for a deliberate missing decision or push CI failure. A missing report is not a pass. The driver reads PR comments without Actions permissions. Follow run in the report to see the separate jobs.

Start with staged to publish a stable release at fixture main. Run missing-decision and configured-default only when main points to a published stable release. After a maintenance merge or a case that did not publish, use another explicit patch case to establish a new baseline. Keep test tags and releases as evidence. Use a new case instead of rerunning a push that already published.

Legacy baseline

This layer follows fixture PR #3 and comes before the producer layers and the live comparison. Legacy-Baseline.yml verifies the published v2.0.3 (750abed0ecab02394554b610dc3aa191e75e3248) on pull requests with no write token and no release write. It never publishes.

Job Evidence
Simulated Runs the unchanged src/main.ps1 from the pinned checkout. A synthetic merged-PR event drives it. gh and git are doubles that answer the two read calls and record every other call as a write. Tests: tests-baseline. The real GitHub module supplies LogGroup.
WhatIf Runs the real composite with WhatIf: true and a contents: read token. It compares the release and tag inventory before and after.

The Simulated job covers these scenarios with the legacy inputs (AutoPatching, AutoCleanup and both alias tags off, PatchLabels: release:patch): explicit patch, first stable tag v0.0.1 and a bump of the latest tag, preview with no writes, the NoRelease skip, an unnamespaced major label that overrides the patch label, and unmerged or non-main PRs. It also shows what the default inputs do: auto-patching, release:skip ignored, alias tags moved with git tag -f, and a configuration file that overrides the inputs.

Known v2.0.3 behavior that the candidate changes on purpose:

  • With AutoPatching off (the lane setting) and no deciding label, the "Skipping release creation" branch does not skip. It only leaves its LogGroup block, and the script attempts the unchanged version (v0.0.0 on an empty inventory, or the latest tag again, which gh rejects). This is command evidence from the doubles. The released defaults (AutoPatching on) patch without a label. The candidate requires a decision.
  • release:skip is unknown to v2.0.3. With auto-patching on, it still releases.
  • The source of a release is the tip of main when gh release create runs. The doubles cannot show it. Only a hosted write run of the legacy lane can.

The legacy lane below provides the hosted write evidence: one stable tag at the exact squash commit. The staged plan and the push CI gate exist only in the candidate. No legacy equivalent exists for those cases, so the baseline does not cover them. The doubles prove the logic only. They do not prove GitHub permissions, tag targets or the git push.

Run the baseline locally with the pinned checkout:

git clone https://github.com/PSModule/Release-GHRepository.git "$env:TEMP/legacy-action"
git -C "$env:TEMP/legacy-action" checkout 750abed0ecab02394554b610dc3aa191e75e3248
Install-PSResource -Name GitHub, PSSemVer, powershell-yaml -TrustRepository
$env:LEGACY_ACTION_PATH = "$env:TEMP/legacy-action"
Invoke-Pester -Path .\tests-baseline

Maintain the suite

tests/FixtureContract.json lists the supported cases and their labels. Shelly opens a same-repository PR from release-fixture/<run-id>-<attempt> to main. It adds tests/cases/<run-id>-<attempt>.json with scenario and candidate. On a push, the suite selects a case only from the Shelly PR merged at that commit. Other PRs and pushes run the fixture tests but do not run the action.

Release-Test.yml checks out the public producer at the exact candidate SHA and runs the local action. Only the Publish job can write fixture tags and releases. Only the Verify job can add reports to the fixture PR. The fixture does not mint or use Shelly's token. Never add app credentials or real release data to this repository.

Legacy lane

Legacy-Release-Test.yml tests the published v2.0.3 composite (PSModule/Release-GHRepository@750abed0ecab02394554b610dc3aa191e75e3248) on a real merged pull request in this repository. It does not use a separate repository.

Routing: a case file whose candidate is the v2.0.3 SHA belongs to the legacy lane. The candidate lane skips it. Any other case belongs to the candidate lane, and the legacy lane skips it. Each case runs in exactly one lane.

  • Both lanes share one concurrency group and one release and tag inventory. v2.0.3 bumps the patch number of the latest release, or starts at v0.0.1. The Gate job calculates that tag from the inventory, and Verify expects exactly that one new stable release and tag at the squash commit.
  • Use normal review. Do not merge any other PR while a legacy case runs. gh release create tags the current tip of main, so a concurrent merge breaks the case. Gate and Publish stop if main is not the squash commit.
  • Shelly opens release-fixture/<run-id>-<attempt> with release:patch as the only label. v2.0.3 also reads major, breaking, minor, feature and NoRelease, so any other label fails the case. Select also fails if .github/auto-release.yml exists at the squash, because v2.0.3 lets that file override the workflow inputs. The PR adds only tests/cases/<run-id>-<attempt>.json with {"scenario":"one-step","candidate":"750abed0ecab02394554b610dc3aa191e75e3248"}. A verified single-parent squash must contain the same file.

Read-only jobs select the case, test the exact squash commit, and gate on current main and the expected tag. Only Publish has contents: write. It uses only GITHUB_TOKEN, with AutoPatching, AutoCleanup, and the alias tags turned off. v2.0.3 runs git push origin --tags, which fails without credentials, so only Publish persists the job token at checkout. Verify reports a schema 2 release-fixture-result comment on the PR.

Upgrade tracking

To see what an upgrade needs, run the same scenario twice: once with the legacy SHA and once with the candidate SHA. Compare the two reports (candidate, tag, run). The differences that the candidate introduces:

Area v2.0.3 (legacy) Candidate
Inputs No Mode, DefaultBump or ReleasePlan Has all three
Staged plan and push CI gate None Yes
No deciding label Patches when AutoPatching is on Requires a decision
release:skip Unknown Supported
major, minor, NoRelease and similar labels Read without a prefix Namespaced
Release source Tip of main when gh release create runs Exact squash commit
Run the case selection and inventory tests without GitHub credentials:
Import-Module -Name Pester -RequiredVersion 6.1.0
Invoke-Pester -Path .\tests

About

Synthetic GitHub Actions integration tests for PSModule/Release-GHRepository.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages