Skip to content

Commit afde087

Browse files
Disable network tests to avoid orphan networks
Addresses #2118.
1 parent 00697ea commit afde087

3 files changed

Lines changed: 5 additions & 27 deletions

File tree

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ before_install:
1616
- cp target/travis/logging.properties logging.properties
1717
install: mvn install --quiet -Djava.util.logging.config.file=logging.properties -DskipTests=true
1818
-Dgpg.skip=true
19-
cache:
20-
directories:
21-
- "$HOME/google-cloud-sdk/"
2219
script:
2320
- travis_wait 60 utilities/verify.sh
2421
after_success:

google-cloud-compute/src/test/java/com/google/cloud/compute/it/ITComputeTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
import java.util.concurrent.TimeoutException;
8686
import org.junit.AfterClass;
8787
import org.junit.BeforeClass;
88+
import org.junit.Ignore;
8889
import org.junit.Rule;
8990
import org.junit.Test;
9091
import org.junit.rules.Timeout;
@@ -1343,6 +1344,7 @@ public void testListImagesWithFilter() {
13431344
assertTrue(count > 0);
13441345
}
13451346

1347+
@Ignore("Avoid leaving orphan networks when interrupted: see #2118")
13461348
@Test
13471349
public void testCreateAndGetNetwork() throws InterruptedException, TimeoutException {
13481350
String name = BASE_RESOURCE_NAME + "create-and-get-network";
@@ -1376,6 +1378,7 @@ public void testCreateAndGetNetwork() throws InterruptedException, TimeoutExcept
13761378
assertNull(compute.getNetwork(name));
13771379
}
13781380

1381+
@Ignore("Avoid leaving orphan networks when interrupted: see #2118")
13791382
@Test
13801383
public void testListNetworks() throws InterruptedException, TimeoutException {
13811384
String name = BASE_RESOURCE_NAME + "list-network";
@@ -1424,6 +1427,7 @@ public void testListNetworks() throws InterruptedException, TimeoutException {
14241427
assertNull(compute.getNetwork(name));
14251428
}
14261429

1430+
@Ignore("Avoid leaving orphan networks when interrupted: see #2118")
14271431
@Test
14281432
public void testCreateNetworkAndSubnetwork() throws InterruptedException, TimeoutException {
14291433
String networkName = BASE_RESOURCE_NAME + "create-subnetwork-network";
@@ -1511,6 +1515,7 @@ public void testCreateNetworkAndSubnetwork() throws InterruptedException, Timeou
15111515
assertNull(compute.getNetwork(networkName));
15121516
}
15131517

1518+
@Ignore("Avoid leaving orphan networks when interrupted: see #2118")
15141519
@Test
15151520
public void testAggregatedListSubnetworks() throws InterruptedException, TimeoutException {
15161521
String networkName = BASE_RESOURCE_NAME + "list-subnetwork-network";

utilities/integration_test_env.sh

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
# Ensure latest Google Cloud SDK installed, for commands below
2-
if [ ! -d "$HOME/google-cloud-sdk/bin" ]
3-
then
4-
rm -rf "$HOME/google-cloud-sdk"
5-
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
6-
curl https://sdk.cloud.google.com | bash
7-
fi
8-
gcloud components update
9-
source "$HOME/google-cloud-sdk/path.bash.inc"
10-
gcloud version
11-
12-
# Remove orphaned firewall rules and networks presumed generated by interrupted runs of Compute
13-
# integration tests: see https://github.com/GoogleCloudPlatform/google-cloud-java/issues/2118
14-
firewalls=$(gcloud compute firewall-rules list | cut -f 1 -d ' ' | grep '^test-')
15-
if [[ $firewalls ]]
16-
then
17-
echo 'Y' | gcloud compute firewall-rules delete $firewalls
18-
fi
19-
networks=$(gcloud compute networks list | cut -f 1 -d ' ' | grep '^test-')
20-
if [[ $networks ]]
21-
then
22-
echo 'Y' | gcloud compute networks delete $networks
23-
fi
24-
251
# Export test env variables
262
export GCLOUD_PROJECT="gcloud-devel"
273
export GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/signing-tools/gcloud-devel-travis.json

0 commit comments

Comments
 (0)