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

Function workflow_start_version

test/console/mzcompose.py:148–212  ·  view source on GitHub ↗

Start Materialize services with a specific version from the version matrix. This workflow is designed to be called by the console repo to start services before running console SQL tests. The console repo should call this, then run its own yarn test:sql, then call ./mzcompose down.

(c: Composition, parser: WorkflowArgumentParser)

Source from the content-addressed store, hash-verified

146
147
148def workflow_start_version(c: Composition, parser: WorkflowArgumentParser) -> None:
149 """
150 Start Materialize services with a specific version from the version matrix.
151
152 This workflow is designed to be called by the console repo to start services
153 before running console SQL tests. The console repo should call this, then run
154 its own yarn test:sql, then call ./mzcompose down.
155
156 Usage:
157 ./mzcompose run start-version latest
158 ./mzcompose run start-version self-managed
159 ./mzcompose run start-version # defaults to latest
160
161 Arguments:
162 version_alias: One of: latest, previous, older, self-managed
163 Or a direct version like: v26.1.1
164 """
165 from materialize.console_version_matrix import get_console_test_versions
166
167 parser.add_argument(
168 "version_alias",
169 nargs="?",
170 default="latest",
171 help="Version alias (latest, previous, older, self-managed) or direct version (v26.1.1)",
172 )
173 args = parser.parse_args()
174 version_alias = args.version_alias
175
176 # Check if it's a direct version string (starts with 'v')
177 if version_alias.startswith("v"):
178 version_str = version_alias
179 print(f"Using direct version: {version_str}")
180 else:
181 # Resolve from version matrix
182 versions = get_console_test_versions()
183
184 if version_alias not in versions:
185 print(f"❌ Unknown version alias: {version_alias}")
186 print(f"Available aliases: {', '.join(versions.keys())}")
187 print("Or provide a direct version like: v26.1.1")
188 sys.exit(1)
189
190 version = versions[version_alias]
191 version_str = str(version) if version else None
192 print(f"Starting services for version: {version_alias}")
193
194 print(f"Docker image: materialize/materialized:{version_str}")
195 mz_service = Materialized(
196 image=f"materialize/materialized:{version_str}" if version_str else None,
197 system_parameter_defaults={"enable_rbac_checks": "false"},
198 )
199
200 with c.override(mz_service):
201 c.up(
202 "redpanda",
203 "postgres",
204 "sql-server",
205 "mysql",

Callers

nothing calls this directly

Calls 7

MaterializedClass · 0.90
ServiceClass · 0.90
overrideMethod · 0.80
joinMethod · 0.45
keysMethod · 0.45
upMethod · 0.45

Tested by

no test coverage detected