Skip to content

Commit adb6db7

Browse files
authored
Merge pull request #2006 from plotly/fix-ci
Fix ci failures
2 parents f6abdfb + aea397b commit adb6db7

33 files changed

+360
-257
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ jobs:
294294
. venv/bin/activate && rm -rf components/dash-core-components/dash_core_components
295295
cd components/dash-core-components
296296
TESTFILES=$(circleci tests glob "tests/integration/**/test_*.py" | circleci tests split --split-by=timings)
297-
pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml --junitprefix="components.dash-core-components" ${TESTFILES}
297+
pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml --junitprefix="components.dash-core-components" ${TESTFILES} --reruns 3
298298
- store_artifacts:
299299
path: ~/dash/components/dash-core-components/test-reports
300300
- store_test_results:

components/dash-core-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"private::lint.prettier": "prettier --config .prettierrc src/**/*.js --list-different",
2222
"prepublishOnly": "rm -rf lib && babel src --out-dir lib --copy-files && rm -rf lib/jl/ lib/*.jl",
2323
"test": "run-s -c lint test:intg test:pyimport",
24-
"test:intg": "pytest --nopercyfinalize --headless tests/integration",
24+
"test:intg": "pytest --nopercyfinalize --headless tests/integration --reruns 3",
2525
"test:pyimport": "python -m unittest tests/test_dash_import.py",
2626
"prebuild:js": "cp node_modules/plotly.js-dist-min/plotly.min.js dash_core_components_base/plotly.min.js && cp node_modules/mathjax/es5/tex-svg.js dash_core_components_base/mathjax.js",
2727
"build:js": "webpack --mode production",

components/dash-core-components/tests/integration/calendar/test_date_picker_single.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from datetime import datetime, timedelta
22

33
import pytest
4+
import werkzeug
5+
46
from dash import Dash, Input, Output, html, dcc, no_update
57

68

@@ -71,6 +73,11 @@ def test_dtps010_local_and_session_persistence(dash_dcc):
7173
assert dash_dcc.get_logs() == []
7274

7375

