Skip to content

Commit

Permalink
build: Small fixes for e2e tests & build (#9213)
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea authored Oct 10, 2023
1 parent 960484f commit a173fa2
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 44 deletions.
2 changes: 1 addition & 1 deletion packages/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf build coverage sentry-node-*.tgz",
"clean": "rimraf build coverage sentry-bun-*.tgz",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"test:validate-test-app-setups": "ts-node validate-test-app-setups.ts",
"test:prepare": "ts-node prepare.ts",
"test:validate": "run-s test:validate-configuration test:validate-test-app-setups",
"clean": "rimraf tmp node_modules && yarn clean:test-applications",
"clean": "rimraf tmp node_modules pnpm-lock.yaml && yarn clean:test-applications",
"clean:test-applications": "rimraf test-applications/**/{node_modules,dist,build,.next,.sveltekit,pnpm-lock.yaml}"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ app.get('/test-transaction', async function (req, res) {
Sentry.startSpan({ name: 'child-span' }, () => {});
});

await Sentry.flush();

res.send({
transactionIds: global.transactionIds || [],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,41 +37,3 @@ test('Sends exception to Sentry', async ({ baseURL }) => {
)
.toBe(200);
});

test('Sends transactions to Sentry', async ({ baseURL }) => {
const { data } = await axios.get(`${baseURL}/test-transaction`);
const { transactionIds } = data;

console.log(`Polling for transaction eventIds: ${JSON.stringify(transactionIds)}`);

expect(transactionIds.length).toBe(1);

await Promise.all(
transactionIds.map(async (transactionId: string) => {
const url = `https://sentry.io/api/0/projects/${sentryTestOrgSlug}/${sentryTestProject}/events/${transactionId}/`;

await expect
.poll(
async () => {
try {
const response = await axios.get(url, { headers: { Authorization: `Bearer ${authToken}` } });

return response.status;
} catch (e) {
if (e instanceof AxiosError && e.response) {
if (e.response.status !== 404) {
throw e;
} else {
return e.response.status;
}
} else {
throw e;
}
}
},
{ timeout: EVENT_POLLING_TIMEOUT },
)
.toBe(200);
}),
);
});
2 changes: 1 addition & 1 deletion packages/tracing-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"build:transpile:watch": "rollup -c rollup.npm.config.js --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"clean": "rimraf build coverage sentry-tracing-*.tgz",
"clean": "rimraf build coverage sentry-internal-tracing-*.tgz",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/vercel-edge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf build coverage sentry-core-*.tgz",
"clean": "rimraf build coverage sentry-vercel-edge-*.tgz",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
Expand Down

0 comments on commit a173fa2

Please sign in to comment.