Skip to content

Commit 38b327b

Browse files
authored
test: avoid depending on external repo changelog contents (#69)
1 parent 3bf9d4b commit 38b327b

File tree

1 file changed

+26
-29
lines changed

1 file changed

+26
-29
lines changed

updater/tests/get-changelog.ps1

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,60 @@
11
. "$PSScriptRoot/common/test-utils.ps1"
22

3-
RunTest "get-changelog with existing versions" {
3+
RunTest 'get-changelog with existing versions' {
44
$actual = & "$PSScriptRoot/../scripts/get-changelog.ps1" `
5-
-RepoUrl "https://github.com/getsentry/sentry-javascript" -OldTag "7.4.0" -NewTag "7.5.1"
5+
-RepoUrl 'https://github.com/getsentry/github-workflows' -OldTag '1.0.0' -NewTag '2.1.0'
66
$expected = @'
77
## Changelog
8-
### 7.5.1
8+
### 2.1.0
99
10-
This release removes the `user_id` and the `transaction` field from the dynamic sampling context data that is attached to outgoing requests as well as sent to Relay.
10+
#### Features
1111
12-
- ref(tracing): Remove transaction name and user_id from DSC ([#5363](https://github-redirect.dependabot.com/getsentry/sentry-javascript/issues/5363))
12+
- New reusable workflow, `danger.yml`, to check Pull Requests with predefined rules ([#34](https://github-redirect.dependabot.com/getsentry/github-workflows/pull/34))
1313
14-
### 7.5.0
14+
### 2.0.0
1515
16-
This release adds the `sendDefaultPii` flag to the `Sentry.init` options.
17-
When using performance monitoring capabilities of the SDK, it controls whether user IDs (set via `Sentry.setUser`) are propagated in the `baggage` header of outgoing HTTP requests.
18-
This flag is set to `false` per default, and acts as an opt-in mechanism for sending potentially sensitive data.
19-
If you want to attach user IDs to Sentry transactions and traces, set this flag to `true` but keep in mind that this is potentially sensitive information.
16+
#### Changes
2017
21-
- feat(sdk): Add sendDefaultPii option to the JS SDKs ([#5341](https://github-redirect.dependabot.com/getsentry/sentry-javascript/issues/5341))
22-
- fix(remix): Sourcemaps upload script is missing in the tarball ([#5356](https://github-redirect.dependabot.com/getsentry/sentry-javascript/issues/5356))
23-
- fix(remix): Use cjs for main entry point ([#5352](https://github-redirect.dependabot.com/getsentry/sentry-javascript/issues/5352))
24-
- ref(tracing): Only add `user_id` to DSC if `sendDefaultPii` is `true` ([#5344](https://github-redirect.dependabot.com/getsentry/sentry-javascript/issues/5344))
18+
- Rename `api_token` secret to `api-token` ([#21](https://github-redirect.dependabot.com/getsentry/github-workflows/pull/21))
19+
- Change changelog target section header from "Features" to "Dependencies" ([#19](https://github-redirect.dependabot.com/getsentry/github-workflows/pull/19))
2520
26-
Work in this release contributed by jkcorrea and nfelger. Thank you for your contributions!
21+
#### Features
2722
28-
### 7.4.1
23+
- Add `pr-strategy` switch to choose between creating new PRs or updating an existing one ([#22](https://github-redirect.dependabot.com/getsentry/github-workflows/pull/22))
24+
- Add `changelog-section` input setting to specify target changelog section header ([#19](https://github-redirect.dependabot.com/getsentry/github-workflows/pull/19))
2925
30-
This release includes the first _published_ version of `sentry/remix`.
26+
#### Fixes
3127
32-
- build(remix): Make remix package public ([#5349](https://github-redirect.dependabot.com/getsentry/sentry-javascript/issues/5349))
28+
- Preserve changelog bullet-point format ([#20](https://github-redirect.dependabot.com/getsentry/github-workflows/pull/20))
29+
- Changelog section parsing when an entry text contains the section name in the text ([#25](https://github-redirect.dependabot.com/getsentry/github-workflows/pull/25))
3330
'@
3431

3532
AssertEqual $expected $actual
3633
}
3734

38-
RunTest "get-changelog with missing versions" {
35+
RunTest 'get-changelog with missing versions' {
3936
$actual = & "$PSScriptRoot/../scripts/get-changelog.ps1" `
40-
-RepoUrl "https://github.com/getsentry/sentry-javascript" -OldTag "XXXXXXX" -NewTag "YYYYYYYYY"
37+
-RepoUrl 'https://github.com/getsentry/sentry-javascript' -OldTag 'XXXXXXX' -NewTag 'YYYYYYYYY'
4138
AssertEqual '' $actual
4239
}
4340

44-
RunTest "get-changelog with missing repo" {
41+
RunTest 'get-changelog with missing repo' {
4542
$actual = & "$PSScriptRoot/../scripts/get-changelog.ps1" `
46-
-RepoUrl "https://github.com/getsentry/foo-bar" -OldTag "XXXXXXX" -NewTag "YYYYYYYYY"
43+
-RepoUrl 'https://github.com/getsentry/foo-bar' -OldTag 'XXXXXXX' -NewTag 'YYYYYYYYY'
4744
# May print a warning but still returns (an empty string)
4845
AssertEqual '' $actual
4946
}
5047

51-
RunTest "get-changelog with unsupported repo" {
48+
RunTest 'get-changelog with unsupported repo' {
5249
$actual = & "$PSScriptRoot/../scripts/get-changelog.ps1" `
53-
-RepoUrl "https://dart.googlesource.com/args" -OldTag "XXXXXXX" -NewTag "YYYYYYYYY"
50+
-RepoUrl 'https://dart.googlesource.com/args' -OldTag 'XXXXXXX' -NewTag 'YYYYYYYYY'
5451
# May print a warning but still returns (an empty string)
5552
AssertEqual '' $actual
5653
}
5754

58-
RunTest "get-changelog removes at-mentions" {
55+
RunTest 'get-changelog removes at-mentions' {
5956
$actual = & "$PSScriptRoot/../scripts/get-changelog.ps1" `
60-
-RepoUrl "https://github.com/getsentry/sentry-cli" -OldTag "2.1.0" -NewTag "2.2.0"
57+
-RepoUrl 'https://github.com/getsentry/sentry-cli' -OldTag '2.1.0' -NewTag '2.2.0'
6158
$expected = @'
6259
## Changelog
6360
### 2.2.0
@@ -73,7 +70,7 @@ RunTest "get-changelog removes at-mentions" {
7370

7471
RunTest "get-changelog removes doesn't duplicate PR links" {
7572
$actual = & "$PSScriptRoot/../scripts/get-changelog.ps1" `
76-
-RepoUrl "https://github.com/getsentry/sentry-native" -OldTag "0.4.16" -NewTag "0.4.17"
73+
-RepoUrl 'https://github.com/getsentry/sentry-native' -OldTag '0.4.16' -NewTag '0.4.17'
7774
$expected = @'
7875
## Changelog
7976
### 0.4.17
@@ -92,9 +89,9 @@ Features, fixes and improvements in this release have been contributed by:
9289
AssertEqual $expected $actual
9390
}
9491

95-
RunTest "get-changelog truncates too long text" {
92+
RunTest 'get-changelog truncates too long text' {
9693
$actual = & "$PSScriptRoot/../scripts/get-changelog.ps1" `
97-
-RepoUrl "https://github.com/getsentry/sentry-cli" -OldTag "1.0.0" -NewTag "2.4.0"
94+
-RepoUrl 'https://github.com/getsentry/sentry-cli' -OldTag '1.0.0' -NewTag '2.4.0'
9895
if ($actual.Length -gt 61000)
9996
{
10097
throw "Expected the content to be truncated to less-than 61k characters, but got: $($actual.Length)"

0 commit comments

Comments
 (0)