Skip to content

Commit a0a4f7c

Browse files
committed
make changes to sample
1 parent f261f71 commit a0a4f7c

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

run/idp-sql/test/e2e_test_setup.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,3 @@ substitutions:
6161
_DB_NAME: postgres
6262
_DB_USER: postgres
6363
_DB_PASSWORD: password1234
64-
_SERVICE_ACCOUNT: ${PROJECT_NUMBER}@cloudbuild.gserviceaccount.com
65-
66-
serviceAccount: 'projects/${PROJECT_ID}/serviceAccounts/${_SERVICE_ACCOUNT}'
67-
options:
68-
logging: CLOUD_LOGGING_ONLY
69-
dynamicSubstitutions: true

run/idp-sql/test/system.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ describe('System Tests', () => {
6262
`--substitutions _SERVICE=${SERVICE_NAME},_PLATFORM=${PLATFORM},_REGION=${REGION}` +
6363
`,_DB_PASSWORD=${DB_PASSWORD},_CLOUD_SQL_CONNECTION_NAME=${CLOUD_SQL_CONNECTION_NAME}`;
6464
if (SAMPLE_VERSION) buildCmd += `,_VERSION=${SAMPLE_VERSION}`;
65-
if (SERVICE_ACCOUNT) buildCmd += `,_SERVICE_ACCOUNT=${SERVICE_ACCOUNT}`;
6665

6766
console.log('Starting Cloud Build...');
6867
execSync(buildCmd, {timeout: 240000, shell: true}); // timeout at 4 mins
@@ -112,7 +111,6 @@ describe('System Tests', () => {
112111
'--config ./test/e2e_test_cleanup.yaml ' +
113112
`--substitutions _SERVICE=${SERVICE_NAME},_PLATFORM=${PLATFORM},_REGION=${REGION}`;
114113
if (SAMPLE_VERSION) cleanUpCmd += `,_VERSION=${SAMPLE_VERSION}`;
115-
if (SERVICE_ACCOUNT) cleanUpCmd += `,_SERVICE_ACCOUNT=${SERVICE_ACCOUNT}`;
116114

117115
execSync(cleanUpCmd, {shell: true});
118116
});

run/system-package/ci-setup.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"env": {
3+
"SERVICE_NAME": "run-idp-sql-$RUN_ID",
4+
"SAMPLE_VERSION": "${RUN_ID}"
5+
}
6+
}

run/system-package/test/e2e_test_setup.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ steps:
2525
./test/retry.sh "gcloud run deploy ${_SERVICE} \
2626
--image gcr.io/${PROJECT_ID}/${_SERVICE}:${_VERSION} \
2727
--no-allow-unauthenticated \
28+
--add-custom-audiences 'https://action.test/' \
2829
--region ${_REGION} \
2930
--platform ${_PLATFORM}"
3031
@@ -37,3 +38,9 @@ substitutions:
3738
_VERSION: manual
3839
_REGION: us-central1
3940
_PLATFORM: managed
41+
_SERVICE_ACCOUNT: ${PROJECT_NUMBER}@cloudbuild.gserviceaccount.com
42+
43+
serviceAccount: 'projects/${PROJECT_ID}/serviceAccounts/${_SERVICE_ACCOUNT}'
44+
options:
45+
logging: CLOUD_LOGGING_ONLY
46+
dynamicSubstitutions: true

run/system-package/test/system.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ describe('End-to-End Tests', () => {
4141
);
4242
}
4343
const {SAMPLE_VERSION} = process.env;
44+
const {SERVICE_ACCOUNT} = process.env;
4445
const PLATFORM = 'managed';
4546
const REGION = 'us-central1';
4647

@@ -52,6 +53,7 @@ describe('End-to-End Tests', () => {
5253
'--config ./test/e2e_test_setup.yaml ' +
5354
`--substitutions _SERVICE=${SERVICE_NAME},_PLATFORM=${PLATFORM},_REGION=${REGION}`;
5455
if (SAMPLE_VERSION) buildCmd += `,_VERSION=${SAMPLE_VERSION}`;
56+
if (SERVICE_ACCOUNT) buildCmd += `,_SERVICE_ACCOUNT=${SERVICE_ACCOUNT}`;
5557

5658
console.log('Starting Cloud Build...');
5759
execSync(buildCmd, {timeout: 240000}); // timeout at 4 mins
@@ -79,6 +81,7 @@ describe('End-to-End Tests', () => {
7981
'--config ./test/e2e_test_cleanup.yaml ' +
8082
`--substitutions _SERVICE=${SERVICE_NAME},_PLATFORM=${PLATFORM},_REGION=${REGION}`;
8183
if (SAMPLE_VERSION) cleanUpCmd += `,_VERSION=${SAMPLE_VERSION}`;
84+
if (SERVICE_ACCOUNT) cleanUpCmd += `,_SERVICE_ACCOUNT=${SERVICE_ACCOUNT}`;
8285

8386
execSync(cleanUpCmd);
8487
});

0 commit comments

Comments
 (0)