Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Fix CI for jupyter-server #74

Merged
merged 8 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,19 @@ test-setup:


test: test-setup ## Run tests
cd $(CURDIR)/python; pytest --driver Remote --host $(SELENIUM_HUB_HOST) --port $(SELENIUM_HUB_PORT) --capability browserName chrome \
cd $(CURDIR)/python; pytest --driver Remote --host $(SELENIUM_HUB_HOST) --selenium-port $(SELENIUM_HUB_PORT) --capability browserName chrome \
--base-url $(PYTEST_BASE_URL) --needle-baseline-dir $(CURDIR)/docs/assets/img/screenshots --needle-output-dir test-results/screenshots \
-k $(PYTEST_K) -m $(TEST_MARKERS) --html=test-results/report.html --self-contained-html


test-all: test-setup ## Run all tests
cd $(CURDIR)/python; pytest --driver Remote --host $(SELENIUM_HUB_HOST) --port $(SELENIUM_HUB_PORT) --capability browserName chrome \
cd $(CURDIR)/python; pytest --driver Remote --host $(SELENIUM_HUB_HOST) --selenium-port $(SELENIUM_HUB_PORT) --capability browserName chrome \
--base-url $(PYTEST_BASE_URL) --needle-baseline-dir $(CURDIR)/docs/assets/img/screenshots --needle-output-dir test-results/screenshots \
-k $(PYTEST_K) --html=test-results/report.html --self-contained-html


test-baselines: ## Create test baselines
cd $(CURDIR)/python; pytest --driver Remote --host $(SELENIUM_HUB_HOST) --port $(SELENIUM_HUB_PORT) --capability browserName chrome \
cd $(CURDIR)/python; pytest --driver Remote --host $(SELENIUM_HUB_HOST) --selenium-port $(SELENIUM_HUB_PORT) --capability browserName chrome \
--base-url $(PYTEST_BASE_URL) --needle-save-baseline --needle-baseline-dir $(CURDIR)/docs/assets/img/screenshots \
-s -k $(PYTEST_K)

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies:
- voila>=0.2.0,<0.3
- nbconvert>=6.0.0,<7
- nbclient>=0.4.0
- jupyter_server>=1.1.0
- illusionist>=0.2.0
- jupyter-flex>=0.6.4
- pytest-html
Expand Down
20 changes: 10 additions & 10 deletions python/jupyter_flex/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def myselenium(selenium):
return selenium


def test_example_site(needle, myselenium):
def test_example_site(needle, myselenium, base_url):
target_url = "http://example.com/"
needle.driver.get(target_url)

Expand All @@ -32,7 +32,7 @@ def test_voila(needle, myselenium, base_url, name, path):
target_url = "{0}/{1}".format(base_url, path)
needle.driver.get(target_url)

# Wait for page components to render
# Wait for dashboard to render
time.sleep(2)

# Take an element screen diff
Expand All @@ -46,7 +46,7 @@ def test_apps(needle, myselenium, base_url, nb_name):
target_url = "{0}/voila/render/{1}.ipynb".format(base_url, nb_name)
needle.driver.get(target_url)

# Wait for dashboard components to render
# Wait for dashboard to render
time.sleep(10)

# Take an element screen diff
Expand All @@ -58,7 +58,7 @@ def test_customize(needle, myselenium, base_url, nb_name):
target_url = "{0}/voila/render/customize/{1}.ipynb".format(base_url, nb_name)
needle.driver.get(target_url)

# Wait for dashboard components to render
# Wait for dashboard to render
time.sleep(5)

# Take an element screen diff
Expand All @@ -70,7 +70,7 @@ def test_demos(needle, myselenium, base_url, nb_name):
target_url = "{0}/voila/render/demos/{1}.ipynb".format(base_url, nb_name)
needle.driver.get(target_url)

# Wait for dashboard components to render
# Wait for dashboard to render
time.sleep(5)

# Take an element screen diff
Expand All @@ -84,7 +84,7 @@ def test_getting_started(needle, myselenium, base_url, nb_name):
target_url = "{0}/voila/render/getting-started/{1}.ipynb".format(base_url, nb_name)
needle.driver.get(target_url)

# Wait for dashboard components to render
# Wait for dashboard to render
time.sleep(5)

# Take an element screen diff
Expand All @@ -98,7 +98,7 @@ def test_illusionist(needle, myselenium, base_url, nb_name):
target_url = "{0}/voila/render/illusionist/{1}.ipynb".format(base_url, nb_name)
needle.driver.get(target_url)

# Wait for dashboard components to render
# Wait for dashboard to render
time.sleep(5)

# Take an element screen diff
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_layouts(needle, myselenium, base_url, nb_name):
target_url = "{0}/voila/render/layouts/{1}.ipynb".format(base_url, nb_name)
needle.driver.get(target_url)

# Wait for dashboard components to render
# Wait for dashboard to render
time.sleep(5)

# Take an element screen diff
Expand All @@ -154,7 +154,7 @@ def test_plots(needle, myselenium, base_url, nb_name):
target_url = "{0}/voila/render/plots/{1}.ipynb".format(base_url, nb_name)
needle.driver.get(target_url)

# Wait for dashboard components to render
# Wait for dashboard to render
time.sleep(5)

# Take an element screen diff
Expand All @@ -176,7 +176,7 @@ def test_widgets(needle, myselenium, base_url, nb_name):
target_url = "{0}/voila/render/widgets/{1}.ipynb".format(base_url, nb_name)
needle.driver.get(target_url)

# Wait for dashboard components to render
# Wait for dashboard to render
time.sleep(10)

# Take an element screen diff
Expand Down
9 changes: 9 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
[build-system]
requires = ["setuptools>=42", "setuptools_scm[toml]>=3.4", "wheel"]

[tool.pytest.ini_options]
norecursedirs = ".git,dist,build,env,venv"
addopts = "jupyter_flex/tests --cov=jupyter_flex --cov-report term-missing"
markers = [
"selenium: requires selenium (deselect with '-m \"not selenium\"')"
]
pytest_plugin = ["jupyter_server.pytest_plugin"]


[tool.coverage.run]
parallel = true
branch = true
Expand Down
1 change: 1 addition & 0 deletions python/requirements-package.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
voila>=0.2.0,<0.3
nbconvert>=6.0.7,<7
nbclient>=0.4.0
jupyter_server>=1.1.0
1 change: 1 addition & 0 deletions python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pytest-cov
voila>=0.2.0,<0.3
nbconvert>=6.0.0,<7
nbclient>=0.4.0
jupyter_server>=1.1.0
illusionist>=0.2.0
jupyter-flex>=0.6.4
pytest-html
Expand Down
7 changes: 0 additions & 7 deletions python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,3 @@ ignore = E203, E501, W503
select = C,E,F,W,B,B950
paths = .,jupyter_flex
exclude = .git,dist,build,env,venv,*.egg*,node_modules

[tool:pytest]
norecursedirs = .git,dist,build,env,venv
strict = true
addopts = jupyter_flex/tests --cov=jupyter_flex --cov-report term-missing
markers =
selenium: requires selenium (deselect with '-m "not selenium"')