Skip to content

Commit 24cf623

Browse files
authored
feat: testing-isolation split into prod and dev (#3936)
* feat: testing-isolation split into prod and dev * feat: testing-isolation split into prod and dev * fix merge conflict * use node 18 * use node 16 * use node 20 * add mocha reporter output env var * exclude packages that should not be tested * migrate some healthcare samples to prod * restore old workflows
1 parent d7fb7e2 commit 24cf623

File tree

5 files changed

+394
-118
lines changed

5 files changed

+394
-118
lines changed

.github/config/nodejs-dev.jsonc

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
/*
2+
Copyright 2024 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
{
18+
"package-file": [ "package.json" ],
19+
"ignore": [
20+
".eslintignore",
21+
".eslintrc.json",
22+
".github/.OwlBot.lock.yaml",
23+
".github/.OwlBot.yaml",
24+
".github/ISSUE_TEMPLATE/",
25+
".github/PULL_REQUEST_TEMPLATE.md",
26+
".github/auto-label.yaml",
27+
".github/blunderbuss.yaml",
28+
".github/cloud-samples-tools/",
29+
".github/flakybot.yaml",
30+
".github/header-checker-lint.yaml",
31+
".github/snippet-bot.yml",
32+
".github/trusted-contribution.yml",
33+
".gitignore",
34+
".kokoro/",
35+
".prettierignore",
36+
".prettierrc.js",
37+
"CODEOWNERS",
38+
"CODE_OF_CONDUCT.md",
39+
"CONTRIBUTING.md",
40+
"LICENSE",
41+
"Makefile",
42+
"README.md",
43+
"SECURITY.md",
44+
"buildsetup.sh",
45+
"linkinator.config.json",
46+
"node_modules/",
47+
"owlbot.py",
48+
"renovate.json"
49+
],
50+
// These are all working well in prod, so we can exclude them from dev.
51+
// Once all packages are in prod, we can remove this dev config.
52+
"exclude-packages": [
53+
"functions/concepts", // parent directory
54+
"functions/firebase", // parent directory
55+
"functions/helloworld", // parent directory
56+
"functions/http", // parent directory
57+
"functions/http/uploadFile", // parent directory
58+
"functions/log", // parent directory
59+
"functions/pubsub", // parent directory
60+
"memorystore/redis", // parent directory
61+
"recaptcha_enterprise/demosite/app", // no tests exist
62+
63+
// These tests are already passing in prod, so skip them in dev.
64+
"appengine/building-an-app/build",
65+
"appengine/building-an-app/update",
66+
"appengine/datastore",
67+
"appengine/endpoints",
68+
"appengine/hello-world/flexible",
69+
"appengine/hello-world/flexible_nodejs16_and_earlier",
70+
"appengine/hello-world/standard",
71+
"appengine/memcached",
72+
"appengine/metadata/flexible_nodejs16_and_earlier",
73+
"appengine/pubsub",
74+
"appengine/static-files",
75+
"appengine/storage/flexible",
76+
"appengine/storage/flexible_nodejs16_and_earlier",
77+
"appengine/storage/standard",
78+
"appengine/typescript",
79+
"appengine/websockets",
80+
"asset/snippets",
81+
"auth",
82+
"batch",
83+
"cloud-language",
84+
"cloud-tasks/snippets",
85+
"cloud-tasks/tutorial-gcf/app",
86+
"cloud-tasks/tutorial-gcf/function",
87+
"cloudbuild",
88+
"composer",
89+
"composer/functions/composer-storage-trigger",
90+
"contact-center-insights",
91+
"container",
92+
"container-analysis/snippets",
93+
"datacatalog/cloud-client",
94+
"datacatalog/quickstart",
95+
"datacatalog/snippets",
96+
"datalabeling",
97+
"dialogflow",
98+
"discoveryengine",
99+
"document-warehouse",
100+
"endpoints/getting-started",
101+
"endpoints/getting-started-grpc",
102+
"error-reporting",
103+
"eventarc/generic",
104+
"functions/concepts/afterResponse",
105+
"functions/concepts/afterTimeout",
106+
"functions/concepts/backgroundTermination",
107+
"functions/concepts/filesystem",
108+
"functions/concepts/httpTermination",
109+
"functions/concepts/requests",
110+
"functions/concepts/stateless",
111+
"functions/env_vars",
112+
"functions/firebase/helloAnalytics",
113+
"functions/firebase/helloAuth",
114+
"functions/firebase/helloFirestore",
115+
"functions/firebase/helloRTDB",
116+
"functions/firebase/helloRemoteConfig",
117+
"functions/firebase/makeUpperCase",
118+
"functions/helloworld/helloError",
119+
"functions/helloworld/helloGCS",
120+
"functions/helloworld/helloPubSub",
121+
"functions/helloworld/helloworldGet",
122+
"functions/helloworld/helloworldHttp",
123+
"functions/http/corsEnabledFunction",
124+
"functions/http/corsEnabledFunctionAuth",
125+
"functions/http/httpContent",
126+
"functions/http/httpMethods",
127+
"functions/http/parseXML",
128+
"functions/log/helloWorld",
129+
"functions/log/processEntry",
130+
"functions/memorystore/redis",
131+
"functions/pubsub/publish",
132+
"functions/pubsub/subscribe",
133+
"functions/scheduleinstance",
134+
"functions/security",
135+
"functions/spanner",
136+
"functions/speech-to-speech/functions",
137+
"functions/tips",
138+
"functions/tips/avoidInfiniteRetries",
139+
"functions/tips/connectionPools",
140+
"functions/tips/gcpApiCall",
141+
"functions/tips/lazyGlobals",
142+
"functions/tips/retry",
143+
"functions/tips/scopeDemo",
144+
"functions/v2/autoLabelInstance",
145+
"functions/v2/cloudEventLogging",
146+
"functions/v2/firebase/firestore/helloFirestore",
147+
"functions/v2/firebase/firestore/makeUpperCase",
148+
"functions/v2/firebase/remote-config/helloRemoteConfig",
149+
"functions/v2/firebase/rtdb/helloRTDB",
150+
"functions/v2/helloAuditLog",
151+
"functions/v2/helloBigQuery",
152+
"functions/v2/helloGCS",
153+
"functions/v2/helloPubSub",
154+
"functions/v2/httpLogging",
155+
"functions/v2/log/processEntry",
156+
"functions/v2/ocr/app",
157+
"functions/v2/responseStreaming",
158+
"functions/v2/tips/avoidInfiniteRetries",
159+
"functions/v2/tips/retry",
160+
"functions/v2/typed/googlechatbot",
161+
"functions/v2/typed/greeting",
162+
"healthcare/consent",
163+
"healthcare/datasets",
164+
"healthcare/dicom",
165+
"healthcare/hl7v2",
166+
"kms",
167+
"media/livestream",
168+
"media/transcoder",
169+
"media/video-stitcher",
170+
"mediatranslation",
171+
"monitoring/prometheus",
172+
"monitoring/snippets",
173+
"retail",
174+
"routeoptimization/snippets",
175+
"run/hello-broken",
176+
"run/helloworld",
177+
"run/image-processing",
178+
"run/jobs",
179+
"run/logging-manual",
180+
"run/markdown-preview/renderer",
181+
"run/pubsub",
182+
"run/websockets",
183+
"secret-manager",
184+
"service-directory/snippets",
185+
"storage-control",
186+
"texttospeech",
187+
"tpu",
188+
"workflows/invoke-private-endpoint"
189+
]
190+
}

.github/config/nodejs-prod.jsonc

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
Copyright 2024 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
{
18+
"package-file": [ "package.json" ],
19+
"ignore": [
20+
".eslintignore",
21+
".eslintrc.json",
22+
".github/.OwlBot.lock.yaml",
23+
".github/.OwlBot.yaml",
24+
".github/ISSUE_TEMPLATE/",
25+
".github/PULL_REQUEST_TEMPLATE.md",
26+
".github/auto-label.yaml",
27+
".github/blunderbuss.yaml",
28+
".github/cloud-samples-tools/",
29+
".github/flakybot.yaml",
30+
".github/header-checker-lint.yaml",
31+
".github/snippet-bot.yml",
32+
".github/trusted-contribution.yml",
33+
".gitignore",
34+
".kokoro/",
35+
".prettierignore",
36+
".prettierrc.js",
37+
"CODEOWNERS",
38+
"CODE_OF_CONDUCT.md",
39+
"CONTRIBUTING.md",
40+
"LICENSE",
41+
"Makefile",
42+
"README.md",
43+
"SECURITY.md",
44+
"buildsetup.sh",
45+
"linkinator.config.json",
46+
"node_modules/",
47+
"owlbot.py",
48+
"renovate.json"
49+
],
50+
"exclude-packages": [
51+
"functions/concepts", // parent directory
52+
"functions/firebase", // parent directory
53+
"functions/helloworld", // parent directory
54+
"functions/http", // parent directory
55+
"functions/http/uploadFile", // parent directory
56+
"functions/log", // parent directory
57+
"functions/pubsub", // parent directory
58+
"memorystore/redis", // parent directory
59+
"recaptcha_enterprise/demosite/app", // no tests exist
60+
61+
// TODO: fix these
62+
"ai-platform/snippets", // PERMISSION_DENIED: Permission denied: Consumer 'projects/undefined' has been suspended.
63+
"appengine/analytics", // [ERR_REQUIRE_ESM]: require() of ES Module
64+
"appengine/metadata/flexible", // [ERR_REQUIRE_ESM]: require() of ES Module
65+
"appengine/metadata/standard", // [ERR_REQUIRE_ESM]: require() of ES Module
66+
"automl", // (untested) FAILED_PRECONDITION: Google Cloud AutoML Natural Language was retired on March 15, 2024. Please migrate to Vertex AI instead
67+
"cloud-sql/mysql/mysql", // (untested) Error: expected 200 "OK", got 500 "Internal Server Error"
68+
"cloud-sql/mysql/mysql2", // (untested) Error: Cannot find module './connect-connector-with-iam-authn.js'
69+
"cloud-sql/postgres/knex", // (untested) CloudSQLConnectorError: Malformed instance connection name provided: expected format of "PROJECT:REGION:INSTANCE", got undefined
70+
"cloud-sql/sqlserver/mssql", // (untested) TypeError: The "config.server" property is required and must be of type string.
71+
"cloud-sql/sqlserver/tedious", // (untested) TypeError: The "config.server" property is required and must be of type string.
72+
"compute", // GoogleError: The resource 'projects/long-door-651/zones/us-central1-a/disks/disk-from-pool-name' was not found
73+
"dataproc", // GoogleError: Error submitting create cluster request: Multiple validation errors
74+
"datastore/functions", // [ERR_REQUIRE_ESM]: require() of ES Module
75+
"dialogflow-cx", // NOT_FOUND: com.google.apps.framework.request.NotFoundException: Agent 'undefined' does not exist
76+
"dlp", // [ERR_REQUIRE_ESM]: require() of ES Module
77+
"document-ai", // [ERR_REQUIRE_ESM]: require() of ES Module
78+
"eventarc/audit-storage", // (untested) Environment Variable 'SERVICE_NAME' not found
79+
"eventarc/pubsub", // (untested) Environment Variable 'SERVICE_NAME' not found
80+
"functions/billing", // Error: Request failed with status code 500
81+
"functions/imagemagick", // Error: A bucket name is needed to use Cloud Storage
82+
"functions/ocr/app", // Error: Bucket not provided. Make sure you have a "bucket" property in your request
83+
"functions/slack", // TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type ... Received undefined
84+
"functions/v2/imagemagick", // Error: A bucket name is needed to use Cloud Storage.
85+
"generative-ai/snippets", // [VertexAI.ClientError]: got status: 403 Forbidden.
86+
"healthcare/fhir", // Error: Cannot find module 'whatwg-url'
87+
"iam/deny", // PERMISSION_DENIED: Permission iam.googleapis.com/denypolicies.create denied on resource cloudresourcemanager.googleapis.com/projects/long-door-651
88+
"recaptcha_enterprise/snippets", // Cannot use import statement outside a module
89+
"run/idp-sql", // Error: Invalid contents in the credentials file
90+
"run/markdown-preview/editor", // Error: could not create an identity token: Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file
91+
"run/system-package", // Error: ENOENT: no such file or directory, access '/usr/bin/dot'
92+
"scheduler", // SyntaxError: Cannot use import statement outside a module
93+
"security-center/snippets", // Error: 3 INVALID_ARGUMENT: Fail to resolve resource 'organizations/undefined/locations/global'
94+
"speech", // AssertionError: expected 'Transcription: Okay, I\'m here.\n Hi…' to match /Terrific. It's on the way./
95+
"storagetransfer", // CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
96+
"talent", // AssertionError: expected '' to match /Job summary/
97+
"translate", // AssertionError: expected 'Languages:\n{ code: \'ab\', name: \'A…' to match /{ code: 'af', name: 'afrikáans' }/
98+
"video-intelligence", // PERMISSION_DENIED: The caller does not have permission
99+
"vision", // REDIS: Error: connect ECONNREFUSED 127.0.0.1:6379
100+
"workflows", // SyntaxError: Cannot use import statement outside a module
101+
"workflows/quickstart" // [ERR_MODULE_NOT_FOUND]: Cannot find package 'ts-node' imported from ...
102+
]
103+
}

.github/config/nodejs.jsonc

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)