-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
109 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const { spawnSync } = require('child_process'); | ||
const { join } = require('path'); | ||
|
||
const nodeVersion = parseInt(process.version.split('.')[0].replace('v', ''), 10); | ||
|
||
function run(cmd) { | ||
const result = spawnSync(cmd, { shell: true, stdio: 'inherit', cwd: join(__dirname, '..') }); | ||
|
||
if (result.status !== 0) { | ||
process.exit(result.status); | ||
} | ||
} | ||
|
||
// control which packages we test on each version of node | ||
if (nodeVersion <= 6) { | ||
// install legacy versions of packages whose current versions don't support node 6 | ||
// ignoring engines and scripts lets us get away with having incompatible things installed for packages we're not testing | ||
run('cd packages/node && yarn add --dev --ignore-engines --ignore-scripts [email protected]'); | ||
run('cd packages/tracing && yarn add --dev --ignore-engines --ignore-scripts [email protected]'); | ||
run('cd packages/utils && yarn add --dev --ignore-engines --ignore-scripts [email protected]'); | ||
|
||
// only test against @sentry/node and its dependencies - node 6 is too old for anything else to work | ||
run( | ||
'yarn test --scope="@sentry/core" --scope="@sentry/hub" --scope="@sentry/minimal" --scope="@sentry/node" --scope="@sentry/utils" --scope="@sentry/tracing"' | ||
); | ||
} else if (nodeVersion <= 8) { | ||
// install legacy versions of packages whose current versions don't support node 8 | ||
// ignoring engines and scripts lets us get away with having incompatible things installed for packages we're not testing | ||
run('cd packages/tracing && yarn add --dev --ignore-engines --ignore-scripts [email protected]'); | ||
run('cd packages/utils && yarn add --dev --ignore-engines --ignore-scripts [email protected]'); | ||
|
||
// ember tests happen separately, and the rest fail on node 8 for various syntax or dependency reasons | ||
run( | ||
'yarn test --ignore="@sentry/ember" --ignore="@sentry-internal/eslint-plugin-sdk" --ignore="@sentry/react" --ignore="@sentry/wasm" --ignore="@sentry/gatsby" --ignore="@sentry/serverless" --ignore="@sentry/nextjs"' | ||
); | ||
} else { | ||
run('yarn test --ignore="@sentry/ember"'); | ||
} | ||
|
||
process.exit(0); |
This file was deleted.
Oops, something went wrong.