Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
ref(deno): add deno-integration-tests dev-package#21827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "$schema": "../../node_modules/oxlint/configuration_schema.json", | ||
| "extends": ["../.oxlintrc.json"], | ||
| "env": { | ||
| "node": true | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["suites/**/*.ts", "suites/**/*.mjs"], | ||
| "globals": { | ||
| "Deno": "readonly" | ||
| }, | ||
| "rules": { | ||
| "typescript/ban-ts-comment": [ | ||
| "error", | ||
| { | ||
| "ts-ignore": "allow-with-description", | ||
| "ts-expect-error": true | ||
| } | ||
| ], | ||
| "import/first": "off" | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "name": "@sentry-internal/deno-integration-tests", | ||
| "version": "10.63.0", | ||
| "license": "MIT", | ||
| "engines": { | ||
| "node": ">=18" | ||
| }, | ||
| "private": true, | ||
| "scripts": { | ||
| "deno-types": "node ./scripts/download-deno-types.mjs", | ||
| "install:deno": "node ./scripts/install-deno.mjs", | ||
| "lint": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --type-aware", | ||
| "lint:fix": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --fix --type-aware", | ||
| "test": "run-s install:deno deno-types test:unit", | ||
| "test:unit": "deno test --allow-net --allow-read --allow-run --allow-env --no-check" | ||
isaacs marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| }, | ||
| "dependencies": { | ||
| "@sentry/core": "10.63.0", | ||
| "@sentry/deno": "10.63.0", | ||
| "mysql": "^2.18.1", | ||
| "pg": "^8.22.0" | ||
| }, | ||
| "volta": { | ||
| "extends": "../../package.json" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { existsSync, writeFileSync } from 'fs'; | ||
| import { download } from './download.mjs'; | ||
| if (!existsSync('lib.deno.d.ts')) { | ||
| const code = await download('https://github.com/denoland/deno/releases/download/v2.8.0/lib.deno.d.ts'); | ||
| writeFileSync('lib.deno.d.ts', code); | ||
isaacs marked this conversation as resolved.
Dismissed
Uh oh!There was an error while loading. Please reload this page. isaacs marked this conversation as resolved.
Dismissed
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /** Download a url to a string */ | ||
| export async function download(url) { | ||
| try { | ||
| // `fetch` only rejects on network errors, so check the status explicitly — otherwise an error body | ||
| // (e.g. a 404 HTML page) would be treated as success and fed to `execSync`/written to disk. | ||
| const res = await fetch(url); | ||
| if (!res.ok) { | ||
| throw new Error(`HTTP ${res.status} ${res.statusText}`); | ||
| } | ||
| return await res.text(); | ||
| } catch (e) { | ||
| // eslint-disable-next-line no-console | ||
| console.error('Failed to download', url, e); | ||
| process.exit(1); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { execSync } from 'child_process'; | ||
| import { download } from './download.mjs'; | ||
| try { | ||
| execSync('deno --version', { stdio: 'inherit' }); | ||
| } catch { | ||
| // eslint-disable-next-line no-console | ||
| console.error('Deno is not installed. Installing...'); | ||
| if (process.platform === 'win32') { | ||
| // TODO | ||
| // eslint-disable-next-line no-console | ||
| console.error('Please install Deno manually: https://docs.deno.com/runtime/manual/getting_started/installation'); | ||
| process.exit(1); | ||
| } else { | ||
| const script = await download('https://deno.land/x/install/install.sh'); | ||
isaacs marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| try { | ||
| execSync(script, { stdio: 'inherit' }); | ||
isaacs marked this conversation as resolved.
Dismissed
Uh oh!There was an error while loading. Please reload this page. isaacs marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } catch (e) { | ||
| // eslint-disable-next-line no-console | ||
| console.error('Failed to install Deno', e); | ||
| process.exit(1); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,11 +2,11 @@ | ||
| import { tracingChannel } from 'node:diagnostics_channel'; | ||
| import type { TransactionEvent } from '@sentry/core'; | ||
| import type { DenoClient } from '@sentry/deno'; | ||
| import { getCurrentScope, getGlobalScope, getIsolationScope, init, startSpan } from '@sentry/deno'; | ||
| import { assert } from 'https://deno.land/std@0.212.0/assert/assert.ts'; | ||
| import { assertEquals } from 'https://deno.land/std@0.212.0/assert/assert_equals.ts'; | ||
| import { assertExists } from 'https://deno.land/std@0.212.0/assert/assert_exists.ts'; | ||
| import type { DenoClient } from '../build/esm/index.js'; | ||
| import { getCurrentScope, getGlobalScope, getIsolationScope, init, startSpan } from '../build/esm/index.js'; | ||
| function resetGlobals(): void { | ||
| getCurrentScope().clear(); | ||
| @@ -65,10 +65,11 @@ Deno.test('denoMysqlIntegration: included in default integrations (Deno 2.8.0+)' | ||
| // import inside the entry graph in Deno 2.8.0 through 2.8.2. | ||
| // TODO: revisit a `--import` or `--preload` approach once Deno 2.8.3 ships. | ||
| Deno.test('@sentry/deno/import: transforms mysql so it publishes the orchestrion channel', async () => { | ||
| const scenario = new URL('./orchestrion-mysql/scenario.mjs', import.meta.url); | ||
| const scenario = new URL('./scenario.mjs', import.meta.url); | ||
isaacs marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| // packages/deno — where node_modules resolves | ||
| const cwd = new URL('../', import.meta.url); | ||
| // The package root — where `node_modules` (and thus `@sentry/deno` / `mysql`) | ||
| // resolves for the spawned `deno run`. | ||
| const cwd = new URL('../../', import.meta.url); | ||
| const command = new Deno.Command('deno', { | ||
| args: ['run', '--allow-all', scenario.pathname], | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "extends": "../../tsconfig.json", | ||
| "include": ["suites/**/*"], | ||
| "compilerOptions": { | ||
| "lib": ["esnext"], | ||
| "target": "esnext" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -34,11 +34,11 @@ | ||
| "dedupe-deps:check": "yarn-deduplicate yarn.lock --list --fail", | ||
| "dedupe-deps:fix": "yarn-deduplicate yarn.lock", | ||
| "postpublish": "nx run-many -t postpublish --parallel=1", | ||
| "test": "nx run-many -t test --exclude \"@sentry-internal/{browser-integration-tests,bun-integration-tests,e2e-tests,integration-shims,node-integration-tests,node-core-integration-tests,cloudflare-integration-tests,bundler-plugin-integration-tests}\"", | ||
| "test": "nx run-many -t test --exclude \"@sentry-internal/{browser-integration-tests,bun-integration-tests,deno-integration-tests,e2e-tests,integration-shims,node-integration-tests,node-core-integration-tests,cloudflare-integration-tests,bundler-plugin-integration-tests}\"", | ||
| "test:scripts": "vitest run scripts/*.test.ts", | ||
| "test:unit": "nx run-many -t test:unit --exclude \"@sentry-internal/{browser-integration-tests,bun-integration-tests,e2e-tests,integration-shims,node-integration-tests,node-core-integration-tests,cloudflare-integration-tests,bundler-plugin-integration-tests}\"", | ||
| "test:unit": "nx run-many -t test:unit --exclude \"@sentry-internal/{browser-integration-tests,bun-integration-tests,deno-integration-tests,e2e-tests,integration-shims,node-integration-tests,node-core-integration-tests,cloudflare-integration-tests,bundler-plugin-integration-tests}\"", | ||
| "test:update-snapshots": "nx run-many -t test:update-snapshots", | ||
| "test:pr": "nx affected -t test --exclude \"@sentry-internal/{browser-integration-tests,bun-integration-tests,e2e-tests,integration-shims,node-integration-tests,node-core-integration-tests,cloudflare-integration-tests,bundler-plugin-integration-tests}\"", | ||
| "test:pr": "nx affected -t test --exclude \"@sentry-internal/{browser-integration-tests,bun-integration-tests,deno-integration-tests,e2e-tests,integration-shims,node-integration-tests,node-core-integration-tests,cloudflare-integration-tests,bundler-plugin-integration-tests}\"", | ||
| "test:pr:browser": "UNIT_TEST_ENV=browser ts-node ./scripts/ci-unit-tests.ts --affected", | ||
| "test:pr:node": "UNIT_TEST_ENV=node ts-node ./scripts/ci-unit-tests.ts --affected", | ||
| "test:ci:browser": "UNIT_TEST_ENV=browser ts-node ./scripts/ci-unit-tests.ts", | ||
| @@ -105,6 +105,7 @@ | ||
| "dev-packages/e2e-tests", | ||
| "dev-packages/node-integration-tests", | ||
| "dev-packages/bun-integration-tests", | ||
| "dev-packages/deno-integration-tests", | ||
cursor[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| "dev-packages/cloudflare-integration-tests", | ||
| "dev-packages/node-core-integration-tests", | ||
| "dev-packages/test-utils", | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -31,10 +31,6 @@ | ||
| "@sentry/core": "10.63.0", | ||
| "@sentry/server-utils": "10.63.0" | ||
| }, | ||
| "devDependencies": { | ||
isaacs marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| "mysql": "^2.18.1", | ||
| "pg": "8.16.0" | ||
| }, | ||
| "scripts": { | ||
| "deno-types": "node ./scripts/download-deno-types.mjs", | ||
| "build": "run-s build:transpile build:types", | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.