Ensure that TEST_TMPDIR exists on the remote host when testing a remote build.
PiperOrigin-RevId: 158430272
diff --git a/tools/test/test-setup.sh b/tools/test/test-setup.sh
index fff02ac..308f658 100755
--- a/tools/test/test-setup.sh
+++ b/tools/test/test-setup.sh
@@ -76,6 +76,10 @@
"$TEST_UNDECLARED_OUTPUTS_DIR" \
"$TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR"
+# Create the test temp directory, which may not exist on the remote host when
+# doing a remote build.
+mkdir -p "$TEST_TMPDIR"
+
# Unexport environment variables related to undeclared test outputs that are
# only supposed to be used in this script.
export -n TEST_UNDECLARED_OUTPUTS_MANIFEST