|
11 | 11 | from snuba.consumers.types import KafkaMessageMetadata
|
12 | 12 | from snuba.datasets.storages.factory import get_writable_storage
|
13 | 13 | from snuba.datasets.storages.storage_key import StorageKey
|
14 |
| -from snuba.migrations.groups import MigrationGroup, get_group_loader |
| 14 | +from snuba.migrations.groups import MigrationGroup |
15 | 15 | from snuba.migrations.runner import MigrationKey, Runner
|
16 | 16 | from snuba.migrations.status import Status
|
17 | 17 | from snuba.processor import InsertBatch
|
@@ -146,59 +146,6 @@ def generate_transactions() -> None:
|
146 | 146 | ).write(rows)
|
147 | 147 |
|
148 | 148 |
|
149 |
| -@pytest.mark.clickhouse_db |
150 |
| -def test_groupedmessages_compatibility() -> None: |
151 |
| - cluster = get_cluster(StorageSetKey.EVENTS) |
152 |
| - |
153 |
| - # Ignore the multi node mode because this tests a migration |
154 |
| - # for an older table state that only applied to single node |
155 |
| - if not cluster.is_single_node(): |
156 |
| - return |
157 |
| - |
158 |
| - database = cluster.get_database() |
159 |
| - connection = cluster.get_query_connection(ClickhouseClientSettings.MIGRATE) |
160 |
| - |
161 |
| - # Create old style table witihout project ID |
162 |
| - connection.execute( |
163 |
| - """ |
164 |
| - CREATE TABLE groupedmessage_local (`offset` UInt64, `record_deleted` UInt8, |
165 |
| - `id` UInt64, `status` Nullable(UInt8), `last_seen` Nullable(DateTime), |
166 |
| - `first_seen` Nullable(DateTime), `active_at` Nullable(DateTime), |
167 |
| - `first_release_id` Nullable(UInt64)) ENGINE = ReplacingMergeTree(offset) |
168 |
| - ORDER BY id SAMPLE BY id SETTINGS index_granularity = 8192 |
169 |
| - """ |
170 |
| - ) |
171 |
| - |
172 |
| - migration_id = "0010_groupedmessages_onpremise_compatibility" |
173 |
| - |
174 |
| - runner = Runner() |
175 |
| - runner.run_migration( |
176 |
| - MigrationKey(MigrationGroup.SYSTEM, "0001_migrations"), force=True |
177 |
| - ) |
178 |
| - events_migrations = get_group_loader(MigrationGroup.EVENTS).get_migrations() |
179 |
| - |
180 |
| - # Mark prior migrations complete |
181 |
| - for migration in events_migrations[: (events_migrations.index(migration_id))]: |
182 |
| - runner._update_migration_status( |
183 |
| - MigrationKey(MigrationGroup.EVENTS, migration), Status.COMPLETED |
184 |
| - ) |
185 |
| - |
186 |
| - runner.run_migration( |
187 |
| - MigrationKey(MigrationGroup.EVENTS, migration_id), |
188 |
| - force=True, |
189 |
| - ) |
190 |
| - |
191 |
| - outcome = perform_select_query( |
192 |
| - ["primary_key"], |
193 |
| - "system.tables", |
194 |
| - {"name": "groupedmessage_local", "database": str(database)}, |
195 |
| - None, |
196 |
| - connection, |
197 |
| - ) |
198 |
| - |
199 |
| - assert outcome == [("project_id, id",)] |
200 |
| - |
201 |
| - |
202 | 149 | @pytest.mark.clickhouse_db
|
203 | 150 | def run_prior_migrations(
|
204 | 151 | migration_group: MigrationGroup, stop_migration_id: str, runner: Runner
|
|
0 commit comments