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

Function version_check

test/cloud-canary/mzcompose.py:339–363  ·  view source on GitHub ↗
(c: Composition)

Source from the content-addressed store, hash-verified

337
338
339def version_check(c: Composition) -> None:
340 print("Obtaining mz_version() string from local instance ...")
341 c.up("materialized")
342 # Remove the ($HASH) suffix because it can be different. The reason is that
343 # the dockerhub devel-$HASH tag is just a link to the mzbuild-$CODEHASH. So
344 # if the code has not changed, the environmentd image of the previous
345 # version will be used.
346 local_version = c.sql_query("SELECT mz_version();")[0][0].split(" ")[0]
347
348 print("Obtaining mz_version() string from the cloud ...")
349 cloud_cursor = psycopg.connect(
350 host=c.cloud_hostname(),
351 user=USERNAME,
352 password=APP_PASSWORD,
353 dbname="materialize",
354 port=6875,
355 sslmode="require",
356 ).cursor()
357 cloud_cursor.execute("SELECT mz_version()")
358 result = cloud_cursor.fetchone()
359 assert result is not None
360 cloud_version = result[0].split(" ")[0]
361 assert (
362 local_version == cloud_version
363 ), f"local version: {local_version} is not identical to cloud version: {cloud_version}"
364
365
366def td(

Callers 1

workflow_defaultFunction · 0.85

Calls 7

cursorMethod · 0.80
cloud_hostnameMethod · 0.80
upMethod · 0.45
splitMethod · 0.45
sql_queryMethod · 0.45
connectMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected