|
8 | 8 |
|
9 | 9 | import databricks |
10 | 10 | from databricks.labs.blueprint.installation import Installation |
| 11 | +from databricks.labs.blueprint.installer import InstallState |
11 | 12 | from databricks.labs.blueprint.parallel import ManyError |
12 | 13 | from databricks.labs.blueprint.tui import MockPrompts |
13 | 14 | from databricks.labs.blueprint.wheels import ProductInfo |
@@ -248,6 +249,17 @@ def test_installation_when_dashboard_id_is_invalid(ws, installation_ctx, dashboa |
248 | 249 | assert dashboard_id != new_dashboard_id, "Dashboard id is not updated" |
249 | 250 |
|
250 | 251 |
|
| 252 | +def test_installation_stores_install_state_keys(ws, installation_ctx): |
| 253 | + """The installation should store the keys in the installation state.""" |
| 254 | + expected_keys = "jobs", "dashboards" |
| 255 | + installation_ctx.workspace_installation.run() |
| 256 | + # Refresh the installation state, the installation context uses `@cached_property` |
| 257 | + install_state = InstallState.from_installation(installation_ctx.installation) |
| 258 | + for key in expected_keys: |
| 259 | + assert hasattr(install_state, key), f"Missing key in install state: {key}" |
| 260 | + assert getattr(install_state, key), f"Installation state is empty: {key}" |
| 261 | + |
| 262 | + |
251 | 263 | @retried(on=[NotFound], timeout=timedelta(minutes=2)) |
252 | 264 | def test_uninstallation(ws, sql_backend, installation_ctx): |
253 | 265 | installation_ctx.workspace_installation.run() |
|
0 commit comments