Skip to content

Commit e2c8b31

Browse files
committed
chore: use sparse checkout and fix paths in zonal tests
1 parent 281eaae commit e2c8b31

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/google-cloud-storage/cloudbuild/run_zonal_tests.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ echo '--- Installing git and cloning repository on VM ---'
44
sudo apt-get update && sudo apt-get install -y git python3-pip python3-venv
55

66
# Clone the repository and checkout the specific commit from the build trigger.
7-
git clone https://github.com/googleapis/python-storage.git
8-
cd python-storage
7+
git clone --no-checkout --depth 1 --sparse --filter=blob:none https://github.com/googleapis/google-cloud-python.git
8+
cd google-cloud-python
9+
git sparse-checkout set packages/google-cloud-storage
910
git fetch origin "refs/pull/${_PR_NUMBER}/head"
1011
git checkout ${COMMIT_SHA}
12+
cd packages/google-cloud-storage
1113

1214

1315
echo '--- Installing Python and dependencies on VM ---'

packages/google-cloud-storage/cloudbuild/zb-system-tests-cloudbuild.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ steps:
6363
sleep 15
6464
done
6565
# copy the script to the VM
66-
gcloud compute scp cloudbuild/run_zonal_tests.sh ${_VM_NAME}:~ --zone=${_ZONE} --internal-ip --ssh-key-file=/workspace/.ssh/google_compute_engine
66+
gcloud compute scp packages/google-cloud-storage/cloudbuild/run_zonal_tests.sh ${_VM_NAME}:~ --zone=${_ZONE} --internal-ip --ssh-key-file=/workspace/.ssh/google_compute_engine
6767
6868
# Execute the script on the VM via SSH.
6969
# Capture the exit code to ensure cleanup happens before the build fails.
7070
set +e
71-
gcloud compute ssh ${_VM_NAME} --zone=${_ZONE} --internal-ip --ssh-key-file=/workspace/.ssh/google_compute_engine --command="ulimit -n {_ULIMIT}; COMMIT_SHA=${COMMIT_SHA} _ZONAL_BUCKET=${_ZONAL_BUCKET} CROSS_REGION_BUCKET=${_CROSS_REGION_BUCKET} _PR_NUMBER=${_PR_NUMBER} bash run_zonal_tests.sh"
71+
gcloud compute ssh ${_VM_NAME} --zone=${_ZONE} --internal-ip --ssh-key-file=/workspace/.ssh/google_compute_engine --command="ulimit -n ${_ULIMIT}; COMMIT_SHA=${COMMIT_SHA} _ZONAL_BUCKET=${_ZONAL_BUCKET} CROSS_REGION_BUCKET=${_CROSS_REGION_BUCKET} _PR_NUMBER=${_PR_NUMBER} bash run_zonal_tests.sh"
7272
EXIT_CODE=$?
7373
set -e
7474

0 commit comments

Comments
 (0)