Skip to content

Commit 7bf78a0

Browse files
cursoragentclaude
andcommitted
fix(node-core): Neutralize higher-priority env vars in getSentryRelease tests
Tests now stub GITHUB_SHA to empty string to prevent CI environment variables from interfering with Heroku env var tests. This ensures tests pass reliably on GitHub Actions and other CI environments where git provider env vars are pre-set. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent 0f60aad commit 7bf78a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/node-core/test/sdk/getSentryRelease.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,21 @@ afterEach(() => {
77

88
describe('getSentryRelease', () => {
99
it('uses HEROKU_BUILD_COMMIT env var', () => {
10+
vi.stubEnv('GITHUB_SHA', '');
1011
vi.stubEnv('HEROKU_BUILD_COMMIT', 'heroku-build-commit-sha');
1112

1213
expect(getSentryRelease()).toBe('heroku-build-commit-sha');
1314
});
1415

1516
it('falls back to HEROKU_SLUG_COMMIT if HEROKU_BUILD_COMMIT is not set', () => {
17+
vi.stubEnv('GITHUB_SHA', '');
1618
vi.stubEnv('HEROKU_SLUG_COMMIT', 'heroku-slug-commit-sha');
1719

1820
expect(getSentryRelease()).toBe('heroku-slug-commit-sha');
1921
});
2022

2123
it('prefers HEROKU_BUILD_COMMIT over HEROKU_SLUG_COMMIT', () => {
24+
vi.stubEnv('GITHUB_SHA', '');
2225
vi.stubEnv('HEROKU_BUILD_COMMIT', 'heroku-build-commit-sha');
2326
vi.stubEnv('HEROKU_SLUG_COMMIT', 'heroku-slug-commit-sha');
2427

0 commit comments

Comments
 (0)