Skip to content

Commit

Permalink
Merge branch 'main' into qe-env-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas authored Jul 23, 2024
2 parents 983bd07 + a3b40b0 commit 29bfefa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-test-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
run: echo "JUPYTER_TOKEN=$(openssl rand -hex 32)" >> $GITHUB_ENV

- name: Run pytest for Chrome
run: pytest --driver Chrome tests_integration/
run: pytest -sv --driver Chrome tests_integration/
env:
QE_IMAGE: ${{ env.IMAGE }}@${{ steps.build-upload.outputs.digest }}

Expand Down
2 changes: 1 addition & 1 deletion before-notebook.d/70_prepare-qe-executable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ if [[ $(verdi code list -Y localhost -r | wc -l) -eq 0 ]]; then
python -m aiidalab_qe install-qe
else
echo "Quantum ESPRESSO codes are already installed."
fi
fi
17 changes: 10 additions & 7 deletions tests_integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,22 @@ def nb_user(aiidalab_exec):


@pytest.fixture(scope="session")
def notebook_service(docker_ip, docker_services):
def notebook_service(docker_compose, docker_ip, docker_services):
"""Ensure that HTTP service is up and responsive."""

# `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}"
token = os.environ.get("JUPYTER_TOKEN", "testtoken")
docker_services.wait_until_responsive(
# The timeout is very high for this test, because the installation of pseudo libraries.
timeout=180.0,
pause=0.1,
check=lambda: is_responsive(url),
)
try:
docker_services.wait_until_responsive(
timeout=180.0,
pause=1.0,
check=lambda: is_responsive(url),
)
except Exception as e:
print(docker_compose.execute("logs").decode().strip())
pytest.exit(e)
return url, token


Expand Down

0 comments on commit 29bfefa

Please sign in to comment.