Skip to content

Commit 468c233

Browse files
fix: bug in system test deletion logic (#6845)
* add new test fixtures to debug system test failures * fix: bug in logic that skipped full iteration of filePaths * cleanup * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: setup test fixtures correctly * remove .Owlbot.yaml files * undo release-please config --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 85f7039 commit 468c233

161 files changed

Lines changed: 253541 additions & 49 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.

packages/gapic-node-processing/src/combine-libraries.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,13 @@ export function setOnlyDefaultSystemTests(
201201
'system-test/fixtures/sample/src',
202202
);
203203

204-
for (const filePathObj of filePaths) {
204+
for (let i = filePaths.length - 1; i >= 0; i--) {
205+
const filePathObj = filePaths[i];
205206
if (
206207
systemTestRegex.test(filePathObj.filePath) &&
207208
!filePathObj.filePath.includes(defaultVersion)
208209
) {
209-
filePaths.splice(filePaths.indexOf(filePathObj), 1);
210+
filePaths.splice(i, 1);
210211
}
211212
}
212213
}

packages/gapic-node-processing/test/combine-libraries.test.ts

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ export const LIB_PRE_COMBINATION_ESM = 'google-cloud-tasks-nodejs';
3131
export const LIB_PRE_COMBINATION = 'google-cloud-speech-nodejs';
3232
export const LIB_POST_COMBINATION_ESM = 'google-cloud-tasks';
3333
export const LIB_POST_COMBINATION = 'google-cloud-speech';
34+
export const LIB_PRE_COMBINATION_DEFAULT_SYSTEM_TEST = 'google-analytics-data-nodejs';
35+
export const LIB_POST_COMBINATION_DEFAULT_SYSTEM_TEST = 'google-analytics-data';
3436

3537
const libraryConfigCJS = new LibraryConfig({
3638
sourcePath: path.resolve(TEST_FIXTURES_PATH, LIB_PRE_COMBINATION),
@@ -50,6 +52,18 @@ const libraryConfigESM = new LibraryConfig({
5052
defaultVersion: 'v1',
5153
isEsm: true,
5254
});
55+
const libraryConfigDefaultSystemTest = new LibraryConfig({
56+
sourcePath: path.resolve(
57+
TEST_FIXTURES_PATH,
58+
LIB_PRE_COMBINATION_DEFAULT_SYSTEM_TEST,
59+
),
60+
destinationPath: path.resolve(
61+
TEST_FIXTURES_PATH,
62+
LIB_POST_COMBINATION_DEFAULT_SYSTEM_TEST,
63+
),
64+
defaultVersion: 'v1beta',
65+
isEsm: false,
66+
});
5367

5468
describe('combine libraries', () => {
5569
it('should throw an error if the library is not in a "pre" combo state', async () => {
@@ -197,55 +211,32 @@ describe('combine libraries', () => {
197211
});
198212

199213
it('should only have default system tests', async () => {
200-
await combineLibraries(libraryConfigCJS);
214+
await combineLibraries(libraryConfigDefaultSystemTest);
201215

202216
assert.match(
203217
await fs.readFile(
204218
path.resolve(
205219
TEST_FIXTURES_PATH,
206-
LIB_POST_COMBINATION,
220+
LIB_POST_COMBINATION_DEFAULT_SYSTEM_TEST,
207221
'system-test/fixtures/sample/src/index.js',
208222
),
209223
'utf-8',
210224
),
211-
/AdaptationClient/,
225+
/BetaAnalyticsDataClient/,
212226
);
213227

214228
assert.match(
215229
await fs.readFile(
216230
path.resolve(
217231
TEST_FIXTURES_PATH,
218-
LIB_POST_COMBINATION,
219-
'system-test/fixtures/sample/src/index.js',
220-
),
221-
'utf-8',
222-
),
223-
/SpeechClient/,
224-
);
225-
226-
assert.match(
227-
await fs.readFile(
228-
path.resolve(
229-
TEST_FIXTURES_PATH,
230-
LIB_POST_COMBINATION,
232+
LIB_POST_COMBINATION_DEFAULT_SYSTEM_TEST,
231233
'system-test/fixtures/sample/src/index.ts',
232234
),
233235
'utf-8',
234236
),
235-
/AdaptationClient/,
237+
/BetaAnalyticsDataClient/,
236238
);
237239

238-
assert.match(
239-
await fs.readFile(
240-
path.resolve(
241-
TEST_FIXTURES_PATH,
242-
LIB_POST_COMBINATION,
243-
'system-test/fixtures/sample/src/index.ts',
244-
),
245-
'utf-8',
246-
),
247-
/SpeechClient/,
248-
);
249240
});
250241

251242
it('should create a directory and write files', async () => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/node_modules
2+
**/.coverage
3+
build/
4+
docs/
5+
protos/
6+
system-test/
7+
samples/generated/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./node_modules/gts"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.ts text eol=lf
2+
*.js text eol=lf
3+
protos/* linguist-generated
4+
**/api-extractor.json linguist-language=JSON-with-Comments
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
**/*.log
2+
**/node_modules
3+
/.coverage
4+
/coverage
5+
/.nyc_output
6+
/docs/
7+
/out/
8+
/build/
9+
system-test/secrets.js
10+
system-test/*key.json
11+
*.lock
12+
.DS_Store
13+
package-lock.json
14+
__pycache__
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// ** This file is automatically generated by gapic-generator-typescript. **
16+
// ** https://github.com/googleapis/gapic-generator-typescript **
17+
// ** All changes to this file may be overwritten. **
18+
19+
'use strict';
20+
21+
module.exports = {
22+
opts: {
23+
readme: './README.md',
24+
package: './package.json',
25+
template: './node_modules/jsdoc-fresh',
26+
recurse: true,
27+
verbose: true,
28+
destination: './docs/'
29+
},
30+
plugins: [
31+
'plugins/markdown',
32+
'jsdoc-region-tag'
33+
],
34+
source: {
35+
excludePattern: '(^|\\/|\\\\)[._]',
36+
include: [
37+
'build/src',
38+
'protos'
39+
],
40+
includePattern: '\\.js$'
41+
},
42+
templates: {
43+
copyright: 'Copyright 2025 Google LLC',
44+
includeDate: false,
45+
sourceFiles: false,
46+
systemName: '@google-cloud/data',
47+
theme: 'lumen',
48+
default: {
49+
outputSourceFiles: false
50+
}
51+
},
52+
markdown: {
53+
idInHeadings: true
54+
}
55+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// ** This file is automatically generated by gapic-generator-typescript. **
16+
// ** https://github.com/googleapis/gapic-generator-typescript **
17+
// ** All changes to this file may be overwritten. **
18+
19+
const config = {
20+
"enable-source-maps": true,
21+
"throw-deprecation": true,
22+
"timeout": 10000
23+
}
24+
if (process.env.MOCHA_THROW_DEPRECATION === 'false') {
25+
delete config['throw-deprecation'];
26+
}
27+
if (process.env.MOCHA_REPORTER) {
28+
config.reporter = process.env.MOCHA_REPORTER;
29+
}
30+
if (process.env.MOCHA_REPORTER_OUTPUT) {
31+
config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`;
32+
}
33+
module.exports = config
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"report-dir": "./.coverage",
3+
"reporter": ["text", "lcov"],
4+
"exclude": [
5+
"**/*-test",
6+
"**/.coverage",
7+
"**/apis",
8+
"**/benchmark",
9+
"**/conformance",
10+
"**/docs",
11+
"**/samples",
12+
"**/scripts",
13+
"**/protos",
14+
"**/test",
15+
"**/*.d.ts",
16+
".jsdoc.js",
17+
"**/.jsdoc.js",
18+
"karma.conf.js",
19+
"webpack-tests.config.js",
20+
"webpack.config.js"
21+
],
22+
"exclude-after-remap": false,
23+
"all": true
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/node_modules
2+
**/coverage
3+
test/fixtures
4+
build/
5+
docs/
6+
protos/

0 commit comments

Comments
 (0)