internal: fix runnning all tests

`go test ./...` only runs tests in the current module. We have to
run this command at each module root.

Change-Id: Ib753a8f672609f8a2acce078ed5f85e88a5464a0
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/47132
Reviewed-by: Jean de Klerk <deklerk@google.com>
diff --git a/internal/kokoro/continuous.sh b/internal/kokoro/continuous.sh
index 0c5629d..714f44d 100755
--- a/internal/kokoro/continuous.sh
+++ b/internal/kokoro/continuous.sh
@@ -71,6 +71,9 @@
 trap create_junit_xml EXIT ERR
 
 # Run tests and tee output to log file, to be pushed to GCS as artifact.
-go test -race -v -timeout 30m ./... 2>&1 \
-  | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
-
+for i in `find . -name go.mod`; do
+  pushd `dirname $i`;
+    go test -race -v -timeout 30m ./... 2>&1 \
+      | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
+  popd;
+done
diff --git a/internal/kokoro/presubmit.sh b/internal/kokoro/presubmit.sh
index d396f24..4f6dc82 100755
--- a/internal/kokoro/presubmit.sh
+++ b/internal/kokoro/presubmit.sh
@@ -61,5 +61,9 @@
 trap create_junit_xml EXIT ERR
 
 # Run tests and tee output to log file, to be pushed to GCS as artifact.
-go test -race -v -timeout 15m -short ./... 2>&1 \
-  | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
+for i in `find . -name go.mod`; do
+  pushd `dirname $i`;
+    go test -race -v -timeout 15m -short ./... 2>&1 \
+      | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt
+  popd;
+done