File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,18 +21,17 @@ jobs:
2121 pull-requests : ' write'
2222 id-token : ' write'
2323 steps :
24- - uses : ' google-github-actions/auth@v0.3.1'
24+ - uses : actions/checkout@v3
25+ with :
26+ ref : ${{github.event.pull_request.head.ref}}
27+ repository : ${{github.event.pull_request.head.repo.full_name}}
28+ - uses : ' google-github-actions/auth@v0.6.0'
2529 with :
2630 workload_identity_provider : ' projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
2731 service_account : ' kokoro-system-test@long-door-651.iam.gserviceaccount.com'
28- create_credentials_file : ' true'
29- credentials_json : ' ${{ secrets.GOOGLE_CREDENTIALS }}'
32+ token_format : ' access_token'
3033 access_token_lifetime : 600s
31- - uses : actions/checkout@v2
32- with :
33- ref : ${{github.event.pull_request.head.ref}}
34- repository : ${{github.event.pull_request.head.repo.full_name}}
35- - uses : actions/setup-node@v2
34+ - uses : actions/setup-node@v3
3635 with :
3736 node-version : 14
3837 - run : npm install
4443 MOCHA_REPORTER_OUTPUT : appengine_storage_flexible_sponge_log.xml
4544 MOCHA_REPORTER : xunit
4645 - if : ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }}
47- uses : actions/github-script@v5
46+ uses : actions/github-script@v6
4847 with :
4948 github-token : ${{ secrets.GITHUB_TOKEN }}
5049 script : |
Original file line number Diff line number Diff line change @@ -21,17 +21,15 @@ jobs:
2121 pull-requests : ' write'
2222 id-token : ' write'
2323 steps :
24- - uses : ' google-github-actions/auth@v0.3.1'
24+ - uses : actions/checkout@v3
25+ with :
26+ ref : ${{github.event.pull_request.head.ref}}
27+ repository : ${{github.event.pull_request.head.repo.full_name}}
28+ - uses : ' google-github-actions/auth@v0.6.0'
2529 with :
2630 workload_identity_provider : ' projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
2731 service_account : ' kokoro-system-test@long-door-651.iam.gserviceaccount.com'
28- create_credentials_file : ' true'
29- credentials_json : ' ${{ secrets.GOOGLE_CREDENTIALS }}'
3032 access_token_lifetime : 600s
31- - uses : actions/checkout@v2
32- with :
33- ref : ${{github.event.pull_request.head.ref}}
34- repository : ${{github.event.pull_request.head.repo.full_name}}
3533 - uses : actions/setup-node@v2
3634 with :
3735 node-version : 14
4442 MOCHA_REPORTER_OUTPUT : appengine_storage_standard_sponge_log.xml
4543 MOCHA_REPORTER : xunit
4644 - if : ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }}
47- uses : actions/github-script@v5
45+ uses : actions/github-script@v6
4846 with :
4947 github-token : ${{ secrets.GITHUB_TOKEN }}
5048 script : |
Original file line number Diff line number Diff line change 1515
1616const path = require ( 'path' ) ;
1717const { Storage} = require ( '@google-cloud/storage' ) ;
18+ const supertest = require ( 'supertest' ) ;
1819const storage = new Storage ( ) ;
1920const assert = require ( 'assert' ) ;
20- const supertest = require ( 'supertest' ) ;
2121const proxyquire = require ( 'proxyquire' ) . noPreserveCache ( ) ;
2222
2323process . env . GCLOUD_STORAGE_BUCKET =
@@ -29,12 +29,22 @@ const cwd = path.join(__dirname, '../');
2929const requestObj = supertest ( proxyquire ( path . join ( cwd , 'app' ) , { process} ) ) ;
3030
3131before ( async ( ) => {
32- await bucket . create ( bucket ) . then ( ( ) => {
33- return bucket . acl . add ( {
34- entity : 'allUsers' ,
35- role : Storage . acl . READER_ROLE ,
32+ try {
33+ await bucket . create ( bucket ) . then ( ( ) => {
34+ return bucket . acl . add ( {
35+ entity : 'allUsers' ,
36+ role : Storage . acl . READER_ROLE ,
37+ } ) ;
3638 } ) ;
37- } ) ;
39+ } catch ( err ) {
40+ if (
41+ ! err . message . match (
42+ / Y o u r p r e v i o u s r e q u e s t t o c r e a t e t h e n a m e d b u c k e t s u c c e e d e d a n d y o u a l r e a d y o w n i t ./
43+ )
44+ ) {
45+ throw err ;
46+ }
47+ }
3848} ) ;
3949after ( async ( ) => {
4050 try {
Original file line number Diff line number Diff line change 1616const path = require ( 'path' ) ;
1717const { Storage} = require ( '@google-cloud/storage' ) ;
1818const storage = new Storage ( ) ;
19- const assert = require ( 'assert' ) ;
2019const supertest = require ( 'supertest' ) ;
20+ const assert = require ( 'assert' ) ;
2121const proxyquire = require ( 'proxyquire' ) . noPreserveCache ( ) ;
2222
2323process . env . GCLOUD_STORAGE_BUCKET =
@@ -29,12 +29,22 @@ const cwd = path.join(__dirname, '../');
2929const requestObj = supertest ( proxyquire ( path . join ( cwd , 'app' ) , { process} ) ) ;
3030
3131before ( async ( ) => {
32- await bucket . create ( bucket ) . then ( ( ) => {
33- return bucket . acl . add ( {
34- entity : 'allUsers' ,
35- role : Storage . acl . READER_ROLE ,
32+ try {
33+ await bucket . create ( bucket ) . then ( ( ) => {
34+ return bucket . acl . add ( {
35+ entity : 'allUsers' ,
36+ role : Storage . acl . READER_ROLE ,
37+ } ) ;
3638 } ) ;
37- } ) ;
39+ } catch ( err ) {
40+ if (
41+ ! err . message . match (
42+ / Y o u r p r e v i o u s r e q u e s t t o c r e a t e t h e n a m e d b u c k e t s u c c e e d e d a n d y o u a l r e a d y o w n i t ./
43+ )
44+ ) {
45+ throw err ;
46+ }
47+ }
3848} ) ;
3949after ( async ( ) => {
4050 try {
You can’t perform that action at this time.
0 commit comments