MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / workflow_default

Function workflow_default

test/cloud-canary/mzcompose.py:223–310  ·  view source on GitHub ↗

Deploy the current source to the cloud and run tests.

(c: Composition, parser: WorkflowArgumentParser)

Source from the content-addressed store, hash-verified

221
222
223def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
224 """Deploy the current source to the cloud and run tests."""
225
226 parser.add_argument(
227 "--cleanup",
228 default=True,
229 action=argparse.BooleanOptionalAction,
230 help="Destroy the region at the end of the workflow.",
231 )
232 parser.add_argument(
233 "--version-check",
234 default=True,
235 action=argparse.BooleanOptionalAction,
236 help="Perform a version check.",
237 )
238
239 parser.add_argument(
240 "td_files",
241 nargs="*",
242 default=["*.td"],
243 help="run against the specified files",
244 )
245
246 args = parser.parse_args()
247
248 if not os.getenv("BUILDKITE_COMMIT"):
249 raise UIError(
250 "BUILDKITE_COMMIT must be set (and valid) when running cloud-canary"
251 )
252
253 files = list(
254 itertools.chain.from_iterable(
255 [
256 glob.glob(file_glob, root_dir=MZ_ROOT / "test" / "cloud-canary")
257 for file_glob in args.td_files
258 ]
259 )
260 )
261
262 if args.cleanup:
263 disable_region(c)
264
265 try:
266 test_failed = True
267 print(f"Enabling region using Mz version {VERSION} ...")
268 try:
269 c.run("mz", "region", "enable", "--version", VERSION)
270 except UIError:
271 # Work around https://github.com/MaterializeInc/database-issues/issues/4989
272 pass
273
274 time.sleep(10)
275
276 assert "materialize.cloud" in c.cloud_hostname()
277 wait_for_cloud(c)
278
279 if args.version_check:
280 version_check(c)

Callers

nothing calls this directly

Calls 11

UIErrorClass · 0.90
version_checkFunction · 0.85
tdFunction · 0.85
cloud_hostnameMethod · 0.80
test_partsMethod · 0.80
disable_regionFunction · 0.70
wait_for_cloudFunction · 0.70
listFunction · 0.50
runMethod · 0.45
sleepMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected