Skip to content

Commit aaf5ea0

Browse files
committed
Fix nbextension installation and add E2E tests
1 parent 37b11f1 commit aaf5ea0

File tree

6 files changed

+471
-1
lines changed

6 files changed

+471
-1
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
lib/
22
node_modules/
3+
components/lib/
4+
components/node_modules/
5+
nbextension/lib/
6+
nbextension/node_modules/
7+
nbextension/diff_match_patch.js
38
lc_notebook_diff/labextension/
9+
lc_notebook_diff/nbextension/diff_match_patch.js
10+
lc_notebook_diff/nbextension/jupyter-notebook-diff.js
11+
lc_notebook_diff/nbextension/jupyter-notebook-diff.js.map
412
*.tsbuildinfo
513
ui-tests/test-results/
614
ui-tests/playwright-report/

.github/workflows/e2e-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
E2E_DEFAULT_DELAY: '200'
7373
JUPYTERLAB_URL: 'http://localhost:8888/lab?token=test-token'
7474
NOTEBOOK7_URL: 'http://localhost:8888/tree?token=test-token'
75+
NBCLASSIC_URL: 'http://localhost:8888/nbclassic/tree?token=test-token'
7576
JUPYTER_WORK_DIR: ${{ github.workspace }}/ui-tests/e2e-notebook/artifacts/jupyter-work
7677
run: |
7778
set -euxo pipefail

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ ENV PATH=/.npm/bin/:${PATH}
1515
RUN pip install --no-cache jupyter_nbextensions_configurator
1616

1717
COPY . /tmp/notebook_diff
18-
RUN pip install --no-cache /tmp/notebook_diff
18+
RUN cd /tmp/notebook_diff/components && npm install && npm run build && \
19+
cd /tmp/notebook_diff/nbextension && npm install && npm run build && \
20+
pip install --no-cache /tmp/notebook_diff
1921

2022
RUN jupyter labextension enable lc_notebook_diff
2123

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ exclude = [".github", "binder"]
4747
[tool.hatch.build.targets.wheel.shared-data]
4848
"lc_notebook_diff/labextension" = "share/jupyter/labextensions/lc_notebook_diff"
4949
"install.json" = "share/jupyter/labextensions/lc_notebook_diff/install.json"
50+
"lc_notebook_diff/nbextension" = "share/jupyter/nbextensions/notebook_diff"
5051

5152
[tool.hatch.build.hooks.version]
5253
path = "lc_notebook_diff/_version.py"

ui-tests/e2e-notebook/notebooks/03_Basic_Notebook_Diff_Test_NBClassic.ipynb

Lines changed: 454 additions & 0 deletions
Large diffs are not rendered by default.

ui-tests/e2e-notebook/run_notebooks.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ def main() -> int:
8888
if notebook7_url:
8989
parameters["notebook7_url"] = notebook7_url
9090

91+
nbclassic_url = os.getenv("NBCLASSIC_URL")
92+
if nbclassic_url:
93+
parameters["nbclassic_url"] = nbclassic_url
94+
9195
jupyter_work_dir = os.getenv("JUPYTER_WORK_DIR")
9296
if jupyter_work_dir:
9397
parameters["jupyter_work_dir"] = jupyter_work_dir

0 commit comments

Comments
 (0)