Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install firefox/geckodriver in GH workflow for test #397

Merged
merged 10 commits into from
Nov 29, 2022
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ jobs:
tag: [latest]
browser: [Chrome, Firefox]
python-version: ['3.8', '3.10']
firefox: ['96.0']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make more sense for this to be an environment variable.
Having it here is a bit misleading, since if you were to set this to two versions, the matrix would be broken, since these versions are only valid for browser==Firefox, not browser==Chrome

fail-fast: false

runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 30

steps:

Expand All @@ -57,5 +58,20 @@ jobs:
run: |
pip install -U -e .[tests]

- name: Set jupyter token env
run: echo "JUPYTER_TOKEN=$(openssl rand -hex 32)" >> $GITHUB_ENV

- name: Install Firefox geckodriver
unkcpz marked this conversation as resolved.
Show resolved Hide resolved
uses: browser-actions/setup-firefox@latest
with:
firefox-version: ${{ matrix.firefox }}

- name: Install geckodriver
unkcpz marked this conversation as resolved.
Show resolved Hide resolved
run: |
wget -c https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz
tar xf geckodriver-v0.30.0-linux64.tar.gz -C /usr/local/bin
- name: Run pytest
run: TAG=${{ matrix.tag }} JUPYTER_TOKEN=$(openssl rand -hex 32) pytest --driver ${{ matrix.browser }}
run: |
pytest --driver ${{ matrix.browser }}
unkcpz marked this conversation as resolved.
Show resolved Hide resolved
env:
TAG: ${{ matrix.tag }}
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

load_documentation_profile()

import aiidalab_widgets_base # pylint: disable=wrong-import-position
from aiidalab_widgets_base import __version__ # pylint: disable=wrong-import-position

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down Expand Up @@ -65,7 +65,7 @@
#
# The full version, including alpha/beta/rc tags.
# The short X.Y version.
version = ".".join(aiidalab_widgets_base.__version__.split(".")[:2])
version = ".".join(__version__.split(".")[:2])

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ packages = find:
install_requires =
PyCifRW~=4.4
aiida-core>=2.0,<3
aiidalab>=21.11.2
aiidalab-eln>=0.1.2,~=0.1
ansi2html~=1.6
ase~=3.18
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _selenium_driver(nb_path):
url, f"apps/apps/aiidalab-widgets-base/{nb_path}?token={token}"
)
selenium.get(f"{url_with_token}")
selenium.implicitly_wait(5) # must wait until the app loaded
selenium.implicitly_wait(10) # must wait until the app loaded

selenium.find_element(By.ID, "ipython-main-app")
selenium.find_element(By.ID, "notebook-container")
Expand Down