playground: fixing a test failure (and removing "go list" with
V23_ROOT)

Change-Id: I3f781562ba5384c7d292d96b04fe1c5e8f8823fa
diff --git a/client/lib/shell/pg_test_util.sh b/client/lib/shell/pg_test_util.sh
index 4aec0b2..ddfe837 100755
--- a/client/lib/shell/pg_test_util.sh
+++ b/client/lib/shell/pg_test_util.sh
@@ -4,14 +4,11 @@
 # license that can be found in the LICENSE file.
 
 # Utilities for testing the playground builder tool.
-# Used by tests in client and go/src/playground.
+# Used by tests in client and go/src/v.io/x/playground.
 
-# PLAYGROUND_ROOT is obtained relative to the playground package in
-# ${PLAYGROUND_ROOT}/go/src/playground .
-# Assumes the playground package is included in GOPATH.
-PLAYGROUND_ROOT="$(CDPATH="" cd -P $(go list -f {{.Dir}} playground)/../../.. && pwd)"
+PLAYGROUND_ROOT="${V23_ROOT}/release/projects/playground"
 
-source "$(go list -f {{.Dir}} playground)/../../../client/lib/shell/shell_test.sh"
+source "${V23_ROOT}/release/projects/playground/client/lib/shell/shell_test.sh"
 
 # Sets up environment variables required for the tests.
 setup_environment() {
@@ -46,7 +43,7 @@
   shell_test::build_go_binary 'v.io/x/ref/services/mounttable/mounttabled'
   shell_test::build_go_binary 'v.io/x/ref/services/wspr/wsprd'
   shell_test::build_go_binary 'v.io/x/ref/cmd/vdl'
-  shell_test::build_go_binary 'playground/builder'
+  shell_test::build_go_binary 'v.io/x/playground/builder'
 }
 
 # Bundles a playground example and tests it using builder.
diff --git a/client/lib/shell/shell_test.sh b/client/lib/shell/shell_test.sh
index 1b524bd..d444d68 100755
--- a/client/lib/shell/shell_test.sh
+++ b/client/lib/shell/shell_test.sh
@@ -9,7 +9,7 @@
 # handler must call shell_test::at_exit to clean up all temporary
 # files and directories created by this library.
 
-source "$(go list -f {{.Dir}} playground)/../../../client/lib/shell/shell.sh"
+source "${V23_ROOT}/release/projects/playground/client/lib/shell/shell.sh"
 
 trap shell_test::at_exit INT TERM EXIT
 
diff --git a/client/lib/shell/test.sh b/client/lib/shell/test.sh
index fcffafc..972986d 100755
--- a/client/lib/shell/test.sh
+++ b/client/lib/shell/test.sh
@@ -8,7 +8,7 @@
 # Unit tests for the shell functions in this directory
 #
 
-source "$(go list -f {{.Dir}} playground)/../../../client/lib/shell/shell_test.sh"
+source "${V23_ROOT}/release/projects/playground/client/lib/shell/shell_test.sh"
 
 test_assert() {
   shell_test::assert_eq "foo" "foo" "${LINENO}"
diff --git a/client/test.sh b/client/test.sh
index 5746c7a..1422eeb 100755
--- a/client/test.sh
+++ b/client/test.sh
@@ -10,9 +10,10 @@
 # $ cd bundles/fortune/src
 # $ GOPATH=$(dirname $(pwd)) VDLPATH=$(dirname $(pwd)) v23 go install ./...
 
-# v.io/core/shell/lib/shell_test.sh sourced via playground/lib/pg_test_util.sh
-# (shell_test.sh has side effects, should not be sourced again)
-source "$(go list -f {{.Dir}} playground)/../../../client/lib/shell/pg_test_util.sh"
+# v.io/core/shell/lib/shell_test.sh sourced via
+# playground/client/lib/shell/pg_test_util.sh (shell_test.sh has side
+# effects, should not be sourced again)
+source "${V23_ROOT}/release/projects/playground/client/lib/shell/pg_test_util.sh"
 
 main() {
   cd "${shell_test_WORK_DIR}"
diff --git a/go/src/v.io/x/playground/test.sh b/go/src/v.io/x/playground/test.sh
index 8d7e477..47dcb5c 100755
--- a/go/src/v.io/x/playground/test.sh
+++ b/go/src/v.io/x/playground/test.sh
@@ -5,13 +5,14 @@
 
 # Tests the playground builder tool.
 
-# v.io/core/shell/lib/shell_test.sh sourced via playground/lib/pg_test_util.sh
-# (shell_test.sh has side effects, should not be sourced again)
+# v.io/core/shell/lib/shell_test.sh sourced via
+# playground/client/lib/shell/pg_test_util.sh (shell_test.sh has side
+# effects, should not be sourced again)
 source "${V23_ROOT}/release/projects/playground/client/lib/shell/pg_test_util.sh"
 
 # Sets up a glob file with the given files, then runs builder.
 test_with_files() {
-  local -r TESTDATA_DIR="$(go list -f {{.Dir}} v.io/x/playground)/testdata"
+  local -r TESTDATA_DIR="${V23_ROOT}/release/projects/playground/go/src/v.io/x/playground/testdata"
 
   # Write input file paths to the glob file.
   local -r CONFIG_FILE="$(shell::tmp_dir)/test.bundle"