Repository navigation
chore: use native node:fs for removal scripts
#26219
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { globSync, rmSync } from 'node:fs'; | ||
|
|
||
| for (const path of globSync(['suites/**/dist', 'loader-suites/**/dist', 'tmp'])) { | ||
| rmSync(path, { recursive: true, force: true }); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { globSync, rmSync } from 'node:fs'; | ||
|
|
||
| const pattern = | ||
| 'test-applications/**/{node_modules,dist,build,.next,.nuxt,.sveltekit,.react-router,.astro,.output,pnpm-lock.yaml,.last-run.json,test-results,.angular}'; | ||
|
|
||
| for (const path of globSync(pattern)) { | ||
| rmSync(path, { recursive: true, force: true }); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,16 @@ | ||
| const { execSync } = require('child_process'); | ||
| const { globSync, rmSync } = require('fs'); | ||
|
|
||
| for (const path of globSync(['suites/**/node_modules', 'suites/**/tmp_*'])) { | ||
| rmSync(path, { recursive: true, force: true }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clean scripts crash on Node 20Medium Severity These clean scripts import Additional Locations (2)Reviewed by Cursor Bugbot for commit 9b03122. Configure here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
| // The runner (utils/runner/createRunner.ts) starts each suite's docker compose | ||
| // stack under a project name prefixed with `sentry-it-`, derived by hashing the | ||
| // working directory. Some suites (e.g. the Prisma tests) run from a temporary | ||
| // directory whose path — and therefore whose derived project name — isn't known | ||
| // ahead of time and no longer exists on disk by the time this script runs (the | ||
| // `clean` npm script removes `tmp_*` dirs first). Reconstructing project names | ||
| // `tmp_*` dirs are removed above). Reconstructing project names | ||
| // from compose file paths therefore misses those stacks and leaks containers. | ||
| // | ||
| // Instead, ask Docker for every `sentry-it-*` project it still knows about and | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean scripts fail on Node 20
Medium Severity
The new clean scripts import
globSyncfromnode:fs, but that API ships only in Node 22+. This repo still supports Node 20.19 (engines and CI), sopnpm cleanand the browser-integration-testspretestcrash there with a missing-export / not-a-function error instead of removing build artifacts.Additional Locations (2)
dev-packages/e2e-tests/scripts/clean-test-applications.mjs#L1-L8dev-packages/node-integration-tests/scripts/clean.js#L1-L6Reviewed by Cursor Bugbot for commit ee036d8. Configure here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.