diff --git a/tests/integration/hive_metastore/test_workflows.py b/tests/integration/hive_metastore/test_workflows.py index 556e281145..c6f425697d 100644 --- a/tests/integration/hive_metastore/test_workflows.py +++ b/tests/integration/hive_metastore/test_workflows.py @@ -27,6 +27,7 @@ def test_table_migration_job_refreshes_migration_status(ws, installation_ctx, pr ctx.workspace_installation.run() ctx.deployed_workflows.run_workflow(workflow) + asserts = [] for table in tables.values(): # Avoiding MigrationStatusRefresh as it will refresh the status before fetching query_migration_status = ( @@ -34,7 +35,15 @@ def test_table_migration_job_refreshes_migration_status(ws, installation_ctx, pr f"WHERE src_schema = '{table.schema_name}' AND src_table = '{table.name}'" ) migration_status = list(ctx.sql_backend.fetch(query_migration_status)) + assert_message_postfix = f" found for {table.table_type} {table.full_name}" - assert len(migration_status) == 1, "No migration status" + assert_message_postfix - assert migration_status[0].dst_schema is not None, "No destination schema" + assert_message_postfix - assert migration_status[0].dst_table is not None, "No destination table" + assert_message_postfix + if len(migration_status) == 0: + asserts.append("No migration status" + assert_message_postfix) + elif len(migration_status) > 1: + asserts.append("Multiple migration statuses" + assert_message_postfix) + elif migration_status[0].dst_schema is None: + asserts.append("No destination schema" + assert_message_postfix) + elif migration_status[0].dst_table is None: + asserts.append("No destination table" + assert_message_postfix) + + assert len(asserts) == 0, "\n".join(asserts)