Skip to content

Commit cc38201

Browse files
authored
Merge branch 'develop' into fix/flush-buffers-without-transport
2 parents dbaf815 + b2033c0 commit cc38201

864 files changed

Lines changed: 16896 additions & 5209 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/e2e/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ All tests completed successfully. Your SDK changes work correctly with this test
116116

117117
- **No tarballs found**: Run `yarn build && yarn build:tarball` at repository root
118118
- **Test app not found**: List available apps and ask user to clarify
119-
- **Verdaccio not running**: Tests should start Verdaccio automatically, but if issues occur, check Docker
119+
- **Packed tarballs missing**: Run `yarn build:tarball` at the repo root, then `yarn test:prepare` in `dev-packages/e2e-tests`
120120
- **Build failures**: Fix build errors before running tests
121121

122122
## Common Test Applications

.cursor/BUGBOT.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ Do not flag the issues below if they appear in tests.
5858
- Flag usage of `expect.objectContaining` and other relaxed assertions, when a test expects something NOT to be included in a payload but there's no respective assertion.
5959
- Flag usage of conditionals in one test and recommend splitting up the test for the different paths.
6060
- Flag usage of loops testing multiple scenarios in one test and recommend using `(it)|(test).each` instead.
61+
- Flag tests that are likely to introduce flakes. In our case this usually means we wait for some telemetry requests sent from an SDK. Patterns to look out for:
62+
- Only waiting for a request, after an action is performed. Instead, start waiting, perform action, await request promise.
63+
- Race conditions when waiting on multiple requests. Ensure that waiting checks are unique enough and don't depend on a hard order when there's a chance that telemetry can be sent in arbitrary order.
64+
- Timeouts or sleeps in tests. Instead suggest concrete events or other signals to wait on.
65+
- Flag usage of `getFirstEnvelope*`, `getMultipleEnvelope*` or related test helpers. These are NOT reliable anymore. Instead suggest helpers like `waitForTransaction`, `waitForError`, `waitForSpans`, etc.
6166

6267
## Platform-safe code
6368

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: '[Flaky CI]: {{ env.JOB_NAME }} - {{ env.TEST_NAME }}'
3+
labels: Tests
4+
---
5+
6+
### Flakiness Type
7+
8+
Other / Unknown
9+
10+
### Name of Job
11+
12+
{{ env.JOB_NAME }}
13+
14+
### Name of Test
15+
16+
{{ env.TEST_NAME }}
17+
18+
### Link to Test Run
19+
20+
{{ env.RUN_LINK }}
21+
22+
---
23+
24+
_This issue was automatically created._

.github/actions/install-dependencies/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ runs:
1515
shell: bash
1616

1717
- name: Check dependency cache
18-
uses: actions/cache@v4
18+
uses: actions/cache@v5
1919
id: cache_dependencies
2020
with:
2121
path: ${{ env.CACHED_DEPENDENCY_PATHS }}

.github/actions/install-playwright/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
working-directory: ${{ inputs.cwd }}
1919

2020
- name: Restore cached playwright binaries
21-
uses: actions/cache/restore@v4
21+
uses: actions/cache/restore@v5
2222
id: playwright-cache
2323
with:
2424
path: |
@@ -43,7 +43,7 @@ runs:
4343

4444
# Only store cache on develop branch
4545
- name: Store cached playwright binaries
46-
uses: actions/cache/save@v4
46+
uses: actions/cache/save@v5
4747
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
4848
with:
4949
path: |

.github/actions/restore-cache/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ runs:
1111
steps:
1212
- name: Check dependency cache
1313
id: dep-cache
14-
uses: actions/cache/restore@v4
14+
uses: actions/cache/restore@v5
1515
with:
1616
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
1717
key: ${{ inputs.dependency_cache_key }}
1818

1919
- name: Restore build artifacts
20-
uses: actions/download-artifact@v4
20+
uses: actions/download-artifact@v7
2121
with:
2222
name: build-output
2323

.github/workflows/build.yml

Lines changed: 77 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ jobs:
152152
changed_node:
153153
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
154154
'@sentry/node') }}
155-
changed_node_overhead_action:
156-
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
157-
'@sentry-internal/node-overhead-gh-action') }}
158155
changed_deno:
159156
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
160157
'@sentry/deno') }}
161158
changed_bun:
162159
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
163160
'@sentry/bun') }}
161+
changed_bun_integration:
162+
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
163+
'@sentry-internal/bun-integration-tests') }}
164164
changed_browser_integration:
165165
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
166166
'@sentry-internal/browser-integration-tests') }}
@@ -208,37 +208,6 @@ jobs:
208208
# Only run comparison against develop if this is a PR
209209
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
210210

