|
1 | 1 | import dataclasses |
2 | 2 | import json |
3 | 3 | import logging |
4 | | -from dataclasses import replace |
5 | 4 | from datetime import timedelta |
6 | 5 |
|
7 | 6 | import pytest # pylint: disable=wrong-import-order |
8 | 7 | from databricks.labs.ucx.__about__ import __version__ |
9 | 8 |
|
10 | 9 | from databricks.labs.blueprint.installation import Installation |
11 | | -from databricks.labs.blueprint.installer import RawState |
12 | 10 | from databricks.labs.blueprint.parallel import ManyError |
13 | 11 | from databricks.labs.blueprint.tui import MockPrompts |
14 | 12 | from databricks.labs.blueprint.wheels import ProductInfo |
@@ -356,74 +354,6 @@ def test_check_inventory_database_exists(ws, installation_ctx): |
356 | 354 | installation_ctx.workspace_installer.configure() |
357 | 355 |
|
358 | 356 |
|
359 | | -@retried(on=[NotFound], timeout=timedelta(minutes=5)) |
360 | | -@pytest.mark.parametrize('prepare_tables_for_migration', [('regular')], indirect=True) |
361 | | -def test_table_migration_job(ws, installation_ctx, env_or_skip, prepare_tables_for_migration): |
362 | | - |
363 | | - ctx = installation_ctx.replace( |
364 | | - config_transform=lambda wc: replace(wc, override_clusters=None), |
365 | | - extend_prompts={ |
366 | | - r"Parallelism for migrating.*": "1000", |
367 | | - r"Min workers for auto-scale.*": "2", |
368 | | - r"Max workers for auto-scale.*": "20", |
369 | | - r"Instance pool id to be set.*": env_or_skip("TEST_INSTANCE_POOL_ID"), |
370 | | - r".*Do you want to update the existing installation?.*": 'yes', |
371 | | - }, |
372 | | - ) |
373 | | - tables, dst_schema = prepare_tables_for_migration |
374 | | - |
375 | | - ctx.workspace_installation.run() |
376 | | - ctx.deployed_workflows.run_workflow("migrate-tables") |
377 | | - # assert the workflow is successful |
378 | | - assert ctx.deployed_workflows.validate_step("migrate-tables") |
379 | | - # assert the tables are migrated |
380 | | - for table in tables.values(): |
381 | | - try: |
382 | | - assert ws.tables.get(f"{dst_schema.catalog_name}.{dst_schema.name}.{table.name}").name |
383 | | - except NotFound: |
384 | | - assert False, f"{table.name} not found in {dst_schema.catalog_name}.{dst_schema.name}" |
385 | | - # assert the cluster is configured correctly |
386 | | - for job_cluster in ws.jobs.get( |
387 | | - ctx.installation.load(RawState).resources["jobs"]["migrate-tables"] |
388 | | - ).settings.job_clusters: |
389 | | - if job_cluster.job_cluster_key != "table_migration": |
390 | | - # don't assert on the cluster for parse logs task |
391 | | - continue |
392 | | - assert job_cluster.new_cluster.autoscale.min_workers == 2 |
393 | | - assert job_cluster.new_cluster.autoscale.max_workers == 20 |
394 | | - assert job_cluster.new_cluster.spark_conf["spark.sql.sources.parallelPartitionDiscovery.parallelism"] == "1000" |
395 | | - |
396 | | - |
397 | | -@retried(on=[NotFound], timeout=timedelta(minutes=8)) |
398 | | -@pytest.mark.parametrize('prepare_tables_for_migration', [('regular')], indirect=True) |
399 | | -def test_table_migration_job_cluster_override(ws, installation_ctx, prepare_tables_for_migration, env_or_skip): |
400 | | - |
401 | | - tables, dst_schema = prepare_tables_for_migration |
402 | | - ctx = installation_ctx.replace( |
403 | | - extend_prompts={ |
404 | | - r".*Do you want to update the existing installation?.*": 'yes', |
405 | | - }, |
406 | | - ) |
407 | | - ctx.workspace_installation.run() |
408 | | - ctx.deployed_workflows.run_workflow("migrate-tables") |
409 | | - # assert the workflow is successful |
410 | | - assert ctx.deployed_workflows.validate_step("migrate-tables") |
411 | | - # assert the tables are migrated |
412 | | - for table in tables.values(): |
413 | | - try: |
414 | | - assert ws.tables.get(f"{dst_schema.catalog_name}.{dst_schema.name}.{table.name}").name |
415 | | - except NotFound: |
416 | | - assert False, f"{table.name} not found in {dst_schema.catalog_name}.{dst_schema.name}" |
417 | | - # assert the cluster is configured correctly on the migrate tables tasks |
418 | | - install_state = ctx.installation.load(RawState) |
419 | | - job_id = install_state.resources["jobs"]["migrate-tables"] |
420 | | - assert all( |
421 | | - task.existing_cluster_id == env_or_skip("TEST_USER_ISOLATION_CLUSTER_ID") |
422 | | - for task in ws.jobs.get(job_id).settings.tasks |
423 | | - if task.task_key != "parse_logs" |
424 | | - ) |
425 | | - |
426 | | - |
427 | 357 | def test_compare_remote_local_install_versions(ws, installation_ctx): |
428 | 358 | installation_ctx.workspace_installation.run() |
429 | 359 | with pytest.raises( |
|
0 commit comments