Skip to content

test(updater): Accept either main or master as sentry-cli main branch#167

Merged
vaind merged 1 commit intomainfrom
fix/updater-test-flaky-mainbranch
May 11, 2026
Merged

test(updater): Accept either main or master as sentry-cli main branch#167
vaind merged 1 commit intomainfrom
fix/updater-test-flaky-mainbranch

Conversation

@vaind
Copy link
Copy Markdown
Contributor

@vaind vaind commented May 11, 2026

Summary

The Updater @ {ubuntu,macos,windows} jobs in Script Tests have been failing on main since #165 was merged (failing run):

Expected 'mainBranch=main' to be found in collection
@('originalTag=0', 'latestTag=0.28.0', 'latestTagNice=v0.28.0',
  'url=https://github.com/getsentry/sentry-cli', 'mainBranch=master'),
but it was not found.

Why it didn't fail on the PR

The test asserts against the live state of getsentry/sentry-cli via git ls-remote. At PR time (2026-05-07), both main and master of sentry-cli pointed at the same HEAD commit, so the SHA filter matched both refs and the new Select-Object -First 1 returned main (alphabetically first). At post-merge time (2026-05-11), sentry-cli's main and master no longer share a SHA — only master matches HEAD — so the script now emits mainBranch=master.

HEAD                660e98b...   (same as master)
refs/heads/main     54eefbd...   (different)
refs/heads/master   660e98b...

Fix

Accept either mainBranch=main or mainBranch=master rather than baking transient upstream branch state into the assertion.

Test plan

  • All 34 Pester tests pass locally on macOS (Invoke-Pester on update-dependency.Tests.ps1)
  • Script Tests pass in CI on Ubuntu, macOS, Windows

The `writes output` / `writes to env:GITHUB_OUTPUT` tests assert against
the live state of getsentry/sentry-cli via `git ls-remote`. Whether the
script reports `main` or `master` depends on which of the two currently
points at the upstream HEAD, which flips over time. PR #165 baked
`main` into the assertion while both happened to point at HEAD; sentry-cli
has since diverged and post-merge CI on main now reports `master`,
failing the test.

Accept either branch name so the test isn't coupled to transient
upstream branch state.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

Warnings
⚠️ Could not load custom Dangerfile: .github/test-dangerfile-curl.js Error: ENOENT: no such file or directory, lstat '/github/workspace/.github/test-dangerfile-curl.js'

Generated by 🚫 dangerJS against 54d66d9

@vaind vaind merged commit 98c1e36 into main May 11, 2026
24 checks passed
@vaind vaind deleted the fix/updater-test-flaky-mainbranch branch May 11, 2026 09:40
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.

1 participant