211-
job_node_overhead_check:
212-
name: Node Overhead Check
213-
needs: [job_get_metadata, job_build]
214-
timeout-minutes: 15
215-
runs-on: ubuntu-24.04
216-
if:
217-
(needs.job_build.outputs.changed_node == 'true' && github.event_name == 'pull_request') ||
218-
(needs.job_build.outputs.changed_node_overhead_action == 'true' && github.event_name == 'pull_request') ||
219-
needs.job_get_metadata.outputs.is_base_branch == 'true' || needs.job_get_metadata.outputs.is_release == 'true'
220-
steps:
221-
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
222-
uses: actions/checkout@v6
223-
with:
224-
ref: ${{ env.HEAD_COMMIT }}
225-
- name: Set up Node
226-
uses: actions/setup-node@v6
227-
with:
228-
node-version-file: 'package.json'
229-
- name: Restore caches
230-
uses: ./.github/actions/restore-cache
231-
with:
232-
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
233-
- name: Check node overhead
234-
uses: ./dev-packages/node-overhead-gh-action
235-
env:
236-
DEBUG: '1'
237-
with:
238-
github_token: ${{ secrets.GITHUB_TOKEN }}
239-
# Only run comparison against develop if this is a PR
240-
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
241-
242211
job_lint:
243212
name: Lint
244213
# Even though the linter only checks source code, not built code, it needs the built code in order check that all
@@ -605,6 +574,7 @@ jobs:
605574
with:
606575
token: ${{ secrets.GITHUB_TOKEN }}
607576
directory: dev-packages/browser-integration-tests
577+
enable-coverage: false
608578
name:
609579
browser-playwright-${{ matrix.bundle }}-${{ matrix.project }}${{ matrix.shard && format('-{0}',
610580
matrix.shard) || '' }}
@@ -669,6 +639,7 @@ jobs:
669639
with:
670640
token: ${{ secrets.GITHUB_TOKEN }}
671641
directory: dev-packages/browser-integration-tests
642+
enable-coverage: false
672643
name: browser-loader-${{ matrix.bundle }}
673644

674645
job_check_for_faulty_dts:
@@ -737,15 +708,6 @@ jobs:
737708
working-directory: dev-packages/node-integration-tests
738709
run: yarn test
739710

740-
- name: Parse and Upload Coverage
741-
if: cancelled() == false
742-
continue-on-error: true
743-
uses: getsentry/codecov-action@main
744-
with:
745-
token: ${{ secrets.GITHUB_TOKEN }}
746-
directory: dev-packages/node-integration-tests
747-
name: node-integration-${{ matrix.node }}${{ matrix.typescript && format('-ts{0}', matrix.typescript) || '' }}
748-
749711
job_node_core_integration_tests:
750712
name:
751713
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }} Node-Core
@@ -787,16 +749,6 @@ jobs:
787749
working-directory: dev-packages/node-core-integration-tests
788750
run: yarn test
789751

790-
- name: Parse and Upload Coverage
791-
if: cancelled() == false
792-
continue-on-error: true
793-
uses: getsentry/codecov-action@main
794-
with:
795-
token: ${{ secrets.GITHUB_TOKEN }}
796-
directory: dev-packages/node-core-integration-tests
797-
name:
798-
node-core-integration-${{ matrix.node }}${{ matrix.typescript && format('-ts{0}', matrix.typescript) || ''}}
799-
800752
job_cloudflare_integration_tests:
801753
name: Cloudflare Integration Tests
802754
needs: [job_get_metadata, job_build]
@@ -820,6 +772,32 @@ jobs:
820772
working-directory: dev-packages/cloudflare-integration-tests
821773
run: yarn test
822774

775+
job_bun_integration_tests:
776+
name: Bun Integration Tests
777+
needs: [job_get_metadata, job_build]
778+
if: needs.job_build.outputs.changed_bun_integration == 'true' || github.event_name != 'pull_request'
779+
runs-on: ubuntu-24.04
780+
timeout-minutes: 15
781+
steps:
782+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
783+
uses: actions/checkout@v6
784+
with:
785+
ref: ${{ env.HEAD_COMMIT }}
786+
- name: Set up Node
787+
uses: actions/setup-node@v6
788+
with:
789+
node-version-file: 'package.json'
790+
- name: Set up Bun
791+
uses: oven-sh/setup-bun@v2
792+
- name: Restore caches
793+
uses: ./.github/actions/restore-cache
794+
with:
795+
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
796+
797+
- name: Run integration tests
798+
working-directory: dev-packages/bun-integration-tests
799+
run: yarn test
800+
823801
job_remix_integration_tests:
824802
name: Remix (Node ${{ matrix.node }}) Tests
825803
needs: [job_get_metadata, job_build]
@@ -856,15 +834,6 @@ jobs:
856834
cd packages/remix
857835
yarn test:integration:ci
858836
859-
- name: Parse and Upload Coverage
860-
if: cancelled() == false
861-
continue-on-error: true
862-
uses: getsentry/codecov-action@main
863-
with:
864-
directory: packages/remix
865-
token: ${{ secrets.GITHUB_TOKEN }}
866-
name: ${{ matrix.node }}
867-
868837
job_e2e_prepare:
869838
name: Prepare E2E tests
870839
# We want to run this if:
@@ -961,7 +930,9 @@ jobs:
961930
with:
962931
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
963932
- name: Set up Bun
964-
if: contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun"]'), matrix.test-application)
933+
if:
934+
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4"]'),
935+
matrix.test-application)
965936
uses: oven-sh/setup-bun@v2
966937
- name: Set up AWS SAM
967938
if: matrix.test-application == 'aws-serverless'
@@ -970,7 +941,7 @@ jobs:
970941
use-installer: true
971942
token: ${{ secrets.GITHUB_TOKEN }}
972943
- name: Set up Deno
973-
if: matrix.test-application == 'deno'
944+
if: matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed'
974945
uses: denoland/setup-deno@v2.0.3
975946
with:
976947
deno-version: v2.1.5
@@ -990,25 +961,24 @@ jobs:
990961
if: steps.restore-tarball-cache.outputs.cache-hit != 'true'
991962
run: yarn build:tarball
992963

