playground: fix jenkins playground test by adding node/npm to PATH
Change-Id: I6450120a3ac09e4ffa9c69bddfb77a4cdda55c09
diff --git a/tools/playground/test.sh b/tools/playground/test.sh
index dd793da..49a8977 100755
--- a/tools/playground/test.sh
+++ b/tools/playground/test.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Test the playground builder tool.
+# Tests the playground builder tool.
source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
@@ -10,20 +10,20 @@
# TODO(nlacasse): Once veyron.js is publicly available in npm, replace this
# with "npm install veyron".
pushd "${VEYRON_ROOT}/veyron.js"
- "${VEYRON_ROOT}/environment/cout/node/bin/npm" link
+ npm link
popd
- "${VEYRON_ROOT}/environment/cout/node/bin/npm" link veyron
+ npm link veyron
}
# Installs the pgbundle tool.
install_pgbundle() {
pushd "${VEYRON_ROOT}/veyron/go/src/veyron.io/veyron/veyron/tools/playground/pgbundle"
- "${VEYRON_ROOT}/environment/cout/node/bin/npm" link
+ npm link
popd
- "${VEYRON_ROOT}/environment/cout/node/bin/npm" link pgbundle
+ npm link pgbundle
}
-build() {
+build_go_binaries() {
# Note that "go build" puts built binaries in $(pwd), but only if they are
# built one at a time. So much for the principle of least surprise...
local -r V="veyron.io/veyron/veyron"
@@ -46,16 +46,16 @@
main() {
cd $(shell::tmp_dir)
- build
+ export GOPATH="$(pwd):$(veyron env GOPATH)"
+ export VDLPATH="$(pwd):$(veyron env VDLPATH)"
+ export PATH="$(pwd):${VEYRON_ROOT}/environment/cout/node/bin:${PATH}"
+
+ build_go_binaries
install_veyron_js
install_pgbundle
local -r DIR="$(shell::go_package_dir veyron.io/veyron/veyron/tools/playground/testdata)"
- export GOPATH="$(pwd):$(veyron env GOPATH)"
- export VDLPATH="$(pwd):$(veyron env VDLPATH)"
- export PATH="$(pwd):${PATH}"
-
# Test without identities
test_with_files "${DIR}/pingpong/wire.vdl" "${DIR}/pong/pong.go" "${DIR}/ping/ping.go" || shell_test::fail "line ${LINENO}: basic ping (go -> go)"