Skip to content

Commit

Permalink
Assert row in integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Dec 16, 2024
1 parent bf50338 commit 3bf9a07
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/integration/progress/test_dashboards.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
from databricks.labs.lsql.backends import Row

from databricks.labs.ucx.__about__ import __version__ as ucx_version
from databricks.labs.ucx.framework.utils import escape_sql_identifier


def test_dashboard_progress_encoder_table_failures(runtime_ctx, az_cli_ctx) -> None:
failures = []
row = Row(
workspace_id=123456789,
job_run_id=1,
object_type="Dashboard",
object_id=["did1"],
data={"id": "did1"},
failures=[],
owner="cor",
ucx_version=ucx_version,
)
az_cli_ctx.progress_tracking_installation.run()
runtime_ctx = runtime_ctx.replace(
parent_run_id=1,
Expand All @@ -16,5 +28,4 @@ def test_dashboard_progress_encoder_table_failures(runtime_ctx, az_cli_ctx) -> N
history_table_name = escape_sql_identifier(runtime_ctx.tables_progress.full_name)
records = list(runtime_ctx.sql_backend.fetch(f"SELECT * FROM {history_table_name}"))

assert len(records) == 1, "Expected one historical entry"
assert records[0].failures == failures
assert records == [row]

0 comments on commit 3bf9a07

Please sign in to comment.