fix flaky dashboard tests (#3370)

* improves dashboard multi schema test

* closes and waits for sections in multi-schema test

* removes command line snippet with generic text in exceptions

* disables transformers pokeapi test
This commit is contained in:
rudolfix
2025-11-24 22:52:36 +01:00
committed by GitHub
parent 81ebbcca43
commit 661c6c1ada
4 changed files with 21 additions and 16 deletions

View File

@@ -11,16 +11,6 @@ import urllib
from dlt.common.exceptions import MissingDependencyException
def _detect_dashboard_command() -> str:
command = sys.argv[1]
if command == "pipeline":
return f"dlt pipeline {sys.argv[2]} show"
elif command == "dashboard":
return "dlt dashboard"
else:
raise ValueError(f"Invalid command: {command}")
# keep this, will raise if user tries to run dashboard without dependencies
try:
import marimo
@@ -28,7 +18,7 @@ try:
import ibis
except ModuleNotFoundError:
raise MissingDependencyException(
_detect_dashboard_command(),
"Workspace Dashboard",
['dlt["workspace"]'],
"to install the dlt workspace extra.",
)

View File

@@ -1,7 +1,6 @@
#
# App general
#
import marimo as _mo
# Reusable string parts

View File

@@ -13,7 +13,7 @@ EXAMPLES_DIR = "./examples"
# settings
SKIP_FOLDERS = ["archive", ".", "_", "local_cache"]
# @pytest.mark.rfam
SKIP_EXAMPLES: List[str] = ["backfill_in_chunks", "connector_x_arrow"]
SKIP_EXAMPLES: List[str] = ["backfill_in_chunks", "connector_x_arrow", "transformers"]
SKIP_FORK_EXAMPLES: List[str] = ["custom_destination_lancedb"]

View File

@@ -51,12 +51,16 @@ def _open_section(
close_other_sections: bool = True,
) -> None:
if close_other_sections:
for s in known_sections:
if s != section:
page.get_by_role("switch", name=s).uncheck()
_close_sections(page, section)
page.get_by_role("switch", name=section).check()
def _close_sections(page: Page, skip_section: str = None) -> None:
for s in known_sections:
if s != skip_section:
page.get_by_role("switch", name=s).uncheck()
def test_page_overview(page: Page):
_go_home(page)
@@ -120,22 +124,34 @@ def test_multi_schema_selection(page: Page, multi_schema_pipeline: Any):
for section in ["schema", "data"]:
_open_section(page, section) # type: ignore[arg-type]
# NOTE: this is using unspecific selector and may select other dropdowns id present (?)
schema_selector = page.get_by_test_id("marimo-plugin-dropdown")
schema_selector.select_option("fruitshop_customers")
expect(schema_selector).to_have_value("fruitshop_customers")
schema_selector.scroll_into_view_if_needed()
expect(page.get_by_text("customers", exact=True).nth(0)).to_be_visible()
expect(page.get_by_text("inventory", exact=True)).to_have_count(0)
expect(page.get_by_text("purchases", exact=True)).to_have_count(0)
schema_selector.select_option("fruitshop_inventory")
expect(schema_selector).to_have_value("fruitshop_inventory")
expect(page.get_by_text("inventory", exact=True).nth(0)).to_be_visible()
expect(page.get_by_text("customers", exact=True)).to_have_count(0)
expect(page.get_by_text("purchases", exact=True)).to_have_count(0)
schema_selector.select_option("fruitshop_purchases")
expect(schema_selector).to_have_value("fruitshop_purchases")
expect(page.get_by_text("purchases", exact=True).nth(0)).to_be_visible()
expect(page.get_by_text("inventory", exact=True)).to_have_count(0)
expect(page.get_by_text("customers", exact=True)).to_have_count(0)
_close_sections(page)
# make sure schema selector removed from page
expect(schema_selector).not_to_be_attached()
def test_simple_incremental_pipeline(page: Page, simple_incremental_pipeline: Any):
#