Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move dashboard metadata to fixture
Browse files Browse the repository at this point in the history
JCZuurmond committed Oct 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent efdf731 commit d6d4f12
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/integration/queries/test_migration_progress.py
Original file line number Diff line number Diff line change
@@ -51,20 +51,26 @@ def schema_populated(ws: WorkspaceClient, sql_backend, make_catalog, make_schema
return schema


@pytest.fixture()
def dashboard_metadata(schema_populated: SchemaInfo) -> DashboardMetadata:
migration_progress_dashboard_path = find_project_root(__file__) / "src/databricks/labs/ucx/queries/progress"
dashboard_metadata = DashboardMetadata.from_path(migration_progress_dashboard_path).replace_database(
database=schema_populated.full_name, database_to_replace="inventory"
)
return dashboard_metadata


def test_migration_progress_dashboard(
ws: WorkspaceClient,
is_in_debug,
env_or_skip,
make_directory,
dashboard_metadata,
schema_populated: SchemaInfo,
) -> None:
"""Check the dashboard visually."""
warehouse_id = env_or_skip("TEST_DEFAULT_WAREHOUSE_ID")
directory = make_directory()
migration_progress_dashboard_path = find_project_root(__file__) / "src/databricks/labs/ucx/queries/progress"
dashboard_metadata = DashboardMetadata.from_path(migration_progress_dashboard_path).replace_database(
database=schema_populated.full_name, database_to_replace="inventory"
)
dashboard = Dashboards(ws).create_dashboard(
dashboard_metadata,
parent_path=str(directory),

0 comments on commit d6d4f12

Please sign in to comment.