Skip to content

Commit 6851bc6

Browse files
committed
Add test setup
1 parent df08b78 commit 6851bc6

File tree

11 files changed

+4327
-7
lines changed

11 files changed

+4327
-7
lines changed

.dockerignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules
2+
npm-debug.log
3+
.git
4+
.gitignore
5+
.env
6+
.env.local
7+
.env.development.local
8+
.env.test.local
9+
.env.production.local
10+
.DS_Store
11+
*.pem
12+
.next
13+
out
14+
build
15+
dist
16+
coverage
17+
.vscode
18+
.idea
19+
*.log
20+
*.swp
21+
*~

.github/workflows/build.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
- name: Build docker image
13-
run: docker build -t jupyterlab-meta:latest .
13+
run: |
14+
npm install
15+
npm run build
16+
- name: Run test
17+
run: |
18+
npm run test
19+
- name: Upload Playwright Test report
20+
id: upload-galata-artifact
21+
if: always()
22+
uses: actions/upload-artifact@v4
23+
with:
24+
name: playwright-tests
25+
path: |
26+
./test-results
27+
./playwright-report

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,6 @@ dist
128128
.yarn/build-state.yml
129129
.yarn/install-state.gz
130130
.pnp.*
131+
132+
playwright-report
133+
test-results

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@ FROM mambaorg/micromamba:2.0.5
22

33
COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yaml /tmp/environment.yaml
44
RUN micromamba install -y -n base -f /tmp/environment.yaml && \
5-
micromamba clean --all --yes
5+
micromamba clean --all --yes
6+
7+
WORKDIR /home/$MAMBA_USER/app
8+
9+
COPY --chown=$MAMBA_USER:$MAMBA_USER ./jupyter_server_test_config.py /home/$MAMBA_USER/app
10+
RUN mkdir -p notebooks
11+
12+
ENTRYPOINT [ "/usr/local/bin/_entrypoint.sh", "jupyter", "lab", "--config", "jupyter_server_test_config.py" ]

environment.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ channels:
33
- conda-forge
44
dependencies:
55
- python=3.12
6-
- jupyterlab=4.3.0
6+
- git
7+
- jupyterlab=4.3.5
78
- papermill=2.6.0
89
- voila=0.5.8
910
- nb_conda_kernels=2.5.1
@@ -13,4 +14,7 @@ dependencies:
1314
- jupyterlab_code_formatter=3.0.2
1415
- python-lsp-server=1.12.2
1516
- ruff=0.9.10
16-
- ipydatagrid=1.4.0
17+
- ipydatagrid=1.4.0
18+
- ipympl=0.9.6
19+
- jupytext=1.16.7
20+
- jupyterlab-git=0.51.0

jupyter_server_test_config.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Server configuration for integration tests.
2+
3+
!! Never use this configuration in production because it
4+
opens the server to the world and provide access to JupyterLab
5+
JavaScript objects through the global window variable.
6+
"""
7+
8+
from jupyterlab.galata import configure_jupyter_server
9+
10+
configure_jupyter_server(c) # noqa F821
11+
# Uncomment to set server log level to debug level
12+
c.ServerApp.ip = "*"
13+
c.ServerApp.root_dir = "/home/mambauser/app/notebooks"

notebooks/test.ipynb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {
7+
"vscode": {
8+
"languageId": "plaintext"
9+
}
10+
},
11+
"outputs": [],
12+
"source": []
13+
}
14+
],
15+
"metadata": {
16+
"language_info": {
17+
"name": "python"
18+
}
19+
},
20+
"nbformat": 4,
21+
"nbformat_minor": 2
22+
}

0 commit comments

Comments
 (0)