Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit 6e46ed1

Browse files
authored
chore: start running ci for node 10 (#729)
PR-URL: #729
1 parent 5d000e9 commit 6e46ed1

6 files changed

Lines changed: 57 additions & 26 deletions

File tree

.circleci/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ workflows:
9797
- node6
9898
- node8
9999
- node9
100+
- node10
100101
tests:
101102
jobs:
102103
- node4:
@@ -107,12 +108,15 @@ workflows:
107108
filters: *release_tags
108109
- node9:
109110
filters: *release_tags
111+
- node10:
112+
filters: *release_tags
110113
- publish_npm:
111114
requires:
112115
- node4
113116
- node6
114117
- node8
115118
- node9
119+
- node10
116120
filters:
117121
branches:
118122
ignore: /.*/
@@ -155,6 +159,15 @@ jobs:
155159
- *postgres_service
156160
- *mysql_service
157161
<<: *unit_tests
162+
node10:
163+
docker:
164+
- image: node:10
165+
environment: *test_env
166+
- *mongo_service
167+
- *redis_service
168+
- *postgres_service
169+
- *mysql_service
170+
<<: *unit_tests
158171
publish_npm:
159172
docker:
160173
- image: node:8

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ environment:
55
- nodejs_version: "4"
66
- nodejs_version: "6"
77
- nodejs_version: "8"
8+
- nodejs_version: "10"
89

910
cache:
1011
- src/plugins/types -> src/plugins/types/index.d.ts

bin/docker-trace.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if [ ! -z $1 ]; then
44
if [ $COMMAND = 'start' ]; then
55
docker run --name trace-test-mongo -p 127.0.0.1:27017:27017 -d mongo &&\
66
docker run --name trace-test-redis -p 127.0.0.1:6379:6379 -d redis &&\
7-
docker run --name trace-test-mysql -p 127.0.0.1:3306:3306 -e MYSQL_ROOT_PASSWORD='Password12!' -e MYSQL_DATABASE=test -d mysql
7+
docker run --name trace-test-mysql -p 127.0.0.1:3306:3306 -e MYSQL_ROOT_PASSWORD='Password12!' -e MYSQL_DATABASE=test -d mysql:5
88
docker run --name trace-test-postgres -p 127.0.0.1:5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD='Password12!' -e POSTGRES_DB=test -d postgres
99
exit $?
1010
elif [ $COMMAND = 'stop' ]; then

package-lock.json

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@types/mocha": "^5.0.0",
6060
"@types/ncp": "^2.0.1",
6161
"@types/nock": "^9.1.2",
62-
"@types/node": "^9.4.6",
62+
"@types/node": "^10.0.0",
6363
"@types/once": "^1.4.0",
6464
"@types/pify": "^3.0.0",
6565
"@types/proxyquire": "^1.3.28",

scripts/check-install.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,46 @@
11
import * as path from 'path';
22
import { globP, ncpP, spawnP, tmpDirP } from './utils';
33

4+
/**
5+
* Get the major version number of the current Node process.
6+
*/
7+
function getNodeMajorVersion() {
8+
return Number(process.version.slice(1).split('.')[0]);
9+
}
10+
411
/**
512
* This function checks that the following two (sequential) operations succeed:
613
* 1. In a temporary directory, installs from the `npm pack` of this directory
714
* 2. Compiles a top-level file in that directory that imports this module
815
*/
916
export async function checkInstall() {
10-
// This script assumes that you don't already have a TGZ file
11-
// in your current working directory.
17+
// Determine a temporary directory in which this package should be installed.
1218
const installDir = await tmpDirP();
1319
console.log(installDir);
20+
// Create a tgz with package contents using npm pack
1421
await spawnP('npm', ['pack']);
22+
// Try to figure out the name of the tgz file that was just craeted
23+
// This assumes that you don't already have a TGZ file
24+
// in your current working directory.
1525
const tgz = await globP(`${process.cwd()}/*.tgz`);
1626
if (tgz.length !== 1) {
1727
throw new Error(`Expected 1 tgz file in current directory, but found ${tgz.length}`);
1828
}
29+
// Initialize a new npm package.json in the temp directory.
1930
await spawnP('npm', ['init', '-y'], {
2031
cwd: installDir
2132
});
22-
await spawnP('npm', ['install', 'typescript', '@types/node', tgz[0]], {
33+
// Install the tgz file as a package, along with necessities.
34+
// @types/node version should match the current process version, but clamped
35+
// at >=9 (because of http2 types).
36+
const nodeTypesVersion = Math.max(getNodeMajorVersion(), 9);
37+
await spawnP('npm', ['install', 'typescript', `@types/node@${nodeTypesVersion}`, tgz[0]], {
2338
cwd: installDir
2439
});
40+
// Create an entry point for the package created in the temp directory
2541
// use-module.ts is a fixture that imports the Trace Agent
2642
await ncpP('./test/fixtures/use-module.ts', `${installDir}/index.ts`);
43+
// Compile it
2744
await spawnP(`node_modules${path.sep}.bin${path.sep}tsc`, ['index.ts'], {
2845
cwd: installDir
2946
});

0 commit comments

Comments
 (0)