GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(e2e): Run nestjs-12 on Bun, Deno and Cloudflare (#26283) · getsentry/sentry-javascript@8832e97

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github
    • actions/prepare-e2e-test
      • action.yml
    • workflows
      • build.yml
      • canary.yml
      • optional-e2e.yml
  • dev-packages/e2e-tests
    • README.md
    • test-applications/nestjs-12
      • .gitignore
      • bun-build.mjs
      • deno.json
      • package.json
      • playwright.config.mjs
      • pnpm-workspace.yaml
      • src
        • app.controller.ts
        • instrument.bun.ts
        • instrument.deno.ts
      • tests
        • constants.ts
        • cron-decorator.test.ts
        • request.test.ts
        • span-decorator.test.ts
        • spans.test.ts
      • tsconfig.build.json
      • vite.config.ts
      • workers
        • app.ts
        • instrument.server.ts
      • wrangler.jsonc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/actions/prepare-e2e-test/action.yml‎

Copy file name to clipboardExpand all lines: .github/actions/prepare-e2e-test/action.yml
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ inputs:
99
runtime:
1010
description: 'The `runtime` of a runtime variant, see dev-packages/e2e-tests/README.md.'
1111
default: ''
12+
bun-version:
13+
description: 'The Bun version to install, if the application needs Bun.'
14+
default: '1.3.14'
1215
deno-version:
1316
description: 'The Deno version to install, if the application needs Deno.'
1417
default: 'v2.8.3'
@@ -32,7 +35,7 @@ runs:
3235
== 'bun'
3336
uses: oven-sh/setup-bun@v2
3437
with:
35-
bun-version: '1.3.14'
38+
bun-version: ${{ inputs.bun-version || '1.3.14' }}
3639
- name: Set up AWS SAM
3740
if: contains(inputs.test-application, 'aws-serverless')
3841
uses: aws-actions/setup-sam@v3
Collapse file

‎.github/workflows/build.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/build.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ jobs:
10841084
with:
10851085
test-application: ${{ matrix.test-application }}
10861086
runtime: ${{ matrix.runtime }}
1087+
bun-version: ${{ matrix.bun-version }}
10871088
deno-version: ${{ matrix.deno-version }}
10881089

10891090
# Installs Playwright while the app builds. Keep it right before the build: the runner sets up a background
Collapse file

‎.github/workflows/canary.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/canary.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
with:
102102
test-application: ${{ matrix.test-application }}
103103
runtime: ${{ matrix.runtime }}
104+
bun-version: ${{ matrix.bun-version }}
104105
deno-version: ${{ matrix.deno-version }}
105106

106107
- name: Build E2E app
Collapse file

‎.github/workflows/optional-e2e.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/optional-e2e.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
with:
8080
test-application: ${{ matrix.test-application }}
8181
runtime: ${{ matrix.runtime }}
82+
bun-version: ${{ matrix.bun-version }}
8283
deno-version: ${{ matrix.deno-version }}
8384
artifacts-run-id: ${{ inputs.build_run_id }}
8485
github-token: ${{ github.token }}
Collapse file

‎dev-packages/e2e-tests/README.md‎

Copy file name to clipboardExpand all lines: dev-packages/e2e-tests/README.md
+5-2Lines changed: 5 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,13 @@ is the reference setup.
207207
replaces `vite.config.ts`. For a variant with `runtime`, the runner copies these files over the others in the
208208
temporary copy of the app, before the build. This needs no framework or bundler config. A build in the app folder
209209
itself does not get these files, so run a variant with `pnpm run test:run <app> --variant <runtime>`.
210-
- **Deno version**: a variant can pin the Deno version, for example `"deno-version": "v2.9.0"`.
210+
- **Bun and Deno versions**: a variant can pin the Bun or Deno version, for example `"bun-version": "1.4.4"` or
211+
`"deno-version": "v2.9.0"`.
211212
- **Bun**: under `bun run` the SDK cannot inject diagnostics channels into packages that stay outside the build (for
212213
example Express behind `react-router-serve`), so those produce no spans on Bun. Where a test depends on them, branch
213-
on `RUNTIME` and say why in a comment.
214+
on `RUNTIME` and say why in a comment. An app that starts its own server can instead bundle it with
215+
`@sentry/bun/plugin`, as `nestjs-12/bun-build.mjs` does. Bun 1.3 renames classes in bundles (`class Foo2`), which
216+
changes span names taken from class names, so `nestjs-12` pins Bun 1.4 (see #26289).
214217

215218
```json
216219
"sentryTest": {
Collapse file

‎dev-packages/e2e-tests/test-applications/nestjs-12/.gitignore‎

Copy file name to clipboardExpand all lines: dev-packages/e2e-tests/test-applications/nestjs-12/.gitignore
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# compiled output
22
/dist
3+
/dist-bun
4+
/dist-cloudflare
5+
/.wrangler
36
/node_modules
47
/build
58

Collapse file

‎dev-packages/e2e-tests/test-applications/nestjs-12/bun-build.mjs‎

Copy file name to clipboard
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Bundles the `nest build` output with `@sentry/bun/plugin`. Under `bun run` the SDK cannot inject
2+
// diagnostics channels into packages, so only a bundled app gets the Nest and Express spans.
3+
import { sentryBunPlugin } from '@sentry/bun/plugin';
4+
import { join } from 'node:path';
5+
6+
await Bun.build({
7+
entrypoints: [join(import.meta.dir, 'dist/main.js')],
8+
target: 'bun',
9+
outdir: join(import.meta.dir, 'dist-bun'),
10+
// The bundler resolves Nest's optional `require` calls at build time. `@nestjs/websockets`,
11+
// `class-transformer`, `class-validator` and `cache-manager` are not installed. `@nestjs/microservices`
12+
// is installed for `RpcException`, but it loads transports (`kafkajs`, `@grpc/grpc-js`, ...) that are not.
13+
external: [
14+
'@nestjs/microservices',
15+
'@nestjs/microservices/*',
16+
'@nestjs/websockets',
17+
'@nestjs/websockets/*',
18+
'class-transformer',
19+
'class-validator',
20+
'cache-manager',
21+
],
22+
plugins: [sentryBunPlugin({ telemetry: false })],
23+
});
Collapse file

‎dev-packages/e2e-tests/test-applications/nestjs-12/deno.json‎

Copy file name to clipboard
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"imports": {
3+
"@sentry/deno/import": "./node_modules/@sentry/deno/build/import.mjs"
4+
},
5+
"nodeModulesDir": "manual"
6+
}
Collapse file

‎dev-packages/e2e-tests/test-applications/nestjs-12/package.json‎

Copy file name to clipboardExpand all lines: dev-packages/e2e-tests/test-applications/nestjs-12/package.json
+28-1Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
"scripts": {
77
"build": "nest build",
88
"start": "node --import ./dist/instrument.js dist/main.js",
9+
"start:bun": "bun dist-bun/main.js",
10+
"start:deno": "deno run -A --preload=@sentry/deno/import --preload=./dist/instrument.js dist/main.js",
11+
"start:cloudflare": "wrangler dev --config ./dist-cloudflare/nestjs_12/wrangler.json --port 3030",
912
"start:dev": "nest start --watch",
1013
"start:debug": "nest start --debug --watch",
1114
"start:prod": "node dist/main",
1215
"clean": "npx rimraf node_modules pnpm-lock.yaml",
1316
"test": "playwright test",
1417
"test:build": "pnpm install && pnpm build",
18+
"test:build:bun": "pnpm install && pnpm build && bun ./bun-build.mjs",
19+
"test:build:cloudflare": "pnpm install && pnpm build && vite build",
1520
"test:build-latest": "pnpm install && pnpm add @nestjs/common@latest @nestjs/core@latest @nestjs/platform-express@latest @nestjs/microservices@latest && pnpm add -D @nestjs/cli@latest && pnpm build",
1621
"test:assert": "pnpm test"
1722
},
@@ -21,6 +26,9 @@
2126
"@nestjs/microservices": "^12.0.0",
2227
"@nestjs/schedule": "^12.0.0",
2328
"@nestjs/platform-express": "^12.0.0",
29+
"@sentry/bun": "file:../../packed/sentry-bun-packed.tgz",
30+
"@sentry/cloudflare": "file:../../packed/sentry-cloudflare-packed.tgz",
31+
"@sentry/deno": "file:../../packed/sentry-deno-packed.tgz",
2432
"@sentry/nestjs": "file:../../packed/sentry-nestjs-packed.tgz",
2533
"reflect-metadata": "^0.2.0",
2634
"rxjs": "^7.8.1"
@@ -32,13 +40,32 @@
3240
"@nestjs/schematics": "^12.0.0",
3341
"@types/express": "^5.0.0",
3442
"@types/node": "^22.0.0",
35-
"typescript": "~5.9.0"
43+
"typescript": "~5.9.0",
44+
"@cloudflare/vite-plugin": "^1.47.0",
45+
"vite": "^8.1.5",
46+
"wrangler": "^4.120.0"
3647
},
3748
"sentryTest": {
3849
"optionalVariants": [
3950
{
4051
"build-command": "pnpm test:build-latest",
4152
"label": "nestjs-12 (latest)"
53+
},
54+
{
55+
"runtime": "bun",
56+
"bun-version": "1.4.4",
57+
"build-command": "pnpm test:build:bun",
58+
"label": "nestjs-12 (bun)"
59+
},
60+
{
61+
"runtime": "deno",
62+
"deno-version": "v2.9.0",
63+
"label": "nestjs-12 (deno)"
64+
},
65+
{
66+
"runtime": "cloudflare",
67+
"build-command": "pnpm test:build:cloudflare",
68+
"label": "nestjs-12 (cloudflare)"
4269
}
4370
]
4471
}
Collapse file

‎dev-packages/e2e-tests/test-applications/nestjs-12/playwright.config.mjs‎

Copy file name to clipboard
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
1+
import { getPlaywrightConfig, getRuntime } from '@sentry-internal/test-utils';
2+
3+
const startCommands = {
4+
node: 'pnpm start',
5+
bun: 'pnpm start:bun',
6+
deno: 'pnpm start:deno',
7+
cloudflare: 'pnpm start:cloudflare',
8+
};
29

310
const config = getPlaywrightConfig({
4-
startCommand: `pnpm start`,
11+
startCommand: startCommands[getRuntime()],
512
});
613

714
export default config;

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.