Skip to content

Commit

Permalink
fix(appengine): set project for bundled tests (#13165)
Browse files Browse the repository at this point in the history
  • Loading branch information
glasnt authored Feb 14, 2025
1 parent bb69110 commit 9990873
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import json
import os
import re
import subprocess
import uuid
Expand All @@ -21,6 +22,8 @@
import pytest
import requests

project_id = os.environ["GOOGLE_CLOUD_PROJECT"]


@backoff.on_exception(backoff.expo, Exception, max_tries=3)
def gcloud_cli(command):
Expand All @@ -37,7 +40,7 @@ def gcloud_cli(command):
Raises Exception with the stderr output of the last attempt on failure.
"""
full_command = f"gcloud {command} --quiet --format=json"
full_command = f"gcloud {command} --quiet --format=json --project {project_id}"
print("Running command:", full_command)

output = subprocess.run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import json
import os
import re
import subprocess
import uuid
Expand All @@ -21,6 +22,8 @@
import pytest
import requests

project_id = os.environ["GOOGLE_CLOUD_PROJECT"]


@backoff.on_exception(backoff.expo, Exception, max_tries=3)
def gcloud_cli(command):
Expand All @@ -37,7 +40,7 @@ def gcloud_cli(command):
Raises Exception with the stderr output of the last attempt on failure.
"""
full_command = f"gcloud {command} --quiet --format=json"
full_command = f"gcloud {command} --quiet --format=json --project {project_id}"
print("Running command:", full_command)

output = subprocess.run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import json
import os
import re
import subprocess
import uuid
Expand All @@ -21,6 +22,8 @@
import pytest
import requests

project_id = os.environ["GOOGLE_CLOUD_PROJECT"]


@backoff.on_exception(backoff.expo, Exception, max_tries=5)
def gcloud_cli(command):
Expand All @@ -37,7 +40,7 @@ def gcloud_cli(command):
Raises Exception with the stderr output of the last attempt on failure.
"""
full_command = f"gcloud {command} --quiet --format=json"
full_command = f"gcloud {command} --quiet --format=json --project {project_id}"
print("Running command:", full_command)

output = subprocess.run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import json
import os
import subprocess
import time
import uuid
Expand All @@ -21,6 +22,8 @@
import pytest
import requests

project_id = os.environ["GOOGLE_CLOUD_PROJECT"]


@backoff.on_exception(backoff.expo, Exception, max_tries=3)
def gcloud_cli(command):
Expand All @@ -37,7 +40,7 @@ def gcloud_cli(command):
Raises Exception with the stderr output of the last attempt on failure.
"""
full_command = f"gcloud {command} --quiet --format=json"
full_command = f"gcloud {command} --quiet --format=json --project {project_id}"
print("Running command:", full_command)

output = subprocess.run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import json
import os
import subprocess
import time
import uuid
Expand All @@ -21,6 +22,8 @@
import pytest
import requests

project_id = os.environ["GOOGLE_CLOUD_PROJECT"]


@backoff.on_exception(backoff.expo, Exception, max_tries=3)
def gcloud_cli(command):
Expand All @@ -37,7 +40,7 @@ def gcloud_cli(command):
Raises Exception with the stderr output of the last attempt on failure.
"""
full_command = f"gcloud {command} --quiet --format=json"
full_command = f"gcloud {command} --quiet --format=json --project {project_id}"
print("Running command:", full_command)

output = subprocess.run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import json
import os
import subprocess
import time
import uuid
Expand All @@ -21,6 +22,8 @@
import pytest
import requests

project_id = os.environ["GOOGLE_CLOUD_PROJECT"]


@backoff.on_exception(backoff.expo, Exception, max_tries=3)
def gcloud_cli(command):
Expand All @@ -37,7 +40,7 @@ def gcloud_cli(command):
Raises Exception with the stderr output of the last attempt on failure.
"""
full_command = f"gcloud {command} --quiet --format=json"
full_command = f"gcloud {command} --quiet --format=json --project {project_id}"
print("Running command:", full_command)

output = subprocess.run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import json
import os
import subprocess
import time
import uuid
Expand All @@ -21,6 +22,8 @@
import pytest
import requests

project_id = os.environ["GOOGLE_CLOUD_PROJECT"]


@backoff.on_exception(backoff.expo, Exception, max_tries=3)
def gcloud_cli(command):
Expand All @@ -37,7 +40,7 @@ def gcloud_cli(command):
Raises Exception with the stderr output of the last attempt on failure.
"""
full_command = f"gcloud {command} --quiet --format=json"
full_command = f"gcloud {command} --quiet --format=json --project {project_id}"
print("Running command:", full_command)

output = subprocess.run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
# limitations under the License.

import json
import os
import subprocess
import uuid

import backoff
import pytest
import requests

project_id = os.environ["GOOGLE_CLOUD_PROJECT"]


@backoff.on_exception(backoff.expo, Exception, max_tries=3)
def gcloud_cli(command):
Expand All @@ -36,7 +39,7 @@ def gcloud_cli(command):
Raises Exception with the stderr output of the last attempt on failure.
"""
full_command = f"gcloud {command} --quiet --format=json"
full_command = f"gcloud {command} --quiet --format=json --project {project_id}"
print("Running command:", full_command)

output = subprocess.run(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import json
import os
import subprocess
import time
import uuid
Expand All @@ -21,6 +22,8 @@
import pytest
import requests

project_id = os.environ["GOOGLE_CLOUD_PROJECT"]


@backoff.on_exception(backoff.expo, Exception, max_tries=3)
def gcloud_cli(command):
Expand All @@ -37,7 +40,7 @@ def gcloud_cli(command):
Raises Exception with the stderr output of the last attempt on failure.
"""
full_command = f"gcloud {command} --quiet --format=json"
full_command = f"gcloud {command} --quiet --format=json --project {project_id}"
print("Running command:", full_command)

output = subprocess.run(
Expand Down

0 comments on commit 9990873

Please sign in to comment.