(c: Composition)
| 337 | |
| 338 | |
| 339 | def 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 | |
| 366 | def td( |
no test coverage detected