Skip to content

Commit f3062db

Browse files
committed
test, materialized: Refactor test listener configs
Almost all of these changes are simple one line refactors / moving files around. All but the changes in `materialized.py` where we need to version gate the listener config. This is important such that our upgrade tests don't break. - For Password/SASL/OIDC listener configs, set internal from NormalAndInternal to Internal to maintain consistency - Move v0_145_0 configs to its own folder, as well as v26_31_0 - Update materialized to copy a version's folder
1 parent f1945f9 commit f3062db

27 files changed

Lines changed: 848 additions & 70 deletions

misc/python/materialize/checks/mzcompose_actions.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,11 @@ def execute(self, e: Executor) -> None:
8787
print(f"Starting Mz using image {image}, mz_service {self.mz_service}")
8888

8989
listeners_config_path = (
90-
f"{MZ_ROOT}/src/materialized/ci/listener_configs/testdrive.json"
90+
f"{MZ_ROOT}/src/materialized/ci/listener_configs/v26_31_0/testdrive.json"
9191
)
9292

9393
if not self.tag or self.tag >= MzVersion.parse_mz("v0.158.0-dev"):
94-
listeners_config_path = (
95-
f"{MZ_ROOT}/src/materialized/ci/listener_configs/testdrive_sasl.json"
96-
)
94+
listeners_config_path = f"{MZ_ROOT}/src/materialized/ci/listener_configs/v26_31_0/testdrive_sasl.json"
9795

9896
mz = Materialized(
9997
name=self.mz_service,

misc/python/materialize/cli/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def main() -> int:
202202
parser.add_argument(
203203
"--listeners-config-path",
204204
help="Path to json file with environmentd listeners configuration.",
205-
default=f"{MZ_ROOT}/src/materialized/ci/listener_configs/no_auth.json",
205+
default=f"{MZ_ROOT}/src/materialized/ci/listener_configs/v26_31_0/no_auth.json",
206206
)
207207
args = parser.parse_intermixed_args()
208208

misc/python/materialize/cloudtest/k8s/environmentd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ def __init__(self, namespace: str = DEFAULT_K8S_NAMESPACE) -> None:
6969
class ListenersConfigMap(K8sConfigMap):
7070
def __init__(self, namespace: str = DEFAULT_K8S_NAMESPACE) -> None:
7171
super().__init__(namespace)
72-
with open(f"{MZ_ROOT}/src/materialized/ci/listener_configs/no_auth.json") as f:
72+
with open(
73+
f"{MZ_ROOT}/src/materialized/ci/listener_configs/v26_31_0/no_auth.json"
74+
) as f:
7375
data = f.read()
7476
self.configmap = V1ConfigMap(
7577
metadata=V1ObjectMeta(name="listeners-config"),

misc/python/materialize/mzcompose/services/materialized.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def __init__(
102102
default_replication_factor: int = 1,
103103
builtin_system_cluster_replication_factor: int | None = None,
104104
builtin_probe_cluster_replication_factor: int | None = None,
105-
listeners_config_path: str = f"{MZ_ROOT}/src/materialized/ci/listener_configs/testdrive.json",
105+
listeners_config_path: str = f"{MZ_ROOT}/src/materialized/ci/listener_configs/v26_31_0/testdrive.json",
106106
config_sync_file_path: str | None = None,
107107
support_external_clusterd: bool = False,
108108
networks: (
@@ -341,8 +341,14 @@ def __init__(
341341
config["platform"] = platform
342342

343343
if image_version is None or image_version >= "v0.147.0-dev":
344-
assert os.path.exists(listeners_config_path)
345-
volumes.append(f"{listeners_config_path}:/listeners_config")
344+
config_path = listeners_config_path
345+
# Older environmentd requires a listeners config but only
346+
# parses the legacy bool-route schema, so swap to the matching file
347+
# under `listener_configs/v0_145_0/` for those versions.
348+
if image_version is not None and image_version < "v26.31.0-dev":
349+
config_path = "/listener_configs/v0_145_0/testdrive.json"
350+
assert os.path.exists(config_path)
351+
volumes.append(f"{config_path}:/listeners_config")
346352
environment.append("MZ_LISTENERS_CONFIG_PATH=/listeners_config")
347353

348354
if config_sync_file_path is not None:

misc/python/materialize/scalability/endpoint/endpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def up_internal(self) -> None:
185185
image=self.image,
186186
sanity_restart=False,
187187
additional_system_parameter_defaults=ADDITIONAL_BENCHMARKING_SYSTEM_PARAMETERS,
188-
listeners_config_path=f"{MZ_ROOT}/src/materialized/ci/listener_configs/testdrive_sasl.json",
188+
listeners_config_path=f"{MZ_ROOT}/src/materialized/ci/listener_configs/v26_31_0/testdrive_sasl.json",
189189
)
190190
):
191191
self.composition.up("materialized")

src/materialized/ci/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
MZFROM materialized-base
1111

12-
COPY listener_configs/ /listener_configs/
12+
# The binary in this image is always current, so it ships only the current
13+
# listener config schema, flattened to /listener_configs/.
14+
COPY listener_configs/v26_31_0/ /listener_configs/
1315

1416
USER materialize
1517

src/materialized/ci/listener_configs/frontegg_https.json renamed to src/materialized/ci/listener_configs/v0_145_0/frontegg_https.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"internal": false,
2626
"metrics": false,
2727
"profiling": false,
28+
"mcp_agent": false,
29+
"mcp_developer": false,
2830
"console_config": true
2931
}
3032
},
@@ -39,6 +41,8 @@
3941
"internal": true,
4042
"metrics": true,
4143
"profiling": true,
44+
"mcp_agent": false,
45+
"mcp_developer": false,
4246
"console_config": false
4347
}
4448
}

src/materialized/ci/listener_configs/no_auth.json renamed to src/materialized/ci/listener_configs/v0_145_0/no_auth.json

File renamed without changes.

src/materialized/ci/listener_configs/no_auth_https.json renamed to src/materialized/ci/listener_configs/v0_145_0/no_auth_https.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"internal": false,
2626
"metrics": false,
2727
"profiling": false,
28+
"mcp_agent": false,
29+
"mcp_developer": false,
2830
"console_config": true
2931
}
3032
},
@@ -39,6 +41,8 @@
3941
"internal": true,
4042
"metrics": true,
4143
"profiling": true,
44+
"mcp_agent": false,
45+
"mcp_developer": false,
4246
"console_config": false
4347
}
4448
}

src/materialized/ci/listener_configs/oidc.json renamed to src/materialized/ci/listener_configs/v0_145_0/oidc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"internal": true,
2020
"metrics": false,
2121
"profiling": true,
22+
"mcp_agent": false,
23+
"mcp_developer": false,
2224
"console_config": true
2325
}
2426
},
@@ -33,6 +35,8 @@
3335
"internal": false,
3436
"metrics": true,
3537
"profiling": false,
38+
"mcp_agent": false,
39+
"mcp_developer": false,
3640
"console_config": false
3741
}
3842
}

0 commit comments

Comments
 (0)