Skip to content

Commit 173adc7

Browse files
committed
Replace test.sh
1 parent 2d26879 commit 173adc7

File tree

5 files changed

+69
-110
lines changed

5 files changed

+69
-110
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ jobs:
199199
- name: Run tests
200200
env:
201201
NODE_VERSION: ${{ matrix.node }}
202-
run: ./scripts/test.sh
202+
run: yarn test-ci
203203
- name: Compute test coverage
204204
uses: codecov/codecov-action@v1
205205

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"pack:changed": "lerna run pack --since",
2323
"prepublishOnly": "lerna run --stream --concurrency 1 prepublishOnly",
2424
"postpublish": "make publish-docs && lerna run --stream --concurrency 1 postpublish",
25-
"test": "lerna run --ignore @sentry-internal/browser-integration-tests --stream --concurrency 1 --sort test"
25+
"test": "lerna run --ignore @sentry-internal/browser-integration-tests --stream --concurrency 1 --sort test",
26+
"test-ci": "ts-node ./scripts/test.ts"
2627
},
2728
"volta": {
2829
"node": "14.17.0",
@@ -84,7 +85,7 @@
8485
"sinon": "^7.3.2",
8586
"size-limit": "^4.5.5",
8687
"ts-jest": "^24.3.0",
87-
"ts-node": "^10.7.0",
88+
"ts-node": "^8.10.2",
8889
"tslib": "^2.3.1",
8990
"typedoc": "^0.18.0",
9091
"typescript": "3.7.5"

scripts/test.sh

-39
This file was deleted.

scripts/test.ts

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
const { spawnSync } = require('child_process');
2+
const { join } = require('path');
3+
4+
function run(cmd: string, cwd = '') {
5+
const result = spawnSync(cmd, { shell: true, stdio: 'inherit', cwd: join(__dirname, '..', cwd || '') });
6+
7+
if (result.status !== 0) {
8+
process.exit(result.status);
9+
}
10+
}
11+
12+
const nodeMajorVersion = parseInt(process.version.split('.')[0].replace('v', ''), 10);
13+
14+
// control which packages we test on each version of node
15+
if (nodeMajorVersion <= 6) {
16+
// install legacy versions of packages whose current versions don't support node 6
17+
// ignoring engines and scripts lets us get away with having incompatible things installed for packages we're not testing
18+
run('yarn add --dev --ignore-engines --ignore-scripts [email protected]', 'packages/node');
19+
run('yarn add --dev --ignore-engines --ignore-scripts [email protected]', 'packages/tracing');
20+
run('yarn add --dev --ignore-engines --ignore-scripts [email protected]', 'packages/utils');
21+
22+
// only test against @sentry/node and its dependencies - node 6 is too old for anything else to work
23+
const scope = ['@sentry/core', '@sentry/hub', '@sentry/minimal', '@sentry/node', '@sentry/utils', '@sentry/tracing']
24+
.map(dep => `--scope="${dep}"`)
25+
.join(' ');
26+
27+
run(`yarn test ${scope}`);
28+
} else if (nodeMajorVersion <= 8) {
29+
// install legacy versions of packages whose current versions don't support node 8
30+
// ignoring engines and scripts lets us get away with having incompatible things installed for packages we're not testing
31+
run('yarn add --dev --ignore-engines --ignore-scripts [email protected]', 'packages/tracing');
32+
run('yarn add --dev --ignore-engines --ignore-scripts [email protected]', 'packages/utils');
33+
34+
// ember tests happen separately, and the rest fail on node 8 for various syntax or dependency reasons
35+
const ignore = [
36+
'@sentry/ember',
37+
'@sentry-internal/eslint-plugin-sdk',
38+
'@sentry/react',
39+
'@sentry/wasm',
40+
'@sentry/gatsby',
41+
'@sentry/serverless',
42+
'@sentry/nextjs',
43+
]
44+
.map(dep => `--ignore="${dep}"`)
45+
.join(' ');
46+
47+
run(`yarn test ${ignore}`);
48+
} else {
49+
run('yarn test --ignore="@sentry/ember"');
50+
}
51+
52+
process.exit(0);

yarn.lock

+13-68
Original file line numberDiff line numberDiff line change
@@ -1544,18 +1544,6 @@
15441544
exec-sh "^0.3.2"
15451545
minimist "^1.2.0"
15461546

1547-
"@cspotcode/[email protected]":
1548-
version "0.8.0"
1549-
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b"
1550-
integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==
1551-
1552-
"@cspotcode/[email protected]":
1553-
version "0.7.0"
1554-
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5"
1555-
integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==
1556-
dependencies:
1557-
"@cspotcode/source-map-consumer" "0.8.0"
1558-
15591547
"@ember-data/rfc395-data@^0.0.4":
15601548
version "0.0.4"
15611549
resolved "https://registry.yarnpkg.com/@ember-data/rfc395-data/-/rfc395-data-0.0.4.tgz#ecb86efdf5d7733a76ff14ea651a1b0ed1f8a843"
@@ -3323,26 +3311,6 @@
33233311
"@types/semver" "^7.3.9"
33243312
ts-type "^2.1.4"
33253313

3326-
"@tsconfig/node10@^1.0.7":
3327-
version "1.0.8"
3328-
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9"
3329-
integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==
3330-
3331-
"@tsconfig/node12@^1.0.7":
3332-
version "1.0.9"
3333-
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c"
3334-
integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==
3335-
3336-
"@tsconfig/node14@^1.0.0":
3337-
version "1.0.1"
3338-
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2"
3339-
integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==
3340-
3341-
"@tsconfig/node16@^1.0.2":
3342-
version "1.0.2"
3343-
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e"
3344-
integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==
3345-
33463314
"@types/aria-query@^4.2.0":
33473315
version "4.2.1"
33483316
resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.1.tgz#78b5433344e2f92e8b306c06a5622c50c245bf6b"
@@ -4540,11 +4508,6 @@ acorn-walk@^8.0.0:
45404508
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.0.2.tgz#d4632bfc63fd93d0f15fd05ea0e984ffd3f5a8c3"
45414509
integrity sha512-+bpA9MJsHdZ4bgfDcpk0ozQyhhVct7rzOmO0s1IIr0AGGgKBljss8n2zp11rRP2wid5VGeh04CgeKzgat5/25A==
45424510

4543-
acorn-walk@^8.1.1:
4544-
version "8.2.0"
4545-
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
4546-
integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
4547-
45484511
acorn@^5.5.3:
45494512
version "5.7.4"
45504513
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e"
@@ -8060,11 +8023,6 @@ create-react-context@^0.2.2:
80608023
fbjs "^0.8.0"
80618024
gud "^1.0.0"
80628025

8063-
create-require@^1.1.0:
8064-
version "1.1.1"
8065-
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
8066-
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
8067-
80688026
cross-env@^7.0.3:
80698027
version "7.0.3"
80708028
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
@@ -19668,18 +19626,18 @@ source-map-support@^0.4.15, source-map-support@^0.4.18:
1966819626
dependencies:
1966919627
source-map "^0.5.6"
1967019628

19671-
source-map-support@^0.5.6, source-map-support@~0.5.12:
19672-
version "0.5.19"
19673-
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
19674-
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
19629+
source-map-support@^0.5.17, source-map-support@~0.5.20:
19630+
version "0.5.21"
19631+
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
19632+
integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
1967519633
dependencies:
1967619634
buffer-from "^1.0.0"
1967719635
source-map "^0.6.0"
1967819636

19679-
source-map-support@~0.5.20:
19680-
version "0.5.21"
19681-
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
19682-
integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
19637+
source-map-support@^0.5.6, source-map-support@~0.5.12:
19638+
version "0.5.19"
19639+
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
19640+
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
1968319641
dependencies:
1968419642
buffer-from "^1.0.0"
1968519643
source-map "^0.6.0"
@@ -21003,23 +20961,15 @@ ts-jest@^24.3.0:
2100320961
semver "^5.5"
2100420962
yargs-parser "10.x"
2100520963

21006-
ts-node@^10.7.0:
21007-
version "10.7.0"
21008-
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5"
21009-
integrity sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==
20964+
ts-node@^8.10.2:
20965+
version "8.10.2"
20966+
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.2.tgz#eee03764633b1234ddd37f8db9ec10b75ec7fb8d"
20967+
integrity sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==
2101020968
dependencies:
21011-
"@cspotcode/source-map-support" "0.7.0"
21012-
"@tsconfig/node10" "^1.0.7"
21013-
"@tsconfig/node12" "^1.0.7"
21014-
"@tsconfig/node14" "^1.0.0"
21015-
"@tsconfig/node16" "^1.0.2"
21016-
acorn "^8.4.1"
21017-
acorn-walk "^8.1.1"
2101820969
arg "^4.1.0"
21019-
create-require "^1.1.0"
2102020970
diff "^4.0.1"
2102120971
make-error "^1.1.1"
21022-
v8-compile-cache-lib "^3.0.0"
20972+
source-map-support "^0.5.17"
2102320973
yn "3.1.1"
2102420974

2102520975
ts-pnp@^1.1.6:
@@ -21576,11 +21526,6 @@ uuid@^8.0.0, uuid@^8.3.0, uuid@^8.3.1, uuid@^8.3.2:
2157621526
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
2157721527
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
2157821528

21579-
v8-compile-cache-lib@^3.0.0:
21580-
version "3.0.0"
21581-
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz#0582bcb1c74f3a2ee46487ceecf372e46bce53e8"
21582-
integrity sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==
21583-
2158421529
v8-compile-cache@^2.0.3:
2158521530
version "2.3.0"
2158621531
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"

0 commit comments

Comments
 (0)