-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Jest, Playwright and pytest tests #207
Merged
Merged
Changes from 50 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
8688979
Add jest and playwright testing
fcollonval e61eebc
Fix working directory
fcollonval 7cf1ecc
Use Jest 26
fcollonval 9796df4
Don't lint tests files
fcollonval f294cbd
Fix manifest
fcollonval 135f598
Add update snapshots action
fcollonval 71dd282
Add documentation
fcollonval 2e7a683
Add pytest
fcollonval e0a9907
Fix cookiecutter
fcollonval 7d87d2f
Print log and stop jupyter lab
fcollonval 86871cd
First install jupyter lab
fcollonval b2c2221
partial revert to test stuck CI task
fcollonval eee23be
Fix pytest
fcollonval fe03c32
Ensure server log redirection
fcollonval df4af43
Move ui tests config in subfolder
fcollonval 4514ab3
Add documentation for pytest
fcollonval 2bb2088
Run integration tests in post job using distribution artifact
fcollonval 0012738
Apply review suggestions
fcollonval 38fbe46
Update check test
fcollonval 145662c
[skip ci] Update documentation
fcollonval f9a1fe8
Remove galata and playwright from main package.json
fcollonval 94000be
Merge branch '3.0' into fix/Add-testing
fcollonval c1593ee
Update galata
fcollonval 70adf00
Add jest and playwright testing
fcollonval 26c7284
Fix working directory
fcollonval 976d6b4
Use Jest 26
fcollonval 8b0cd6e
Don't lint tests files
fcollonval ad4838e
Fix manifest
fcollonval f36e3e2
Add update snapshots action
fcollonval b504266
Add documentation
fcollonval 3b6c6bb
Add pytest
fcollonval 79e527e
Fix cookiecutter
fcollonval 37fd2c2
Print log and stop jupyter lab
fcollonval d4b941b
First install jupyter lab
fcollonval 6a01635
partial revert to test stuck CI task
fcollonval 5aa176b
Fix pytest
fcollonval 0a8f3ab
Ensure server log redirection
fcollonval 74c1d9c
Move ui tests config in subfolder
fcollonval b29009f
Add documentation for pytest
fcollonval 9ff452d
Run integration tests in post job using distribution artifact
fcollonval 07c0902
Apply review suggestions
fcollonval 5190921
Update check test
fcollonval 672041f
[skip ci] Update documentation
fcollonval c2bf000
Remove galata and playwright from main package.json
fcollonval 9e1ee79
Update galata
fcollonval bc386fb
Fixed rebase
3coins b869015
Merge branch 'fix/Add-testing' into 3coins-add-testing
fcollonval 8d1fb7f
Update add testing
fcollonval 061054a
Fix prettier
fcollonval 51320d2
Fix mac job
fcollonval 27805cf
Apply suggestions
fcollonval bac5026
Add configurable for setting up the tests
fcollonval 6cdfdcf
Fix syntax
fcollonval d71c65b
Fix for new cookiecutter
fcollonval 4b8717e
Minor fixes
fcollonval 40df2a2
Conditioned type jest
fcollonval File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Tests validation | ||
|
||
on: | ||
push: | ||
branches: ["*.0"] | ||
pull_request: | ||
branches: ["*"] | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Install dependencies | ||
run: python -m pip install -U cookiecutter check-manifest jupyterlab~=3.1 | ||
|
||
- name: Create the extension | ||
run: | | ||
set -eux | ||
# Trick to use custom parameters | ||
python -m cookiecutter --no-input . | ||
|
||
- name: Test the extension | ||
working-directory: myextension | ||
run: | | ||
set -eux | ||
jlpm | ||
jlpm test | ||
|
||
- name: Install the extension | ||
working-directory: myextension | ||
run: | | ||
set -eux | ||
python -m pip install . | ||
|
||
- name: Install dependencies | ||
working-directory: myextension/ui-tests | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
run: jlpm install | ||
|
||
- name: Set up browser cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ github.workspace }}/pw-browsers | ||
key: ${{ runner.os }}-${{ hashFiles('myextension/ui-tests/yarn.lock') }} | ||
|
||
- name: Install browser | ||
run: jlpm playwright install chromium | ||
working-directory: myextension/ui-tests | ||
|
||
- name: Execute integration tests | ||
working-directory: myextension/ui-tests | ||
run: | | ||
jlpm playwright test | ||
|
||
- name: Upload Playwright Test report | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: myextension-playwright-tests | ||
path: | | ||
myextension/ui-tests/test-results | ||
myextension/ui-tests/playwright-report |
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
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,6 @@ dist | |
coverage | ||
**/*.d.ts | ||
tests | ||
|
||
**/__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
44 changes: 44 additions & 0 deletions
44
{{cookiecutter.python_name}}/.github/workflows/update-integration-tests.yml
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,44 @@ | ||
name: Update Playwright Snapshots | ||
|
||
on: | ||
issue_comment: | ||
types: [created, edited] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
{# Escape double curly brace #} | ||
{% raw %} | ||
update-snapshots: | ||
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please update playwright snapshots') }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Configure git to use https | ||
run: git config --global hub.protocol https | ||
|
||
- name: Checkout the branch from the PR that triggered the job | ||
run: hub pr checkout ${{ github.event.issue.number }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
set -eux | ||
jlpm | ||
python -m pip install . | ||
|
||
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# Playwright knows how to start JupyterLab server | ||
start_server_script: 'null' | ||
test_folder: ui-tests | ||
{% endraw %} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while ubuntu is a nice, predictable, well-behaved platform, windows is frankly where, from an overall integration testing perspective, one is most likely to get real data and catch evil things.
other fun things to find extremely predictable bugs:
c:
-drive installs/
base url