tests: fix failure to log and raise error when waiting for url fails #552
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a GitHub workflow defining a set of jobs with a set of steps. | |
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
# | |
name: Test | |
on: | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "contrib/**" | |
- "**.md" | |
- ".github/workflows/*" | |
- "!.github/workflows/test.yaml" | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "contrib/**" | |
- "**.md" | |
- ".github/workflows/*" | |
- "!.github/workflows/test.yaml" | |
branches-ignore: | |
- "dependabot/**" | |
- "pre-commit-ci-update-config" | |
workflow_dispatch: | |
env: | |
# avoid warnings about config paths | |
JUPYTER_PLATFORM_DIRS: "1" | |
# avoid looking at every version of pip ever released | |
PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- uses: actions/setup-node@v3 | |
with: | |
cache: yarn | |
node-version: 20.x | |
registry-url: https://registry.npmjs.org | |
cache-dependency-path: labextension/yarn.lock | |
- name: Update root build packages | |
run: pip install --upgrade build | |
- name: Build Python package | |
run: pyproject-build | |
- name: Upload built artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist-${{ github.run_number }} | |
path: ./dist | |
test: | |
name: ${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.pip-extras }} | |
needs: [build] | |
timeout-minutes: 30 | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash # windows default isn't bash | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04] | |
python-version: ["3.11"] | |
pip-extras: ["lab"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: Update root build packages | |
run: pip install --upgrade pip | |
- name: Download built artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist-${{ github.run_number }} | |
path: ./dist | |
- name: Install Python package | |
# NOTE: See CONTRIBUTING.md for a local development setup that differs | |
# slightly from this. | |
# | |
# Pytest options are set in `pyproject.toml`. | |
run: | | |
pip install -vv $(ls ./dist/*.whl)\[acceptance,${{ matrix.pip-extras }}\] | |
- name: List Python packages | |
run: | | |
pip freeze | |
pip check | |
# we have installed a pre-built wheel and configured code coverage to | |
# inspect "jupyter_server_proxy", by re-locating to another directory, | |
# there is no confusion about "jupyter_server_proxy" referring to our | |
# installed package rather than the local directory | |
- name: Run tests | |
run: | | |
mkdir build | |
cd build | |
pytest -c ../pyproject.toml ../tests/acceptance | |
- name: Write server.log | |
if: always() | |
run: | | |
cd build/robot | |
cat server.log | |
- name: Upload test reports | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: |- | |
tests-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.pip-extras }}-${{ github.run_number }} | |
path: | | |
./build/pytest | |
./build/coverage | |
./build/robot |