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

Function td

test/cloud-canary/mzcompose.py:366–434  ·  view source on GitHub ↗
(
    c: Composition,
    filename: str | None = None,
    text: str | None = None,
    redpanda: Redpanda | None = None,
)

Source from the content-addressed store, hash-verified

364
365
366def td(
367 c: Composition,
368 filename: str | None = None,
369 text: str | None = None,
370 redpanda: Redpanda | None = None,
371) -> None:
372 assert APP_PASSWORD is not None
373 materialize_url = f"postgres://{urllib.parse.quote(USERNAME)}:{urllib.parse.quote(APP_PASSWORD)}@{urllib.parse.quote(c.cloud_hostname())}:6875"
374
375 assert bool(filename) != bool(text)
376
377 testdrive = Testdrive(
378 default_timeout="1200s",
379 materialize_url=materialize_url,
380 no_reset=True, # Required so that admin port 6877 is not used
381 seed=1, # Required for predictable Kafka topic names
382 kafka_url=KAFKA_BOOTSTRAP_SERVER,
383 schema_registry_url=SCHEMA_REGISTRY_ENDPOINT,
384 no_consistency_checks=True,
385 environment=[
386 "KAFKA_OPTION="
387 + ",".join(
388 [
389 "security.protocol=SASL_SSL",
390 "sasl.mechanisms=PLAIN",
391 f"sasl.username={CONFLUENT_API_KEY}",
392 f"sasl.password={CONFLUENT_API_SECRET}",
393 ]
394 ),
395 ],
396 entrypoint_extra=[
397 f"--var=confluent-api-key={CONFLUENT_API_KEY}",
398 f"--var=confluent-api-secret={CONFLUENT_API_SECRET}",
399 ],
400 )
401
402 if redpanda and "redpanda" in str(filename):
403 testdrive = Testdrive(
404 default_timeout="1200s",
405 materialize_url=materialize_url,
406 no_reset=True, # Required so that admin port 6877 is not used
407 seed=1, # Required for predictable Kafka topic names
408 kafka_url=redpanda.cluster_info["kafka_api"]["seed_brokers"][0],
409 schema_registry_url=redpanda.cluster_info["schema_registry"]["url"],
410 no_consistency_checks=True,
411 environment=[
412 "KAFKA_OPTION="
413 + ",".join(
414 [
415 "security.protocol=SASL_SSL",
416 "sasl.mechanisms=SCRAM-SHA-512",
417 f"sasl.username={REDPANDA_USER}",
418 f"sasl.password={redpanda.password}",
419 ]
420 ),
421 ],
422 entrypoint_extra=[
423 f"--var=redpanda-username={REDPANDA_USER}",

Callers 2

workflow_defaultFunction · 0.85
processFunction · 0.85

Calls 6

TestdriveClass · 0.90
cloud_hostnameMethod · 0.80
overrideMethod · 0.80
run_testdrive_filesMethod · 0.80
joinMethod · 0.45
testdriveMethod · 0.45

Tested by

no test coverage detected