76+
@pytest.mark.xfail(
77+
condition=werkzeug.__version__ in ("2.1.0", "2.1.1"),
78+
reason="Bug with 204 and Transfer-Encoding",
79+
strict=False,
80+
)
7481
def test_dtps011_memory_persistence(dash_dcc):
7582
app = Dash(__name__)
7683
app.layout = html.Div(

components/dash-core-components/tests/integration/dropdown/test_dynamic_options.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def update_options(search_value):
2424
dash_dcc.start_server(app)
2525

2626
# Get the inner input used for search value.
27-
dropdown = dash_dcc.find_element("#my-dynamic-dropdown")
28-
input_ = dropdown.find_element_by_css_selector("input")
27+
input_ = dash_dcc.find_element("#my-dynamic-dropdown input")
2928

3029
# Focus on the input to open the options menu
3130
input_.send_keys("x")
@@ -36,15 +35,15 @@ def update_options(search_value):
3635
input_.clear()
3736
input_.send_keys("o")
3837

39-
options = dropdown.find_elements_by_css_selector(".VirtualizedSelectOption")
38+
options = dash_dcc.find_elements("#my-dynamic-dropdown .VirtualizedSelectOption")
4039

4140
# Should show all options.
4241
assert len(options) == 3
4342

4443
# Searching for `on`
4544
input_.send_keys("n")
4645

47-
options = dropdown.find_elements_by_css_selector(".VirtualizedSelectOption")
46+
options = dash_dcc.find_elements("#my-dynamic-dropdown .VirtualizedSelectOption")
4847

4948
assert len(options) == 1
5049
print(options)

components/dash-core-components/tests/integration/graph/test_graph_varia.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import pytest
33
import time
44
import json
5+
6+
import werkzeug
7+
58
from dash import Dash, Input, Output, State, dcc, html
69
from dash.exceptions import PreventUpdate
710
from selenium.webdriver.common.by import By
@@ -128,7 +131,7 @@ def show_relayout_data(data):
128131

129132
# use this opportunity to test restyleData, since there are multiple
130133
# traces on this graph
131-
legendToggle = dash_dcc.driver.find_element_by_css_selector(
134+
legendToggle = dash_dcc.find_element(
132135
"#example-graph .traces:first-child .legendtoggle"
133136
)
134137
legendToggle.click()
@@ -142,7 +145,7 @@ def show_relayout_data(data):
142145
)
143146

144147
# and test relayoutData while we're at it
145-
autoscale = dash_dcc.driver.find_element_by_css_selector("#example-graph .ewdrag")
148+
autoscale = dash_dcc.find_element("#example-graph .ewdrag")
146149
autoscale.click()
147150
autoscale.click()
148151
dash_dcc.wait_for_text_to_equal("#relayout-data", '{"xaxis.autorange": true}')
@@ -185,6 +188,10 @@ def render_content(click, prev_graph):
185188
assert dash_dcc.get_logs() == []
186189

187190

191+
@pytest.mark.skipif(
192+
werkzeug.__version__ in ("2.1.0", "2.1.1"),
193+
reason="Bug with no_update 204 responses get Transfer-Encoding header.",
194+
)
188195
@pytest.mark.parametrize("is_eager", [True, False])
189196
def test_grva004_graph_prepend_trace(dash_dcc, is_eager):
190197
app = Dash(__name__, eager_loading=is_eager)
@@ -357,6 +364,10 @@ def display_data(trigger, fig):
357364
assert dash_dcc.get_logs() == []
358365

359366

367+
@pytest.mark.skipif(
368+
werkzeug.__version__ in ("2.1.0", "2.1.1"),
369+
reason="Bug with no_update 204 responses get Transfer-Encoding header.",
370+
)
360371
@pytest.mark.parametrize("is_eager", [True, False])
361372
def test_grva005_graph_extend_trace(dash_dcc, is_eager):
362373
app = Dash(__name__, eager_loading=is_eager)

components/dash-core-components/tests/integration/link/test_absolute_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def extras(t):
4949
dcc.Link(
5050
children="Absolute Path",
5151
id="link1",
52-
href=dash_dcc.server.url + "/extra/eseehc",
52+
href="/extra/eseehc",
5353
refresh=True,
5454
),
5555
dcc.Location(id="url", refresh=False),

components/dash-core-components/tests/integration/link/test_link_event.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def display_page(pathname):
9393
dash_dcc.wait_for_text_to_equal("#page-content", "You are on page /test-link")
9494

9595
wait.until(
96-
lambda: test_link.get_attribute("href") == "http://localhost:8050/test-link", 3
96+
lambda: test_link.get_attribute("href")
97+
== "http://localhost:{}/test-link".format(dash_dcc.server.port),
98+
3,
9799
)
98100
wait.until(lambda: call_count.value == 2, 3)
99101

components/dash-core-components/tests/integration/location/test_location_callback.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def update_pathname(n_clicks, current_pathname):
9393
# Check that link updates pathname
9494
dash_dcc.find_element("#test-link").click()
9595
until(
96-
lambda: dash_dcc.driver.current_url.replace("http://localhost:8050", "")
96+
lambda: dash_dcc.driver.current_url.replace(
97+
"http://localhost:{}".format(dash_dcc.server.port), ""
98+
)
9799
== "/test/pathname",
98100
3,
99101
)

components/dash-core-components/tests/integration/store/test_data_lifecycle.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import pytest
2+
import werkzeug
3+
14
import dash.testing.wait as wait
25

36

7+
@pytest.mark.xfail(
8+
condition=werkzeug.__version__ in ("2.1.0", "2.1.1"),
9+
reason="Bug with 204 and Transfer-Encoding",
10+
strict=False,
11+
)
412
def test_stdl001_data_lifecycle_with_different_condition(store_app, dash_dcc):
513
dash_dcc.start_server(store_app)
614

components/dash-core-components/tests/integration/tab/test_tabs_with_graphs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import werkzeug
2+
13
from dash import Dash, Input, Output, dcc, html
24
from dash.exceptions import PreventUpdate
35
import json
@@ -119,6 +121,11 @@ def render_content(tab):
119121
assert dash_dcc.get_logs() == []
120122

121123

124+
@pytest.mark.xfail(
125+
condition=werkzeug.__version__ in ("2.1.0", "2.1.1"),
126+
reason="Bug with 204 and Transfer-Encoding",
127+
strict=False,
128+
)
122129
@pytest.mark.parametrize("is_eager", [True, False])
123130
def test_tabs_render_without_selected(dash_dcc, is_eager):
124131
app = Dash(__name__, eager_loading=is_eager)

0 commit comments

Comments
 (0)