Skip to content

Commit 755e8bb

Browse files
chore: update the filesystem sample tests (GoogleCloudPlatform#9112)
* update filesystem sample * lint * fix * Update cloudbuild.yaml --------- Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com>
1 parent d302dae commit 755e8bb

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

run/filesystem/cloudbuild.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,23 @@
1010
# limitations under the License.
1111

1212
steps:
13-
- id: "Docker build"
14-
name: "gcr.io/cloud-builders/docker"
15-
args:
16-
["build", "-t", "${_AR_REPO_URL}/filesystem-e2e-test:${BUILD_ID}", "."]
17-
- id: "Docker push to Artifact Registry"
18-
name: "gcr.io/cloud-builders/docker"
19-
args: ["push", "${_AR_REPO_URL}/filesystem-e2e-test:${BUILD_ID}"]
2013
- id: "Deploy to Cloud Run"
2114
name: "gcr.io/cloud-builders/gcloud:latest"
2215
args:
2316
- beta
2417
- run
2518
- deploy
2619
- ${_SERVICE_NAME}
27-
- --image=${_AR_REPO_URL}/filesystem-e2e-test:${BUILD_ID}
20+
- --source=.
2821
- --execution-environment=gen2
2922
- --vpc-connector=${_CONNECTOR}
3023
- --update-env-vars=FILESTORE_IP_ADDRESS=${_FILESTORE_IP_ADDRESS},FILE_SHARE_NAME=${_FILESHARE}
3124
- --region=${_DEPLOY_REGION}
3225
- --no-allow-unauthenticated
3326

3427
substitutions:
28+
_SERVICE_NAME: filesystem
3529
_DEPLOY_REGION: us-central1
3630
_FILESHARE: vol1
37-
_AR_REPO_URL: us-central1-docker.pkg.dev/${PROJECT_ID}/cloud-run-source-deploy
38-
39-
options:
40-
dynamic_substitutions: true
31+
_CONNECTOR: my-run-connector
32+
_FILESTORE_IP_ADDRESS: 0.0.0.0

run/filesystem/e2e_test.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# Unique suffix to create distinct service names
2828
SUFFIX = uuid.uuid4().hex
2929
PROJECT = os.environ['GOOGLE_CLOUD_PROJECT']
30+
region = 'us-central1'
3031

3132

3233
@pytest.fixture
@@ -58,10 +59,23 @@ def deployed_service():
5859
'services',
5960
'delete',
6061
service_name,
61-
'--region=us-central1',
62+
f'--region={region}',
6263
'--platform=managed',
6364
'--quiet',
64-
"--async",
65+
'--project',
66+
PROJECT,
67+
]
68+
)
69+
70+
subprocess.check_call(
71+
[
72+
'gcloud',
73+
'artifacts',
74+
'docker',
75+
'images',
76+
'delete',
77+
f'{region}-docker.pkg.dev/{PROJECT}/cloud-run-source-deploy/{service_name}',
78+
'--quiet',
6579
'--project',
6680
PROJECT,
6781
]
@@ -79,7 +93,7 @@ def service_url_auth_token(deployed_service):
7993
'services',
8094
'describe',
8195
deployed_service,
82-
'--region=us-central1',
96+
f'--region={region}',
8397
'--platform=managed',
8498
'--format=value(status.url)',
8599
'--project',

0 commit comments

Comments
 (0)