993-
- name: Get node version
994-
id: versions
995-
run: |
996-
echo "echo node=$(jq -r '.volta.node' dev-packages/e2e-tests/package.json)" >> $GITHUB_OUTPUT
997-
998-
- name: Validate Verdaccio
999-
run: yarn test:validate
964+
- name: Prepare e2e tests
965+
run: yarn test:prepare
1000966
working-directory: dev-packages/e2e-tests
1001967

1002-
- name: Prepare Verdaccio
1003-
run: yarn test:prepare
968+
- name: Validate e2e tests setup
969+
run: yarn test:validate
1004970
working-directory: dev-packages/e2e-tests
1005-
env:
1006-
E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION: ${{ steps.versions.outputs.node }}
1007971

1008972
- name: Copy to temp
1009973
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
1010974
working-directory: dev-packages/e2e-tests
1011975

976+
- name: Add pnpm overrides
977+
run:
978+
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
979+
}}/dev-packages/e2e-tests/packed
980+
working-directory: dev-packages/e2e-tests
981+
1012982
- name: Build E2E app
1013983
working-directory: ${{ runner.temp }}/test-application
1014984
timeout-minutes: 7
@@ -1053,15 +1023,6 @@ jobs:
10531023
retention-days: 7
10541024
if-no-files-found: ignore
10551025

1056-
- name: Parse and Upload Coverage
1057-
if: cancelled() == false
1058-
continue-on-error: true
1059-
uses: getsentry/codecov-action@main
1060-
with:
1061-
directory: dev-packages/e2e-tests
1062-
token: ${{ secrets.GITHUB_TOKEN }}
1063-
name: e2e-${{ matrix.test-application }}
1064-
10651026
# - We skip optional tests on release branches
10661027
job_optional_e2e_tests:
10671028
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
@@ -1116,25 +1077,24 @@ jobs:
11161077
if: steps.restore-tarball-cache.outputs.cache-hit != 'true'
11171078
run: yarn build:tarball
11181079

1119-
- name: Get node version
1120-
id: versions
1121-
run: |
1122-
echo "echo node=$(jq -r '.volta.node' dev-packages/e2e-tests/package.json)" >> $GITHUB_OUTPUT
1123-
1124-
- name: Validate Verdaccio
1125-
run: yarn test:validate
1080+
- name: Prepare E2E tests
1081+
run: yarn test:prepare
11261082
working-directory: dev-packages/e2e-tests
11271083

1128-
- name: Prepare Verdaccio
1129-
run: yarn test:prepare
1084+
- name: Validate test setup
1085+
run: yarn test:validate
11301086
working-directory: dev-packages/e2e-tests
1131-
env:
1132-
E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION: ${{ steps.versions.outputs.node }}
11331087

11341088
- name: Copy to temp
11351089
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
11361090
working-directory: dev-packages/e2e-tests
11371091

1092+
- name: Add pnpm overrides
1093+
run:
1094+
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
1095+
}}/dev-packages/e2e-tests/packed
1096+
working-directory: dev-packages/e2e-tests
1097+
11381098
- name: Build E2E app
11391099
working-directory: ${{ runner.temp }}/test-application
11401100
timeout-minutes: 7
@@ -1178,6 +1138,7 @@ jobs:
11781138
job_node_integration_tests,
11791139
job_node_core_integration_tests,
11801140
job_cloudflare_integration_tests,
1141+
job_bun_integration_tests,
11811142
job_browser_playwright_tests,
11821143
job_browser_loader_tests,
11831144
job_remix_integration_tests,
@@ -1192,7 +1153,28 @@ jobs:
11921153
# Always run this, even if a dependent job failed
11931154
if: always()
11941155
runs-on: ubuntu-24.04
1156+
permissions:
1157+
issues: write
1158+
checks: read
11951159
steps:
1160+
- name: Check out current commit
1161+
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
1162+
uses: actions/checkout@v6
1163+
with:
1164+
sparse-checkout: |
1165+
.github
1166+
scripts
1167+
1168+
- name: Create issues for failed jobs
1169+
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
1170+
uses: actions/github-script@v7
1171+
with:
1172+
script: |
1173+
const { default: run } = await import(
1174+
`${process.env.GITHUB_WORKSPACE}/scripts/report-ci-failures.mjs`
1175+
);
1176+
await run({ github, context, core });
1177+
11961178
- name: Check for failures
11971179
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
11981180
run: |

0 commit comments

Comments
 (0)