Skip to content

Commit b018305

Browse files
authored
fix: update Jobs region (GoogleCloudPlatform#7849)
## Description Fixes GoogleCloudPlatform#7636 Note: It's a good idea to open an issue first for discussion. ## Checklist - [ ] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md) - [ ] README is updated to include [all relevant information](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#readme-file) - [ ] **Tests** pass: `nox -s py-3.6` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] **Lint** pass: `nox -s lint` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones) - [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones) - [ ] Please **merge** this PR for me once it is approved. - [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/.github/CODEOWNERS) with the codeowners for this sample
1 parent 9e3dd86 commit b018305

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

run/jobs/e2e_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
SUFFIX = uuid.uuid4().hex[:10]
3131
PROJECT = os.environ["GOOGLE_CLOUD_PROJECT"]
3232
SERVICE = "job-quickstart-" + SUFFIX
33+
REGION = "us-west1"
3334

3435

3536
@pytest.fixture
@@ -45,7 +46,7 @@ def setup_job():
4546
"--project",
4647
PROJECT,
4748
"--substitutions",
48-
"_SERVICE=" + SERVICE + ",_VERSION=" + SUFFIX,
49+
"_SERVICE=" + SERVICE + ",_VERSION=" + SUFFIX + ",_REGION=" + REGION,
4950
]
5051
)
5152

@@ -62,7 +63,7 @@ def setup_job():
6263
"--project",
6364
PROJECT,
6465
"--substitutions",
65-
"_SERVICE=" + SERVICE + ",_VERSION=" + SUFFIX,
66+
"_SERVICE=" + SERVICE + ",_VERSION=" + SUFFIX + ",_REGION=" + REGION,
6667
]
6768
)
6869

@@ -77,7 +78,7 @@ def test_end_to_end(setup_job):
7778
f"timestamp>=\"{filter_date.isoformat('T')}\" "
7879
"resource.type=cloud_run_job "
7980
f"AND resource.labels.job_name={SERVICE} "
80-
"resource.labels.location = \"us-central1\" "
81+
f"resource.labels.location = \"{REGION}\" "
8182
"-protoPayload.serviceName=\"run.googleapis.com\""
8283
)
8384

@@ -95,6 +96,6 @@ def test_end_to_end(setup_job):
9596
if found:
9697
break
9798
# Linear backoff
98-
time.sleep(x * 5)
99+
time.sleep(x * 10)
99100

100101
assert found

run/jobs/e2e_test_cleanup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ steps:
2929
substitutions:
3030
_SERVICE: logger-job
3131
_VERSION: manual
32-
_REGION: us-central1
32+
_REGION: us-west1
3333

run/jobs/e2e_test_setup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ steps:
4747
substitutions:
4848
_SERVICE: logger-job
4949
_VERSION: manual
50-
_REGION: us-central1
50+
_REGION: us-west1

0 commit comments

Comments
 (0)