Skip to content

Commit 87a4d6a

Browse files
committed
fix(test): resolve conflicts and fix assertion issues in files integration tests
2 parents 86109c6 + e29c4b7 commit 87a4d6a

243 files changed

Lines changed: 14930 additions & 1751 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/config/nodejs.jsonc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"cloud-sql/sqlserver/tedious", // (untested) TypeError: The "config.server" property is required and must be of type string.
8181
"compute", // GoogleError: The resource 'projects/long-door-651/zones/us-central1-a/disks/disk-from-pool-name' was not found
8282
"dataproc", // GoogleError: Error submitting create cluster request: Multiple validation errors
83-
"datastore/functions", // [ERR_REQUIRE_ESM]: require() of ES Module
8483
"dialogflow-cx", // NOT_FOUND: com.google.apps.framework.request.NotFoundException: Agent 'undefined' does not exist
8584
"dlp", // [ERR_REQUIRE_ESM]: require() of ES Module
8685
"document-ai", // [ERR_REQUIRE_ESM]: require() of ES Module

.github/workflows/datastore-functions.yaml

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: datastore-functions
15+
name: Deprecated Workflow
1616
on:
17-
push:
18-
branches:
19-
- main
20-
paths:
21-
- 'datastore/functions/**'
22-
- '.github/workflows/datastore-functions.yaml'
23-
- '.github/workflows/test.yaml'
24-
pull_request:
25-
types:
26-
- opened
27-
- reopened
28-
- synchronize
29-
- labeled
30-
paths:
31-
- 'datastore/functions/**'
32-
- '.github/workflows/datastore-functions.yaml'
33-
- '.github/workflows/test.yaml'
34-
schedule:
35-
- cron: '0 0 * * 0'
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
3622
jobs:
37-
test:
38-
permissions:
39-
contents: 'read'
40-
id-token: 'write'
41-
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
42-
uses: ./.github/workflows/test.yaml
43-
with:
44-
name: 'datastore-functions'
45-
path: 'datastore/functions'
23+
deprecated:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- run: echo "This workflow is deprecated and kept temporarily to bypass zizmor scan."

.github/workflows/utils/workflows.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"datacatalog/snippets",
3434
"datalabeling",
3535
"dataproc",
36-
"datastore/functions",
3736
"dialogflow",
3837
"discoveryengine",
3938
"dlp",

appengine/storage/flexible/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"@google-cloud/storage": "^7.0.0",
1313
"express": "^4.18.2",
14-
"multer": "^1.4.5-lts.1",
14+
"multer": "^2.1.1",
1515
"pug": "^3.0.2"
1616
},
1717
"devDependencies": {

appengine/storage/flexible/system-test/app.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ const requestObj = supertest(proxyquire(path.join(cwd, 'app'), {process}));
3232

3333
before(async () => {
3434
try {
35-
await bucket.create(bucket).then(() => {
36-
return bucket.acl.add({
37-
entity: 'allUsers',
38-
role: Storage.acl.READER_ROLE,
39-
});
40-
});
35+
await bucket.create();
4136
} catch (err) {
4237
if (
4338
!err.message.match(

appengine/storage/flexible_nodejs16_and_earlier/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"@google-cloud/storage": "^7.0.0",
1313
"express": "^4.18.2",
14-
"multer": "^1.4.5-lts.1",
14+
"multer": "^2.1.1",
1515
"pug": "^3.0.2"
1616
},
1717
"devDependencies": {

appengine/storage/flexible_nodejs16_and_earlier/system-test/app.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ const requestObj = supertest(proxyquire(path.join(cwd, 'app'), {process}));
3232

3333
before(async () => {
3434
try {
35-
await bucket.create(bucket).then(() => {
36-
return bucket.acl.add({
37-
entity: 'allUsers',
38-
role: Storage.acl.READER_ROLE,
39-
});
40-
});
35+
await bucket.create();
4136
} catch (err) {
4237
if (
4338
!err.message.match(

appengine/storage/standard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"@google-cloud/storage": "^7.0.0",
1313
"express": "^4.18.2",
14-
"multer": "^1.4.5-lts.1",
14+
"multer": "^2.1.1",
1515
"pug": "^3.0.2"
1616
},
1717
"devDependencies": {

appengine/storage/standard/system-test/app.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ const requestObj = supertest(proxyquire(path.join(cwd, 'app'), {process}));
3232

3333
before(async () => {
3434
try {
35-
await bucket.create(bucket).then(() => {
36-
return bucket.acl.add({
37-
entity: 'allUsers',
38-
role: Storage.acl.READER_ROLE,
39-
});
40-
});
35+
await bucket.create();
4136
} catch (err) {
4237
if (
4338
!err.message.match(

asset/snippets/test/asset.test.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,35 @@ describe('asset sample tests', () => {
104104
assert.ok(included);
105105
});
106106

107-
it('should list assets successfully', async () => {
107+
it('should list assets successfully', async function () {
108108
const assetType = 'storage.googleapis.com/Bucket';
109-
const stdout = execSync(`node listAssets ${assetType} 'RESOURCE'`);
109+
let waitMs = 60000;
110+
let stdout = '';
111+
const maxRetries = 3;
112+
113+
for (let retry = 0; retry < maxRetries; retry++) {
114+
try {
115+
await sleep(waitMs);
116+
stdout = execSync(`node listAssets ${assetType} 'RESOURCE'`);
117+
break;
118+
} catch (err) {
119+
const errorMessage = err.stderr || err.message || '';
120+
if (
121+
errorMessage.includes('RESOURCE_EXHAUSTED') ||
122+
errorMessage.includes('Quota exceeded')
123+
) {
124+
if (retry === maxRetries - 1) {
125+
console.warn(
126+
'[Quota Error] Max retries exhausted. Test did not recover in time. Skipping test...'
127+
);
128+
this.skip();
129+
}
130+
} else {
131+
throw err;
132+
}
133+
}
134+
waitMs *= 2;
135+
}
110136
assert.include(stdout, assetType);
111137
});
112138

0 commit comments

Comments
 (0)