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

Function header

test/sql-feature-flags/mzcompose.py:41–60  ·  view source on GitHub ↗

Generate a TD header for a SQL feature test scenario.

(test_name: str, drop_schema: bool)

Source from the content-addressed store, hash-verified

39
40
41def header(test_name: str, drop_schema: bool) -> str:
42 """Generate a TD header for a SQL feature test scenario."""
43 header = dedent(f"""
44 # Feature test for SQL feature test: {test_name}
45 #####################################{'#' * len(test_name)}
46 """)
47 # Re-create schema (optional).
48 if drop_schema:
49 header += dedent(f"""
50 $ postgres-execute connection=postgres://mz_system@materialized:6877/materialize
51 DROP SCHEMA IF EXISTS public CASCADE;
52 CREATE SCHEMA public /* {test_name} */;
53 GRANT ALL PRIVILEGES ON SCHEMA public TO materialize;
54 """)
55 # Create connections.
56 header += dedent(f"""
57 $ postgres-connect name=user url={USER_CONNECTION_URL}
58 $ postgres-connect name=mz_system url={MZ_SYSTEM_CONNECTION_URL}
59 """)
60 return header.strip()
61
62
63def statement_error(statement: str, error_msg: str) -> str:

Callers 4

phase1Method · 0.70
phase2Method · 0.70
phase3Method · 0.70
run_testFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected