Skip to content

Commit

Permalink
Merge pull request grpc#13043 from murgatroid99/grpc-node_interop
Browse files Browse the repository at this point in the history
Switch Node interop tests to use grpc-node repo
  • Loading branch information
murgatroid99 authored Oct 17, 2017
2 parents 342d2a4 + fbc182e commit 523fefe
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
13 changes: 7 additions & 6 deletions tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
set -e

mkdir -p /var/local/git
git clone /var/local/jenkins/grpc /var/local/git/grpc
git clone /var/local/jenkins/grpc-node /var/local/git/grpc-node
# clone gRPC submodules, use data from locally cloned submodules where possible
(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
(cd /var/local/jenkins/grpc-node/ && git submodule foreach 'cd /var/local/git/grpc-node \
&& git submodule update --init --recursive --reference /var/local/jenkins/grpc-node/${name} \
${name}')

# copy service account keys if available
cp -r /var/local/jenkins/service_account $HOME || true

cd /var/local/git/grpc
cd /var/local/git/grpc-node

# build Node interop client & server
npm install -g node-gyp
npm install --unsafe-perm --build-from-source
npm install -g node-gyp gulp
npm install
gulp setup
1 change: 1 addition & 0 deletions tools/internal_ci/helper_scripts/prepare_build_interop_rc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ git submodule update --init
# Set up gRPC-Go and gRPC-Java to test
git clone --recursive https://github.com/grpc/grpc-go ./../grpc-go
git clone --recursive https://github.com/grpc/grpc-java ./../grpc-java
git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node

# Download json file.
mkdir ~/service_account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ brew install md5sha1sum
# Set up gRPC-Go and gRPC-Java to test
git clone --recursive https://github.com/grpc/grpc-go ./../grpc-go
git clone --recursive https://github.com/grpc/grpc-java ./../grpc-java
git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node

# Set up Docker for Mac
docker-machine create -d virtualbox --virtualbox-share-folder "/Users/kbuilder/workspace:" default
Expand Down
2 changes: 1 addition & 1 deletion tools/interop_matrix/create_matrix_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def build_all_images_for_release(lang, release):
# If we not using current tree or the sibling for grpc stack, do checkout.
if args.git_checkout:
stack_base = checkout_grpc_stack(lang, release)
var ={'go': 'GRPC_GO_ROOT', 'java': 'GRPC_JAVA_ROOT'}.get(lang, 'GRPC_ROOT')
var ={'go': 'GRPC_GO_ROOT', 'java': 'GRPC_JAVA_ROOT', 'node': 'GRPC_NODE_ROOT'}.get(lang, 'GRPC_ROOT')
env[var] = stack_base

for runtime in client_matrix.LANG_RUNTIME_MATRIX[lang]:
Expand Down
8 changes: 8 additions & 0 deletions tools/run_tests/dockerize/build_interop_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ else
echo "WARNING: grpc-go not found, it won't be mounted to the docker container."
fi

echo "GRPC_NODE_ROOT: ${GRPC_NODE_ROOT:=$(cd ../grpc-node && pwd)}"
if [ -n "$GRPC_NODE_ROOT" ]
then
MOUNT_ARGS+=" -v $GRPC_NODE_ROOT:/var/local/jenkins/grpc-node:ro"
else
echo "WARNING: grpc-node not found, it won't be mounted to the docker container."
fi

mkdir -p /tmp/ccache

# Mount service account dir if available.
Expand Down
12 changes: 6 additions & 6 deletions tools/run_tests/run_interop_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,20 +313,20 @@ def __str__(self):
class NodeLanguage:

def __init__(self):
self.client_cwd = None
self.server_cwd = None
self.client_cwd = '../grpc-node'
self.server_cwd = '../grpc-node'
self.safename = str(self)

def client_cmd(self, args):
return ['tools/run_tests/interop/with_nvm.sh',
'node', 'src/node/interop/interop_client.js'] + args
return ['packages/grpc-native-core/deps/grpc/tools/run_tests/interop/with_nvm.sh',
'node', 'test/interop/interop_client.js'] + args

def cloud_to_prod_env(self):
return {}

def server_cmd(self, args):
return ['tools/run_tests/interop/with_nvm.sh',
'node', 'src/node/interop/interop_server.js'] + args
return ['packages/grpc-native-core/deps/grpc/tools/run_tests/interop/with_nvm.sh',
'node', 'test/interop/interop_server.js'] + args

def global_env(self):
return {}
Expand Down

0 comments on commit 523fefe

Please sign in to comment.