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

Function test_disk_label

test/cloudtest/test_compute.py:128–142  ·  view source on GitHub ↗

Test that cluster replicas have the correct materialize.cloud/disk labels

(mz: MaterializeApplication)

Source from the content-addressed store, hash-verified

126
127
128def test_disk_label(mz: MaterializeApplication) -> None:
129 """Test that cluster replicas have the correct materialize.cloud/disk labels"""
130
131 mz.environmentd.sql("CREATE CLUSTER disk SIZE = 'scale=1,workers=2'")
132
133 cluster_id, replica_id = mz.environmentd.sql_query(
134 "SELECT mz_clusters.id, mz_cluster_replicas.id FROM mz_cluster_replicas JOIN mz_clusters ON mz_cluster_replicas.cluster_id = mz_clusters.id WHERE mz_clusters.name = 'disk'"
135 )[0]
136 assert cluster_id is not None
137 assert replica_id is not None
138
139 node_selectors = get_node_selector(mz, cluster_id, replica_id)
140 assert node_selectors == '\'{"materialize.cloud/disk":"true"}\'', node_selectors
141
142 mz.environmentd.sql("DROP CLUSTER disk CASCADE")
143
144
145@pytest.mark.skip(

Callers

nothing calls this directly

Calls 3

get_node_selectorFunction · 0.85
sqlMethod · 0.45
sql_queryMethod · 0.45

Tested by

no test coverage detected