Skip to content

Commit

Permalink
Add test to latest and oldest supported aiida-core
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Feb 21, 2024
1 parent 089247c commit b2c6345
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:

strategy:
matrix:
tag: [latest]
browser: [Chrome, Firefox]
python-version: ['3.10']
aiida-core-version: [aiida-2.1.2, aiida-2.4.3] # test on the latest and the oldest supported version
fail-fast: false

runs-on: ubuntu-latest
Expand Down Expand Up @@ -91,13 +91,13 @@ jobs:
- name: Run pytest
run: pytest -v --driver ${{ matrix.browser }} tests_notebooks
env:
TAG: ${{ matrix.tag }}
TAG: ${{ matrix.aiida-core-version }}

- name: Upload screenshots as artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: Screenshots-${{ matrix.tag }}-${{ matrix.browser }}
name: Screenshots-${{ matrix.aiida-core-version }}-${{ matrix.browser }}
path: screenshots/
if-no-files-found: error

Expand Down
16 changes: 16 additions & 0 deletions tests_notebooks/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,25 @@ def notebook_service(docker_ip, docker_services, aiidalab_exec):
# make it writeable for jovyan user, needed for `pip install`
aiidalab_exec("chmod -R a+rw /home/jovyan/apps/aiidalab-widgets-base", user="root")

# The aiida-core version is pinned in the requirements.txt file only after
# we release the docker stack with aiida-core v2.4.0 in:
# https://github.com/aiidalab/aiidalab-docker-stack/commit/dfa65151017362fefeb56d97fed3c1b8f25537c5
# There is a possibility that aiida-core version will be overwritten by the installation of AWB.
# TODO: We can move this before/after version check after the lowest supported aiida-core version is 2.4.0.

# Get the aiida-core version before installing AWB
output = aiidalab_exec("verdi --version").decode("utf-8").strip()
before_version = output.split(" ")[-1]

# Install AWB with extra dependencies for SmilesWidget
aiidalab_exec("pip install --no-cache-dir .[smiles,optimade]")

# Get the aiida-core version before installing AWB
output = aiidalab_exec("verdi --version").decode("utf-8").strip()
after_version = output.split(" ")[-1]

assert before_version != after_version

# `port_for` takes a container port and returns the corresponding host port
port = docker_services.port_for("aiidalab", 8888)
url = f"http://{docker_ip}:{port}"
Expand Down

0 comments on commit b2c6345

Please sign in to comment.