plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.

Home Page:https://plotly.com/dash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] dash_duo.get_logs() returns None instead of an empty list

oegedijk opened this issue · comments

Thank you so much for helping improve the quality of Dash!

We do our best to catch bugs during the release process, but we rely on your help to find the ones that slip through.

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

  • replace the result of pip list | grep dash below
dash                      2.14.2
dash-auth                 2.0.0
dash-bootstrap-components 1.5.0
dash-core-components      2.0.0
dash-html-components      2.0.0
dash-table                5.0.0
dash-testing-stub         0.0.2
jupyter-dash              0.4.2
  • if frontend related, tell us your Browser, Version and OS

    • OS: OSX
    • Browser chromedriver 120

Describe the bug

Tests such as this one: https://github.com/oegedijk/explainerdashboard/blob/3ae3fe6488cac234512014799895fff562143395/tests/integration_tests/test_dashboards.py#L8

on explainerdashboard are failing due to dash_duo.get_logs() not returning an empty list as expected but instead returning None. Both locally and in the github actions CI.

def test_classification_dashboard(dash_duo, precalculated_rf_classifier_explainer):
       db = ExplainerDashboard(
           precalculated_rf_classifier_explainer, title="testing", responsive=False
       )
       html = db.to_html()
       assert html.startswith(
           "\n<!DOCTYPE html>\n<html"
       ), "failed to generate dashboard to_html"
   
       dash_duo.start_server(db.app)
       dash_duo.wait_for_text_to_equal("h1", "testing", timeout=30)
>       assert dash_duo.get_logs() == [], "browser console should contain no error"
E       AssertionError: browser console should contain no error
E       assert None == []
E        +  where None = <bound method Browser.get_logs of <dash.testing.composite.DashComposite object at 0x13dafd660>>()
E        +    where <bound method Browser.get_logs of <dash.testing.composite.DashComposite object at 0x13dafd660>> = <dash.testing.composite.DashComposite object at 0x13dafd660>.get_logs

Expected behavior

Should return [] as before.

Actually the problem comes from chromedriver itself. In version 120 it was split into two variants with different driver.name. More info here. The problem is that current version of chromedriver returns chrome-headless-shell instead of chrome.

We're having this problem with dash_duo.get_logs() because dash is working with a chrome name only.

Maybe dash should support chrome-headless-shell and chrome driver names in the new version?