Fix network quota error in compute integration tests
Remove GCE networks from gcloud-devel project.
https://www.google.com/url?q=https%3A%2F%2Ftravis-ci.org%2FGoogleCloudPlatform%2Fgoogle-cloud-java%2Fjobs%2F239819052&sa=D&sntz=1&usg=AFQjCNHHgq88UgaiKxAPxGs8u8rW4VBFcw
Probably, but it's more complicated and doesn't seem to save that much overhead. As the gcloud solution is already tested and not too bad, I'm inclined to go with it for now. Any objections?
I've set it up to cache the SDK to avoid a download and install unless updates are available.
@garrettjonesgoogle noticed that these tests are running not on the gapic-test project, but on the gcloud-java project, to which I'd previously not had access. The orphan networks on this project do look to be remnants from interrupted Compute integration tests on google-cloud-java. As my #2251 already filled in the gaps I found in testing removal, I suggest the remedy should be the same.
So I looked at the test runs on the latest commit (with @tcoffee-google 's two fixes), and the gcloud commands still didn't work (project wasn't set). I tried fixing this in a PR, but then I ran against a problem with account not being set.
At this point I just decided to run the commands manually because I want to get a release out. The commands didn't work though, so I had to use a command-line for loop to delete all the firewall rules. When I then went to manually delete the networks, it gave me errors saying that there were still firewall rules. I remember @neozwu hitting this problem before, and he had to use the console at https://pantheon.corp.google.com/ to manually delete them. I have now gone and done the same.
At this point I don't really want to bother with these network tests (in the Compute integration tests) - we aren't updating the Compute code, and it's causing way too much pain to solve in the "right" way. I think we should just disable the network tests for now, and remove the gcloud commands we tried to add to the travis script.
The debug cycle with Travis has been annoying. I'd considered trying to use travis-build to test locally, but it didn't seem worth the trouble.
What happened when you ran the gcloud commands? For the other problems, it looks to me like the fix is to set the environment variables in integration_test_env.sh at the beginning and do gcloud auth application-default login.
When I ran the gcloud commands, it only deleted the first firewall. I think this has to do with handling of newlines in variables. That particular item is probably an easy fix, and maybe is purely due to the script using a different shell than the one I use.
You can't do gcloud auth application-default login remotely because that requires browser interaction.
If we replace the current google-cloud-compute with a new generated client, all of this becomes moot, which is why I'm inclined to disable the tests.
Probably.
Yes, just realized that.
I was concerned that other resources could end up hitting quota in the same way if Compute ITs are interrupted. Were you thinking we'd just disable the network tests and see how it goes?
Yeah, just see how it goes. Other resources have had quota problems in the past, but they haven't shown up again after being fixed. The network quota seems to consistently come back, though.
I agree that we should delete those tests . Regarding the issue of using gcloud auth application-default login, I think gcloud can get credential from a service account key.json file, which supposedly is silent. I haven't tried it though.
This was fixed by https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2285 .