Skip to content

Commit 98c1e36

Browse files
authored
test(updater): Accept either main or master as sentry-cli main branch (#167)
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.
1 parent d81d746 commit 98c1e36

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

updater/tests/update-dependency.Tests.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ switch ($action)
220220
$output | Should -Contain 'latestTag=0.28.0'
221221
$output | Should -Contain 'latestTagNice=v0.28.0'
222222
$output | Should -Contain 'url=https://github.com/getsentry/sentry-cli'
223-
$output | Should -Contain 'mainBranch=main'
223+
# sentry-cli has both `main` and `master`; which one is reported depends on
224+
# which currently points at HEAD upstream, so accept either.
225+
($output | Where-Object { $_ -like 'mainBranch=*' }) | Should -BeIn @('mainBranch=main', 'mainBranch=master')
224226
}
225227
}
226228

0 commit comments

Comments
 (0)