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

Function workflow_migration

test/pg-cdc-old-syntax/mzcompose.py:422–490  ·  view source on GitHub ↗
(c: Composition, parser: WorkflowArgumentParser)

Source from the content-addressed store, hash-verified

420
421
422def workflow_migration(c: Composition, parser: WorkflowArgumentParser) -> None:
423 parser.add_argument(
424 "filter",
425 nargs="*",
426 default=["*.td"],
427 help="limit to only the files matching filter",
428 )
429 args = parser.parse_args()
430
431 sharded_files = get_sharded_files(args.filter)
432 print(f"Files: {sharded_files}")
433
434 ssl_args_dict = get_testdrive_ssl_args(c)
435 testdrive_ssl_args = ssl_args_dict["testdrive_args"]
436 volumes_extra = ssl_args_dict["volumes_extra"]
437
438 testdrive_args = (
439 testdrive_ssl_args + get_default_testdrive_size_args() + ["--no-reset"]
440 )
441
442 pg_version = get_targeted_pg_version(parser)
443
444 for file in sharded_files:
445 mz_old = Materialized(
446 name="materialized",
447 volumes_extra=volumes_extra,
448 external_metadata_store=True,
449 external_blob_store=True,
450 additional_system_parameter_defaults={
451 "log_filter": "mz_storage::source::postgres=trace,info"
452 },
453 default_replication_factor=2,
454 )
455
456 mz_new = Materialized(
457 name="materialized",
458 volumes_extra=volumes_extra,
459 external_metadata_store=True,
460 external_blob_store=True,
461 additional_system_parameter_defaults={
462 "log_filter": "mz_storage::source::postgres=trace,info",
463 "force_source_table_syntax": "true",
464 },
465 default_replication_factor=2,
466 )
467 with c.override(mz_old, create_postgres(pg_version=pg_version)):
468 c.up("materialized", "test-certs", "postgres")
469
470 print(f"Running {file} with mz_old")
471
472 c.run_testdrive_files(
473 *testdrive_args,
474 file,
475 )
476 c.kill("materialized", wait=True)
477
478 with c.override(mz_new):
479 c.up("materialized")

Callers

nothing calls this directly

Calls 13

MaterializedClass · 0.90
get_sharded_filesFunction · 0.85
get_testdrive_ssl_argsFunction · 0.85
overrideMethod · 0.80
run_testdrive_filesMethod · 0.80
killMethod · 0.80
rmMethod · 0.80
rm_volumesMethod · 0.80
get_targeted_pg_versionFunction · 0.70
create_postgresFunction · 0.70

Tested by

no test coverage detected