-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1019 from MLH-Fellowship/feat/integration-testing
Add Integration Tests
- Loading branch information
Showing
18 changed files
with
1,751 additions
and
82 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ dist | |
coverage | ||
**/*.d.ts | ||
tests | ||
ui-tests |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,3 +135,7 @@ dmypy.json | |
*.swp | ||
|
||
src/version.ts | ||
|
||
# Integration tests | ||
ui-tests/node_modules/ | ||
ui-tests/test-results/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin luctus nec arcu quis accumsan. Vivamus facilisis egestas commodo. | ||
Aenean mollis sodales auctor. Vestibulum fermentum feugiat dui efficitur porttitor. Maecenas id lectus velit. Phasellus vel | ||
quam faucibus, tristique velit vitae, laoreet dui. Vivamus id eros finibus, dictum risus eu, placerat lectus. Suspendisse | ||
potenti. Proin fermentum, magna sed finibus rutrum, felis enim sollicitudin felis, at condimentum urna elit vel velit. Class | ||
aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec et massa sed dolor ornare suscipit. | ||
Vivamus hendrerit turpis ligula, blandit tincidunt metus volutpat eu. Nulla tellus ligula, tempus et purus dapibus, molestie | ||
blandit ex. Donec convallis magna magna, eu iaculis ex venenatis in. Nam at convallis dolor. Aliquam erat volutpat. | ||
|
||
Fusce varius lectus vitae tellus mollis ultrices. Ut id gravida ipsum. Vivamus eleifend felis in aliquet pellentesque. Nullam | ||
vitae placerat lacus. Proin accumsan, massa eget mollis convallis, justo augue dapibus leo, at luctus velit elit nec ipsum. Ut | ||
eros nisi, iaculis in lorem vel, fermentum hendrerit magna. Orci varius natoque penatibus et magnis dis parturient montes, | ||
nascetur ridiculus mus. Etiam non faucibus eros. Aenean nisl massa, facilisis ac quam in, elementum consectetur risus. Maecenas | ||
sagittis rhoncus orci at egestas. | ||
|
||
Vivamus nec odio ac libero porttitor mattis. Morbi ac tincidunt velit, a aliquet ipsum. Etiam a aliquet massa. In dapibus, | ||
ex malesuada aliquam dictum, enim ante suscipit est, in tempus tortor felis sed nunc. Vestibulum ante ipsum primis in faucibus | ||
orci luctus et ultrices posuere cubilia curae; Phasellus sodales sit amet justo gravida sagittis. Pellentesque habitant morbi | ||
tristique senectus et netus et malesuada fames ac turpis egestas. Ut vulputate facilisis felis, ac scelerisque tortor | ||
condimentum sed. Nulla ut consequat risus. Aenean volutpat facilisis luctus. Phasellus at egestas sapien, in blandit dolor. | ||
Vestibulum commodo ligula ut orci rhoncus, eu cursus diam luctus. Pellentesque at accumsan tortor, non tempor nunc. Phasellus | ||
ultricies consequat libero, quis tempus mauris auctor quis. Fusce bibendum augue sed augue sollicitudin, eu volutpat turpis | ||
vestibulum. Proin auctor aliquam nisi a dapibus. | ||
|
||
Nam eget finibus elit. Cras in sapien ante. Curabitur facilisis interdum ligula, ut molestie orci molestie sit amet. Etiam | ||
euismod rhoncus velit, sit amet tempor magna egestas quis. In sed nunc porta, tincidunt risus ornare, elementum lorem. Class | ||
aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed quis velit ac leo eleifend efficitur | ||
at id velit. In et ante tempus, sollicitudin dui at, euismod est. Aenean eleifend scelerisque turpis, id egestas turpis dictum | ||
nec. | ||
|
||
Praesent luctus, neque et egestas hendrerit, lorem sapien varius lacus, sit amet tincidunt nisi orci quis lacus. Pellentesque | ||
suscipit accumsan mi vel convallis. Fusce ullamcorper scelerisque augue id sollicitudin. Curabitur tempus nec diam in | ||
pellentesque. Maecenas suscipit ex id facilisis posuere. Proin rutrum blandit leo. Donec bibendum velit vel ipsum mattis rutrum. | ||
Nulla eu enim vel neque ultricies hendrerit eget sed turpis. Mauris efficitur lectus id mi sollicitudin, ultricies tempor | ||
tellus molestie. Phasellus mollis odio risus, ut fringilla tellus eleifend ac. Interdum et malesuada fames ac ante ipsum | ||
primis in faucibus. Nulla eu neque consequat sem aliquam semper quis eget arcu. |
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 file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Test | ||
|
||
The test will produce a video to help debugging and check what happened. | ||
|
||
To execute integration tests, you have two options: | ||
|
||
- use docker-compose (cons: needs to know and use docker) - this is a more reliable solution. | ||
- run tests locally (cons: will interact with your JupyterLab user settings) | ||
|
||
## Test on docker | ||
|
||
1. Compile the extension: | ||
|
||
``` | ||
jlpm install | ||
``` | ||
|
||
2. Execute the docker stack in the ui-tests folder: | ||
|
||
``` | ||
docker-compose -f ./docker/docker-compose.yml build --no-cache | ||
docker-compose -f ./docker/docker-compose.yml run --rm e2e | ||
docker-compose -f ./docker/docker-compose.yml down | ||
``` | ||
|
||
## Test locally | ||
|
||
1. Compile the extension: | ||
|
||
``` | ||
jlpm install | ||
jlpm run build:prod | ||
``` | ||
|
||
2. Start JupyterLab _with the extension installed_ without any token or password | ||
|
||
``` | ||
jupyter lab --ServerApp.token= --ServerApp.password= | ||
``` | ||
|
||
3. Execute in another console the [Playwright](https://playwright.dev/docs/intro) tests: | ||
|
||
``` | ||
cd ui-tests | ||
jlpm install | ||
npx playwright install | ||
npx playwright test | ||
``` | ||
|
||
# Create tests | ||
|
||
To create tests, the easiest way is to use the code generator tool of playwright: | ||
|
||
1. Compile the extension: | ||
|
||
``` | ||
jlpm install | ||
jlpm run build:prod | ||
``` | ||
|
||
2. Start JupyterLab _with the extension installed_ without any token or password: | ||
|
||
**Using docker** | ||
|
||
``` | ||
docker-compose -f ./docker/docker-compose.yml run --rm -p 8888:8888 lab | ||
``` | ||
|
||
**Using local installation** | ||
|
||
``` | ||
jupyter lab --ServerApp.token= --ServerApp.password= | ||
``` | ||
|
||
3. Launch the code generator tool: | ||
|
||
``` | ||
cd ui-tests | ||
jlpm install | ||
npx playwright install | ||
npx playwright codegen localhost:8888 | ||
``` | ||
|
||
# Debug tests | ||
|
||
To debug tests, a good way is to use the inspector tool of playwright: | ||
|
||
1. Compile the extension: | ||
|
||
``` | ||
jlpm install | ||
jlpm run build:prod | ||
``` | ||
|
||
2. Start JupyterLab _with the extension installed_ without any token or password: | ||
|
||
**Using docker** | ||
|
||
``` | ||
docker-compose -f ./docker/docker-compose.yml run --rm -p 8888:8888 lab | ||
``` | ||
|
||
**Using local installation** | ||
|
||
``` | ||
jupyter lab --ServerApp.token= --ServerApp.password= | ||
``` | ||
|
||
3. Launch the debug tool: | ||
|
||
``` | ||
cd ui-tests | ||
jlpm install | ||
npx playwright install | ||
PWDEBUG=1 npx playwright test | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Use base jupyter image that comes with jupyterlab | ||
FROM jupyter/base-notebook | ||
|
||
USER root | ||
|
||
# Upgrade JupyterLab | ||
RUN mamba install -c conda-forge -y git jupyterlab nbdime | ||
|
||
# Copy and unarchive merge conflict example repo | ||
# Cannot use symlinks, need another examples folder just for ui-tests | ||
ADD --chown=1000:1000 data/merge-conflict-example.tar.gz /home/jovyan/work | ||
|
||
USER 1000 |
Binary file not shown.
Oops, something went wrong.