From ab825d7afa5dc46828ab3c22651179c71465b1c1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 16 Mar 2022 10:04:51 -0500 Subject: [PATCH 01/11] fix sessions test From 037625a11536bcd4cd6d1d78e60d26c55306c977 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 05:32:40 -0500 Subject: [PATCH 02/11] consolidate workflows --- .github/workflows/python-macos.yml | 46 ------------------- .../{python-linux.yml => python-tests.yml} | 37 +++++++++++---- .github/workflows/python-windows.yml | 42 ----------------- 3 files changed, 27 insertions(+), 98 deletions(-) delete mode 100644 .github/workflows/python-macos.yml rename .github/workflows/{python-linux.yml => python-tests.yml} (75%) delete mode 100644 .github/workflows/python-windows.yml diff --git a/.github/workflows/python-macos.yml b/.github/workflows/python-macos.yml deleted file mode 100644 index f12c62676e..0000000000 --- a/.github/workflows/python-macos.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Jupyter Server Tests [Mac OS] -on: - push: - branches: ["main"] - pull_request: - branches: ["*"] -jobs: - build: - runs-on: ${{ matrix.os }} - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - os: [macos-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Install the Python dependencies - run: | - pip install -e .[test] codecov - pip install pytest-github-actions-annotate-failures - - name: List installed packages - run: | - pip freeze - pip check - - name: Run the tests - if: ${{ !startsWith( matrix.python-version, 'pypy' ) }} - run: | - pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered || pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --lf - - name: Run the tests on pypy - if: ${{ startsWith( matrix.python-version, 'pypy' ) }} - run: | - pytest -vv || pytest -vv --lf - - name: Install the Python dependencies for the examples - run: | - cd examples/simple && pip install -e . - - name: Run the tests for the examples - run: | - pytest examples/simple - - name: Coverage - if: ${{ !startsWith( matrix.python-version, 'pypy' ) }} - run: | - codecov diff --git a/.github/workflows/python-linux.yml b/.github/workflows/python-tests.yml similarity index 75% rename from .github/workflows/python-linux.yml rename to .github/workflows/python-tests.yml index 5b96aea3bb..750442cfcc 100644 --- a/.github/workflows/python-linux.yml +++ b/.github/workflows/python-tests.yml @@ -1,4 +1,4 @@ -name: Jupyter Server Tests [Linux] +name: Jupyter Server Tests on: push: branches: ["main"] @@ -6,6 +6,10 @@ on: schedule: - cron: "0 8 * * *" +defaults: + run: + shell: bash + jobs: # Run "pre-commit run --all-files" pre-commit: @@ -37,8 +41,11 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"] + exclude: + - os: windows + python-version: pypy-3.7 steps: - name: Checkout uses: actions/checkout@v2 @@ -52,13 +59,19 @@ jobs: pip freeze pip check - name: Run the tests - if: ${{ matrix.python-version != 'pypy-3.7' }} + if: ${{ matrix.python-version != 'pypy-3.7' && matrix.os == 'windows' }} run: | - pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --cov-fail-under 70 || pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --cov-fail-under 70 --lf - - name: Run the tests on pypy - if: ${{ matrix.python-version == 'pypy-3.7' }} + args="-vv -raXxs --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes --cov-fail-under 70" + pytest $args || pytest $args --lf + - name: Run the tests on pypy and windows + if: ${{ matrix.python-version == 'pypy-3.7' || matrix.os == 'windows' }} run: | - pytest -vv || pytest -vv -lf + # Disable capturing (-s) output from Pytest on Windows and PyPy. + # For an unknown reason, capturing output interferes with + # the file descriptions opened by the asyncio IOLoop. + # This leads to a nasty, flaky race condition that we haven't + # been able to solve. + pytest -vv -s || pytest -vv -s --lf - name: Install the Python dependencies for the examples run: | cd examples/simple && pip install -e . @@ -88,7 +101,9 @@ jobs: - name: Install miniumum versions uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1 - name: Run the unit tests - run: pytest -vv|| pytest -vv --lf + run: | + args="-vv -raXxs --durations 10 --color=yes" + pytest $args || pytest $args --lf test_prereleases: name: Test Prereleases @@ -108,7 +123,8 @@ jobs: pip check - name: Run the tests run: | - pytest -vv || pytest -vv --lf + args="-vv -raXxs --durations 10 --color=yes" + pytest $args || pytest $args --lf make_sdist: name: Make SDist @@ -149,4 +165,5 @@ jobs: - name: Run Test run: | cd sdist/test - pytest -vv || pytest -vv --lf + args="-vv -raXxs --durations 10 --color=yes" + pytest $args || pytest $args --lf diff --git a/.github/workflows/python-windows.yml b/.github/workflows/python-windows.yml deleted file mode 100644 index c4b078c04f..0000000000 --- a/.github/workflows/python-windows.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Jupyter Server Tests [Windows] -on: - push: - branches: ["main"] - pull_request: - branches: ["*"] -jobs: - build: - runs-on: ${{ matrix.os }} - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - os: [windows-latest] - python-version: ["3.7", "3.8", "3.9", "3.10"] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Install the Python dependencies - run: | - pip install -e .[test] - pip install pytest-github-actions-annotate-failures - - name: List installed packages - run: | - pip freeze - pip check - - name: Run the tests - run: | - # Disable capturing (-s) output from Pytest on Windows. - # For an unknown reason, capturing output interferes with - # the file descriptions opened by the asyncio IOLoop. - # This leads to a nasty, flaky race condition that we haven't - # been able to solve. - pytest -vv -s || pytest -vv -s --lf - - name: Install the Python dependencies for the examples - run: | - cd examples/simple && pip install -e . - - name: Run the tests for the examples - run: | - pytest examples/simple From 33bc4afcbc84f2b31b81fd50166d759a5b83a18b Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 05:37:41 -0500 Subject: [PATCH 03/11] fix selector --- .github/workflows/python-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 750442cfcc..34a84ed5f6 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -59,7 +59,7 @@ jobs: pip freeze pip check - name: Run the tests - if: ${{ matrix.python-version != 'pypy-3.7' && matrix.os == 'windows' }} + if: ${{ matrix.python-version != 'pypy-3.7' && matrix.os != 'windows' }} run: | args="-vv -raXxs --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes --cov-fail-under 70" pytest $args || pytest $args --lf From 6a41b0e4c97b189fe6d661586e8c6599a60e33ff Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 06:05:58 -0500 Subject: [PATCH 04/11] fix exclusion --- .github/workflows/python-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 34a84ed5f6..45f6afce44 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -44,7 +44,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"] exclude: - - os: windows + - os: windows-latest python-version: pypy-3.7 steps: - name: Checkout From abb85b003e3282af443357e08127f4b5a5eef38a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 06:11:52 -0500 Subject: [PATCH 05/11] Fix conditionals --- .github/workflows/python-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 45f6afce44..102a3d3a48 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -59,12 +59,12 @@ jobs: pip freeze pip check - name: Run the tests - if: ${{ matrix.python-version != 'pypy-3.7' && matrix.os != 'windows' }} + if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }} run: | args="-vv -raXxs --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes --cov-fail-under 70" pytest $args || pytest $args --lf - name: Run the tests on pypy and windows - if: ${{ matrix.python-version == 'pypy-3.7' || matrix.os == 'windows' }} + if: ${{ startsWith(matrix.python-version, 'pypy-3.7') || startsWith(matrix.os, 'windows') }} run: | # Disable capturing (-s) output from Pytest on Windows and PyPy. # For an unknown reason, capturing output interferes with From e5a57d50932269aba48d96b5792657e91d858f2c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 08:43:35 -0500 Subject: [PATCH 06/11] try without explicit shell --- .github/workflows/python-tests.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 102a3d3a48..fa5ffa384e 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -6,10 +6,6 @@ on: schedule: - cron: "0 8 * * *" -defaults: - run: - shell: bash - jobs: # Run "pre-commit run --all-files" pre-commit: From 6d498a37b09700284717a91b0fc8f3438a5e0306 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 08:48:12 -0500 Subject: [PATCH 07/11] change how we invoke pytest --- .github/workflows/python-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index fa5ffa384e..750abcac39 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -58,7 +58,7 @@ jobs: if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }} run: | args="-vv -raXxs --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes --cov-fail-under 70" - pytest $args || pytest $args --lf + python -m pytest $args || python -m pytest $args --lf - name: Run the tests on pypy and windows if: ${{ startsWith(matrix.python-version, 'pypy-3.7') || startsWith(matrix.os, 'windows') }} run: | From c05df5e20824982077ba85f56392e339083eaf8d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 08:54:44 -0500 Subject: [PATCH 08/11] fix invocation again --- .github/workflows/python-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 750abcac39..8243cacc4b 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -73,7 +73,7 @@ jobs: cd examples/simple && pip install -e . - name: Run the tests for the examples run: | - pytest examples/simple + python -m pytest examples/simple - name: Coverage if: ${{ matrix.python-version != 'pypy-3.7' }} run: | From a89745432c4f539a41933261686d93691e3d0cbe Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 09:02:03 -0500 Subject: [PATCH 09/11] more cleanup --- .github/workflows/python-tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 8243cacc4b..078027c889 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -57,7 +57,7 @@ jobs: - name: Run the tests if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }} run: | - args="-vv -raXxs --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes --cov-fail-under 70" + args="-vv -raXs --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes --cov-fail-under 70" python -m pytest $args || python -m pytest $args --lf - name: Run the tests on pypy and windows if: ${{ startsWith(matrix.python-version, 'pypy-3.7') || startsWith(matrix.os, 'windows') }} @@ -67,7 +67,7 @@ jobs: # the file descriptions opened by the asyncio IOLoop. # This leads to a nasty, flaky race condition that we haven't # been able to solve. - pytest -vv -s || pytest -vv -s --lf + python -m pytest -vv -raXs || python -m pytest -vv -raXs --lf - name: Install the Python dependencies for the examples run: | cd examples/simple && pip install -e . @@ -98,7 +98,7 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1 - name: Run the unit tests run: | - args="-vv -raXxs --durations 10 --color=yes" + args="-vv -raXs --durations 10 --color=yes" pytest $args || pytest $args --lf test_prereleases: @@ -119,7 +119,7 @@ jobs: pip check - name: Run the tests run: | - args="-vv -raXxs --durations 10 --color=yes" + args="-vv -raXs --durations 10 --color=yes" pytest $args || pytest $args --lf make_sdist: @@ -161,5 +161,5 @@ jobs: - name: Run Test run: | cd sdist/test - args="-vv -raXxs --durations 10 --color=yes" + args="-vv -raXs --durations 10 --color=yes" pytest $args || pytest $args --lf From 50ca7cf87a1093c1501c76dbec6e03c8fad59372 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 09:02:18 -0500 Subject: [PATCH 10/11] fix typo --- .github/workflows/python-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 078027c889..dc2e9327e8 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -84,7 +84,7 @@ jobs: pip install -r doc-requirements.txt make html SPHINXOPTS="-W" - test_miniumum_verisons: + test_miniumum_versions: name: Test Minimum Versions timeout-minutes: 20 runs-on: ubuntu-latest From 24713d5dae0749da90d1dc1513c0085528babd3f Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 22 Mar 2022 09:27:44 -0500 Subject: [PATCH 11/11] more cleanup --- .github/workflows/python-tests.yml | 41 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index dc2e9327e8..95327a0cc8 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -38,10 +38,14 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"] - exclude: + python-version: ["3.7", "3.10"] + include: - os: windows-latest - python-version: pypy-3.7 + python-version: "3.9" + - os: ubuntu-latest + python-version: "pypy-3.7" + - os: macos-latest + python-version: "3.8" steps: - name: Checkout uses: actions/checkout@v2 @@ -50,34 +54,34 @@ jobs: - name: Install the Python dependencies run: | pip install -e ".[test]" codecov - - name: List installed packages - run: | - pip freeze - pip check - name: Run the tests if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }} run: | args="-vv -raXs --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes --cov-fail-under 70" python -m pytest $args || python -m pytest $args --lf - name: Run the tests on pypy and windows - if: ${{ startsWith(matrix.python-version, 'pypy-3.7') || startsWith(matrix.os, 'windows') }} + if: ${{ startsWith(matrix.python-version, 'pypy') || startsWith(matrix.os, 'windows') }} run: | - # Disable capturing (-s) output from Pytest on Windows and PyPy. - # For an unknown reason, capturing output interferes with - # the file descriptions opened by the asyncio IOLoop. - # This leads to a nasty, flaky race condition that we haven't - # been able to solve. python -m pytest -vv -raXs || python -m pytest -vv -raXs --lf + - name: Coverage + run: | + codecov + + test_docs_and_examples: + name: Test Docs and Examples + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install the Python dependencies for the examples run: | + pip install -e ".[test]" cd examples/simple && pip install -e . - name: Run the tests for the examples run: | python -m pytest examples/simple - - name: Coverage - if: ${{ matrix.python-version != 'pypy-3.7' }} - run: | - codecov - name: Test the docs run: | cd docs @@ -154,10 +158,9 @@ jobs: set -ex cd sdist mkdir test - tar --strip-components=1 -zxvf jupyter_server* -C ./test + tar --strip-components=1 -zxvf *.tar.gz -C ./test cd test pip install .[test] - pip install pytest-github-actions-annotate-failures - name: Run Test run: | cd sdist/test