Skip to content

Commit 3525185

Browse files
committed
Updated workflow files and the test prototyper.
1 parent d3bcdc2 commit 3525185

File tree

8 files changed

+367
-19
lines changed

8 files changed

+367
-19
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["master"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
jobs:
9+
check_release:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
group: [check_release, link_check]
14+
fail-fast: false
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Install Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.9
22+
architecture: "x64"
23+
- name: Get pip cache dir
24+
id: pip-cache
25+
run: |
26+
echo "::set-output name=dir::$(pip cache dir)"
27+
- name: Cache pip
28+
uses: actions/cache@v2
29+
with:
30+
path: ${{ steps.pip-cache.outputs.dir }}
31+
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-
34+
${{ runner.os }}-pip-
35+
- name: Cache checked links
36+
if: ${{ matrix.group == 'link_check' }}
37+
uses: actions/cache@v2
38+
with:
39+
path: ~/.cache/pytest-link-check
40+
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md', '**/*.rst') }}-md-links
41+
restore-keys: |
42+
${{ runner.os }}-linkcheck-
43+
- name: Upgrade packaging dependencies
44+
run: |
45+
pip install --upgrade pip setuptools wheel --user
46+
- name: Install Dependencies
47+
run: |
48+
pip install -e .
49+
- name: Check Release
50+
if: ${{ matrix.group == 'check_release' }}
51+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
52+
with:
53+
version_spec: 100.100.100
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
- name: Run Link Check
56+
if: ${{ matrix.group == 'link_check' }}
57+
uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1

.github/workflows/docs.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Docs Tests
2+
on:
3+
push:
4+
branches: '*'
5+
pull_request:
6+
branches: '*'
7+
jobs:
8+
build:
9+
runs-on: ${{ matrix.os }}-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [ubuntu]
14+
python-version: [ '3.7' ]
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v1
18+
- name: Install Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
architecture: 'x64'
23+
- name: Upgrade packaging dependencies
24+
run: |
25+
pip install --upgrade pip setuptools wheel
26+
- name: Get pip cache dir
27+
id: pip-cache
28+
run: |
29+
echo "::set-output name=dir::$(pip cache dir)"
30+
- name: Cache pip
31+
uses: actions/cache@v1
32+
with:
33+
path: ${{ steps.pip-cache.outputs.dir }}
34+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
35+
restore-keys: |
36+
${{ runner.os }}-pip-${{ matrix.python-version }}-
37+
${{ runner.os }}-pip-
38+
- name: Install the Python dependencies
39+
run: |
40+
pip install -e .[test] codecov
41+
pip install -r docs/doc-requirements.txt
42+
wget https://github.com/jgm/pandoc/releases/download/1.19.1/pandoc-1.19.1-1-amd64.deb && sudo dpkg -i pandoc-1.19.1-1-amd64.deb
43+
- name: List installed packages
44+
run: |
45+
pip freeze
46+
pip check
47+
- name: Run tests on documentation
48+
run: |
49+
EXIT_STATUS=0
50+
make -C docs/ html || EXIT_STATUS=$?
51+
cd docs/source && pytest --nbval --current-env .. || EXIT_STATUS=$?
52+
exit $EXIT_STATUS

.github/workflows/downstream.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test Downstream
2+
3+
on:
4+
push:
5+
branches: "*"
6+
pull_request:
7+
branches: "*"
8+
9+
jobs:
10+
downstream:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Base Setup
19+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
20+
21+
- name: Test jupyterlab_server
22+
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
23+
with:
24+
package_name: jupyterlab_server
25+
26+
- name: Test jupyterlab
27+
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
28+
with:
29+
package_name: jupyterlab
30+
package_spec: "\".[test]\""
31+
test_command: "python -m jupyterlab.browser_check --no-browser-test"
32+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Enforce PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, edited, synchronize]
6+
jobs:
7+
enforce-label:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: enforce-triage-label
11+
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1

.github/workflows/js.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Linux JS Tests
2+
3+
on:
4+
push:
5+
branches: '*'
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu, macos]
16+
group: [notebook, base, services]
17+
exclude:
18+
- group: services
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- name: Set up Python
23+
uses: actions/setup-python@v1
24+
with:
25+
python-version: 3.8
26+
- name: Set up Node
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: '12.x'
30+
31+
- name: Cache node modules
32+
uses: actions/cache@v2
33+
env:
34+
cache-name: cache-node-modules
35+
with:
36+
# npm cache files are stored in `~/.npm` on Linux/macOS
37+
path: ~/.npm
38+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
39+
restore-keys: |
40+
${{ runner.os }}-build-${{ env.cache-name }}-
41+
${{ runner.os }}-build-
42+
${{ runner.os }}-
43+
44+
- name: Cache pip on Linux
45+
uses: actions/cache@v1
46+
if: startsWith(runner.os, 'Linux')
47+
with:
48+
path: ~/.cache/pip
49+
key: ${{ runner.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/requirements.txt', 'setup.py') }}
50+
restore-keys: |
51+
${{ runner.os }}-pip-${{ matrix.python }}
52+
53+
- name: Temporary workaround for sanitizer loading in JS Tests
54+
run: |
55+
cp tools/security_deprecated.js nbclassic/static/base/js/security.js
56+
57+
- name: Install dependencies
58+
run: |
59+
pip install --upgrade pip
60+
pip install --upgrade setuptools wheel
61+
npm install
62+
63+
pip install .[test]
64+
65+
- name: Run Tests
66+
run: |
67+
python -m nbclassic.jstest ${{ matrix.group }}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Testing nbclassic
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu, macos, windows]
16+
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.8"]
17+
exclude:
18+
- os: windows
19+
python-version: pypy-3.8
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
- name: Base Setup
24+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
25+
- name: Install pip dependencies
26+
run: |
27+
pip install -v -e ".[test]" pytest-cov
28+
- name: Check pip environment
29+
run: |
30+
pip freeze
31+
pip check
32+
- name: Run the help command
33+
run: |
34+
jupyter nbclassic -h
35+
- name: Test with pytest and coverage
36+
if: ${{ matrix.python-version != 'pypy-3.8' }}
37+
run: |
38+
python -m pytest -vv --cov=nbclassic --cov-report term-missing:skip-covered || python -m pytest -vv --cov=nbclassic --cov-report term-missing:skip-covered
39+
- name: Run the tests on pypy
40+
if: ${{ matrix.python-version == 'pypy-3.8' }}
41+
run: |
42+
python -m pytest -vv || python -m pytest -vv -lf
43+
- name: Test Running Server
44+
if: startsWith(runner.os, 'Linux')
45+
run: |
46+
jupyter nbclassic --no-browser &
47+
TASK_PID=$!
48+
# Make sure the task is running
49+
ps -p $TASK_PID || exit 1
50+
sleep 5
51+
kill $TASK_PID
52+
wait $TASK_PID
53+
54+
# test_miniumum_versions:
55+
# name: Test Minimum Versions
56+
# timeout-minutes: 20
57+
# runs-on: ubuntu-latest
58+
# steps:
59+
# - uses: actions/checkout@v2
60+
# - name: Base Setup
61+
# uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
62+
# with:
63+
# python_version: "3.7"
64+
# - name: Install miniumum versions
65+
# uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
66+
# - name: Run the unit tests
67+
# run: pytest -vv || pytest -vv --lf
68+
69+
test_prereleases:
70+
name: Test Prereleases
71+
runs-on: ubuntu-latest
72+
timeout-minutes: 20
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v2
76+
- name: Base Setup
77+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
78+
- name: Install the Python dependencies
79+
run: |
80+
pip install --pre -e ".[test]"
81+
- name: List installed packages
82+
run: |
83+
pip freeze
84+
pip check
85+
- name: Run the tests
86+
run: |
87+
pytest -vv || pytest -vv --lf
88+
89+
make_sdist:
90+
name: Make SDist
91+
runs-on: ubuntu-latest
92+
timeout-minutes: 20
93+
steps:
94+
- uses: actions/checkout@v2
95+
- name: Base Setup
96+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
97+
- name: Build SDist
98+
run: |
99+
pip install build
100+
python -m build --sdist
101+
- uses: actions/upload-artifact@v2
102+
with:
103+
name: "sdist"
104+
path: dist/*.tar.gz
105+
106+
test_sdist:
107+
runs-on: ubuntu-latest
108+
needs: [make_sdist]
109+
name: Install from SDist and Test
110+
timeout-minutes: 20
111+
steps:
112+
- name: Base Setup
113+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
114+
- name: Download sdist
115+
uses: actions/download-artifact@v2
116+
- name: Install From SDist
117+
run: |
118+
set -ex
119+
cd sdist
120+
mkdir test
121+
tar --strip-components=1 -zxvf *.tar.gz -C ./test
122+
cd test
123+
pip install -e .[test]
124+
pip install pytest-github-actions-annotate-failures
125+
- name: Run Test
126+
run: |
127+
cd sdist/test
128+
pytest -vv || pytest -vv --lf

nbclassic/tests/end_to_end/manual_test_prototyper.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@
1111
from .utils import TREE_PAGE, EDITOR_PAGE
1212

1313

14-
def test_do_something(notebook_frontend):
15-
# Do something with the notebook_frontend here
16-
notebook_frontend.add_cell()
17-
notebook_frontend.add_cell()
18-
assert len(notebook_frontend.cells) == 3
19-
20-
notebook_frontend.delete_all_cells()
21-
assert len(notebook_frontend.cells) == 1
22-
23-
notebook_frontend.editor_page.pause()
24-
cell_texts = ['aa = 1', 'bb = 2', 'cc = 3']
25-
a, b, c = cell_texts
26-
notebook_frontend.populate(cell_texts)
27-
assert notebook_frontend.get_cells_contents() == [a, b, c]
28-
notebook_frontend._pause()
14+
# # Use/uncomment this for manual test prototytping
15+
# # (the test suite will run this if it's uncommented)
16+
# def test_do_something(notebook_frontend):
17+
# # Do something with the notebook_frontend here
18+
# notebook_frontend.add_cell()
19+
# notebook_frontend.add_cell()
20+
# assert len(notebook_frontend.cells) == 3
21+
#
22+
# notebook_frontend.delete_all_cells()
23+
# assert len(notebook_frontend.cells) == 1
24+
#
25+
# notebook_frontend.editor_page.pause()
26+
# cell_texts = ['aa = 1', 'bb = 2', 'cc = 3']
27+
# a, b, c = cell_texts
28+
# notebook_frontend.populate(cell_texts)
29+
# assert notebook_frontend.get_cells_contents() == [a, b, c]
30+
# notebook_frontend._pause()

0 commit comments

Comments
 (0)