Skip to content

Commit

Permalink
Internal Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 665154674
Change-Id: Ie0b99ea553a89bd7a2de7b3e7ca2ebd71f624b17
  • Loading branch information
GCP Buildpacks Team authored and copybara-github committed Aug 20, 2024
1 parent f5120ba commit bb4c1d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions internal/acceptance/acceptance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,9 @@ func getHostAndPortForApp(t *testing.T, containerID, containerName string) (stri
// therefore ports are not mapped at the build container's 'localhost'.
return containerName, 8080
}
if v := os.Getenv("DOCKER_IP_UBUNTU"); v != "" {
return v, hostPort(t, containerID)
}
// When supplying the publish parameter with no local port picked, docker will
// choose a random port to map to the published port. In this case, it means
// there will be a mapping from localhost:${RAND_PORT} -> container:8080. There is a
Expand Down
8 changes: 3 additions & 5 deletions kokoro/scripts/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ set -euo pipefail
if [[ -v KOKORO_ARTIFACTS_DIR ]]; then
cd "${KOKORO_ARTIFACTS_DIR}/git/buildpacks"
use_bazel.sh 5.4.0

# Move docker storage location to scratch disk so we don't run out of space.
echo 'DOCKER_OPTS="${DOCKER_OPTS} --data-root=/tmpfs/docker"' | sudo tee --append /etc/default/docker
sudo service docker restart
else
export KOKORO_ARTIFACTS_DIR="$(mktemp -d)"
echo "Setting KOKORO_ARTIFACTS_DIR=$KOKORO_ARTIFACTS_DIR"
fi

export DOCKER_IP_UBUNTU="$(/sbin/ip route|awk '/default/ { print $3 }')"
echo "DOCKER_IP_UBUNTU: ${DOCKER_IP_UBUNTU}"

if [[ ! -v FILTER ]]; then
echo 'Must specify $FILTER'
exit 1
Expand All @@ -55,7 +54,6 @@ bazel test --jobs=3 --test_output=errors --action_env="PATH=$temp:$PATH" $(bazel

# The exit code of the bazel command should be used to determine test outcome.
readonly EXIT_CODE="${?}"

# bazel-artifacts is specfied in build .cfg files.
mkdir -p "$KOKORO_ARTIFACTS_DIR/bazel-artifacts"
# bazel-testlogs is a symlink to a directory containing test output files.
Expand Down

0 comments on commit bb4c1d1

Please sign in to comment.