mirror of https://github.com/grpc/grpc-node.git
Merge pull request #2980 from murgatroid99/test_newer_node_versions
Test with newer Node versions
This commit is contained in:
commit
259f5c9c86
|
@ -76,12 +76,16 @@ describe('Name Resolver', () => {
|
||||||
resultSeen = true;
|
resultSeen = true;
|
||||||
assert(maybeEndpointList.ok);
|
assert(maybeEndpointList.ok);
|
||||||
const endpointList = maybeEndpointList.value;
|
const endpointList = maybeEndpointList.value;
|
||||||
|
console.log(`Endpoint list: ${JSON.stringify(endpointList)}`);
|
||||||
assert(
|
assert(
|
||||||
hasMatchingAddress(endpointList, { host: '127.0.0.1', port: 50051 })
|
hasMatchingAddress(endpointList, { host: '127.0.0.1', port: 50051 })
|
||||||
);
|
);
|
||||||
|
// The new test platform doesn't resolve localhost to IPv6
|
||||||
|
/*
|
||||||
assert(
|
assert(
|
||||||
hasMatchingAddress(endpointList, { host: '::1', port: 50051 })
|
hasMatchingAddress(endpointList, { host: '::1', port: 50051 })
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
done();
|
done();
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
@ -108,10 +112,12 @@ describe('Name Resolver', () => {
|
||||||
resultSeen = true;
|
resultSeen = true;
|
||||||
assert(maybeEndpointList.ok);
|
assert(maybeEndpointList.ok);
|
||||||
const endpointList = maybeEndpointList.value;
|
const endpointList = maybeEndpointList.value;
|
||||||
|
console.log(`Endpoint list: ${JSON.stringify(endpointList)}`);
|
||||||
assert(
|
assert(
|
||||||
hasMatchingAddress(endpointList, { host: '127.0.0.1', port: 443 })
|
hasMatchingAddress(endpointList, { host: '127.0.0.1', port: 443 })
|
||||||
);
|
);
|
||||||
assert(hasMatchingAddress(endpointList, { host: '::1', port: 443 }));
|
// The new test platform doesn't resolve localhost to IPv6
|
||||||
|
// assert(hasMatchingAddress(endpointList, { host: '::1', port: 443 }));
|
||||||
done();
|
done();
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
@ -440,12 +446,16 @@ describe('Name Resolver', () => {
|
||||||
) => {
|
) => {
|
||||||
assert(maybeEndpointList.ok);
|
assert(maybeEndpointList.ok);
|
||||||
const endpointList = maybeEndpointList.value;
|
const endpointList = maybeEndpointList.value;
|
||||||
|
console.log(`Endpoint list: ${JSON.stringify(endpointList)}`);
|
||||||
assert(
|
assert(
|
||||||
hasMatchingAddress(endpointList, { host: '127.0.0.1', port: 443 })
|
hasMatchingAddress(endpointList, { host: '127.0.0.1', port: 443 })
|
||||||
);
|
);
|
||||||
|
// The new test platform doesn't resolve localhost to IPv6
|
||||||
|
/*
|
||||||
assert(
|
assert(
|
||||||
hasMatchingAddress(endpointList, { host: '::1', port: 443 })
|
hasMatchingAddress(endpointList, { host: '::1', port: 443 })
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
resultCount += 1;
|
resultCount += 1;
|
||||||
if (resultCount === 1) {
|
if (resultCount === 1) {
|
||||||
process.nextTick(() => resolver.updateResolution());
|
process.nextTick(() => resolver.updateResolution());
|
||||||
|
@ -473,8 +483,10 @@ describe('Name Resolver', () => {
|
||||||
serviceConfig: StatusOr<ServiceConfig> | null,
|
serviceConfig: StatusOr<ServiceConfig> | null,
|
||||||
resolutionNote: string
|
resolutionNote: string
|
||||||
) => {
|
) => {
|
||||||
|
console.log(`Enpoint list: ${JSON.stringify(maybeEndpointList)}`);
|
||||||
assert(!maybeEndpointList.ok);
|
assert(!maybeEndpointList.ok);
|
||||||
resultCount += 1;
|
resultCount += 1;
|
||||||
|
console.log(`resultCount: ${resultCount}`);
|
||||||
if (resultCount === 1) {
|
if (resultCount === 1) {
|
||||||
process.nextTick(() => resolver.updateResolution());
|
process.nextTick(() => resolver.updateResolution());
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,7 +369,7 @@ describe('Server interceptors', () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
server.bindAsync(
|
server.bindAsync(
|
||||||
'[::1]:0',
|
'127.0.0.1:0',
|
||||||
grpc.ServerCredentials.createInsecure(),
|
grpc.ServerCredentials.createInsecure(),
|
||||||
(error, port) => {
|
(error, port) => {
|
||||||
assert.ifError(error);
|
assert.ifError(error);
|
||||||
|
@ -386,8 +386,8 @@ describe('Server interceptors', () => {
|
||||||
it('Should get valid connection information', done => {
|
it('Should get valid connection information', done => {
|
||||||
const call = client.sendRequest(done);
|
const call = client.sendRequest(done);
|
||||||
call.on('metadata', metadata => {
|
call.on('metadata', metadata => {
|
||||||
assert.strictEqual(metadata.get('local-address')[0], '::1');
|
assert.strictEqual(metadata.get('local-address')[0], '127.0.0.1');
|
||||||
assert.strictEqual(metadata.get('remote-address')[0], '::1');
|
assert.strictEqual(metadata.get('remote-address')[0], '127.0.0.1');
|
||||||
assert.strictEqual(metadata.get('local-port')[0], `${portNum}`);
|
assert.strictEqual(metadata.get('local-port')[0], `${portNum}`);
|
||||||
assert.notStrictEqual(metadata.get('remote-port')[0], 'undefined');
|
assert.notStrictEqual(metadata.get('remote-port')[0], 'undefined');
|
||||||
});
|
});
|
||||||
|
|
|
@ -75,7 +75,7 @@ export interface ProtoGrpcType {
|
||||||
OperationInfo: MessageTypeDefinition<I_google_longrunning_OperationInfo, O_google_longrunning_OperationInfo>
|
OperationInfo: MessageTypeDefinition<I_google_longrunning_OperationInfo, O_google_longrunning_OperationInfo>
|
||||||
/**
|
/**
|
||||||
* Manages long-running operations with an API service.
|
* Manages long-running operations with an API service.
|
||||||
*
|
*
|
||||||
* When an API method normally takes long time to complete, it can be designed
|
* When an API method normally takes long time to complete, it can be designed
|
||||||
* to return [Operation][google.longrunning.Operation] to the client, and the client can use this
|
* to return [Operation][google.longrunning.Operation] to the client, and the client can use this
|
||||||
* interface to receive the real response asynchronously by polling the
|
* interface to receive the real response asynchronously by polling the
|
||||||
|
@ -146,3 +146,4 @@ export interface ProtoGrpcType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ SET JOBS=8
|
||||||
|
|
||||||
call nvm version
|
call nvm version
|
||||||
|
|
||||||
call nvm install 16
|
call nvm install 22
|
||||||
call nvm use 16
|
call nvm use 22
|
||||||
|
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
@ -40,14 +40,12 @@ call npm install || goto :error
|
||||||
SET JUNIT_REPORT_STACK=1
|
SET JUNIT_REPORT_STACK=1
|
||||||
SET FAILED=0
|
SET FAILED=0
|
||||||
|
|
||||||
for %%v in (14 16) do (
|
for %%v in (20 22) do (
|
||||||
call nvm install %%v
|
call nvm install %%v
|
||||||
call nvm use %%v
|
call nvm use %%v
|
||||||
if "%%v"=="4" (
|
if "%%v"=="4" (
|
||||||
call npm install -g npm@5
|
call npm install -g npm@5
|
||||||
)
|
)
|
||||||
@rem https://github.com/mapbox/node-pre-gyp/issues/362
|
|
||||||
call npm install -g node-gyp
|
|
||||||
node -e "console.log(process.versions)"
|
node -e "console.log(process.versions)"
|
||||||
|
|
||||||
mkdir reports\node%%v
|
mkdir reports\node%%v
|
||||||
|
|
12
run-tests.sh
12
run-tests.sh
|
@ -28,11 +28,11 @@ cd $ROOT
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
if [ ! -n "$node_versions" ] ; then
|
if [ ! -n "$node_versions" ] ; then
|
||||||
node_versions="14 16"
|
node_versions="20 22"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +ex
|
set +ex
|
||||||
nvm install 8
|
nvm install 22
|
||||||
nvm install lts/*
|
nvm install lts/*
|
||||||
nvm use lts/*
|
nvm use lts/*
|
||||||
set -ex
|
set -ex
|
||||||
|
@ -58,16 +58,14 @@ do
|
||||||
set +ex
|
set +ex
|
||||||
echo "Switching to node version $version"
|
echo "Switching to node version $version"
|
||||||
nvm install $version
|
nvm install $version
|
||||||
nvm use $version
|
nvm use --delete-prefix $version
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
export JUNIT_REPORT_PATH="reports/node$version/"
|
export JUNIT_REPORT_PATH="reports/node$version/"
|
||||||
|
|
||||||
# https://github.com/mapbox/node-pre-gyp/issues/362
|
|
||||||
npm install -g node-gyp
|
|
||||||
|
|
||||||
mkdir -p "reports/node$version"
|
mkdir -p "reports/node$version"
|
||||||
|
|
||||||
|
node -p 'process.version'
|
||||||
node -e 'process.exit(process.version.startsWith("v'$version'") ? 0 : -1)'
|
node -e 'process.exit(process.version.startsWith("v'$version'") ? 0 : -1)'
|
||||||
|
|
||||||
# Install dependencies and link packages together.
|
# Install dependencies and link packages together.
|
||||||
|
@ -80,7 +78,7 @@ do
|
||||||
done
|
done
|
||||||
|
|
||||||
set +ex
|
set +ex
|
||||||
nvm use 8
|
nvm use 22
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
node merge_kokoro_logs.js
|
node merge_kokoro_logs.js
|
||||||
|
|
Loading…
Reference in New Issue