Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion misc/python/materialize/zippy/mz_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# by the Apache License, Version 2.0.


import os

from materialize.mzcompose.composition import Composition
from materialize.mzcompose.services.materialized import (
LEADER_STATUS_HEALTHCHECK,
Expand Down Expand Up @@ -70,7 +72,21 @@ def __init__(
capabilities: Capabilities,
additional_system_parameter_defaults: dict[str, str] = {},
) -> None:
self.additional_system_parameter_defaults = additional_system_parameter_defaults
if additional_system_parameter_defaults:
self.additional_system_parameter_defaults = (
additional_system_parameter_defaults
)
else:
self.additional_system_parameter_defaults = {}
system_parameter_default = os.getenv("CI_MZ_SYSTEM_PARAMETER_DEFAULT", "")
if system_parameter_default:
for val in system_parameter_default.split(";"):
x = val.split("=", maxsplit=1)
assert (
len(x) == 2
), f"CI_MZ_SYSTEM_PARAMETER_DEFAULT '{val}' should be the format <key>=<val>"
self.additional_system_parameter_defaults[x[0]] = x[1]

super().__init__(capabilities)

def run(self, c: Composition, state: State) -> None:
Expand Down
21 changes: 9 additions & 12 deletions test/zippy/mzcompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
expected state it can verify results for correctness.
"""

import os
import random
import re
import time
Expand Down Expand Up @@ -177,14 +178,6 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
help="Start Prometheus and Grafana",
)

parser.add_argument(
"--system-param",
type=str,
action="append",
nargs="*",
help="System parameters to set in Materialize, i.e. what you would set with `ALTER SYSTEM SET`",
)

parser.add_argument(
"--azurite", action="store_true", help="Use Azurite as blob store instead of S3"
)
Expand Down Expand Up @@ -215,10 +208,14 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
random.seed(args.seed)

additional_system_parameter_defaults = {}
for val in args.system_param or []:
x = val[0].split("=", maxsplit=1)
assert len(x) == 2, f"--system-param '{val}' should be the format <key>=<val>"
additional_system_parameter_defaults[x[0]] = x[1]
system_parameter_default = os.getenv("CI_MZ_SYSTEM_PARAMETER_DEFAULT", "")
if system_parameter_default:
for val in system_parameter_default.split(";"):
x = val.split("=", maxsplit=1)
assert (
len(x) == 2
), f"CI_MZ_SYSTEM_PARAMETER_DEFAULT '{val}' should be the format <key>=<val>"
additional_system_parameter_defaults[x[0]] = x[1]

with c.override(
Cockroach(
Expand Down