Skip to content

Commit b91d713

Browse files
Remove orphan Compute networks from Node tests
Addresses #2118.
1 parent 95f0dd7 commit b91d713

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

utilities/integration_test_env.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Remove orphaned firewall rules and networks generated by unintentional aborted runs of
2+
# google-cloud-node on gapic-test project: see
3+
# https://github.com/GoogleCloudPlatform/google-cloud-java/issues/2118
4+
firewalls=$(gcloud compute firewall-rules list | cut -f 1 -d ' ' | grep '^gcloud-tests')
5+
if [[ $firewalls ]]
6+
then
7+
echo 'Y' | gcloud compute firewall-rules delete $firewalls
8+
fi
9+
networks=$(gcloud compute networks list | cut -f 1 -d ' ' | grep '^gcloud-tests')
10+
if [[ $networks ]]
11+
then
12+
echo 'Y' | gcloud compute networks delete $networks
13+
fi
14+
115
# Export test env variables
216
export GCLOUD_PROJECT="gcloud-devel"
317
export GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/signing-tools/gcloud-devel-travis.json

0 commit comments

Comments
 (0)