Skip to content

Commit b44ec00

Browse files
committed
test
1 parent fb59ba6 commit b44ec00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3915
-17
lines changed

.github/workflows/e2e_tests.yaml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ on:
44
pull_request:
55
branches:
66
- main
7-
- 'release-*'
7+
- "release-*"
88
paths-ignore:
9-
- 'docs/**'
10-
- '**.adoc'
11-
- '**.md'
12-
- 'LICENSE'
9+
- "docs/**"
10+
- "**.adoc"
11+
- "**.md"
12+
- "LICENSE"
1313
push:
1414
branches:
1515
- main
16-
- 'release-*'
16+
- "release-*"
1717
paths-ignore:
18-
- 'docs/**'
19-
- '**.adoc'
20-
- '**.md'
21-
- 'LICENSE'
18+
- "docs/**"
19+
- "**.adoc"
20+
- "**.md"
21+
- "LICENSE"
2222

2323
concurrency:
2424
group: ${{ github.head_ref }}-${{ github.workflow }}
@@ -29,7 +29,6 @@ env:
2929

3030
jobs:
3131
kubernetes:
32-
3332
runs-on: ubuntu-20.04-4core-gpu
3433

3534
steps:
@@ -41,9 +40,9 @@ jobs:
4140
- name: Checkout common repo code
4241
uses: actions/checkout@v4
4342
with:
44-
repository: 'project-codeflare/codeflare-common'
45-
ref: 'main'
46-
path: 'common'
43+
repository: "project-codeflare/codeflare-common"
44+
ref: "main"
45+
path: "common"
4746

4847
- name: Checkout CodeFlare operator repository
4948
uses: actions/checkout@v4
@@ -54,7 +53,7 @@ jobs:
5453
- name: Set Go
5554
uses: actions/setup-go@v5
5655
with:
57-
go-version-file: './codeflare-operator/go.mod'
56+
go-version-file: "./codeflare-operator/go.mod"
5857
cache-dependency-path: "./codeflare-operator/go.sum"
5958

6059
- name: Set up gotestfmt
@@ -65,8 +64,8 @@ jobs:
6564
- name: Set up specific Python version
6665
uses: actions/setup-python@v5
6766
with:
68-
python-version: '3.9'
69-
cache: 'pip' # caching pip dependencies
67+
python-version: "3.9"
68+
cache: "pip" # caching pip dependencies
7069

7170
- name: Setup NVidia GPU environment for KinD
7271
uses: ./common/github-actions/nvidia-gpu-setup
@@ -126,6 +125,19 @@ jobs:
126125
env:
127126
GRPC_DNS_RESOLVER: "native"
128127

128+
- name: Run ui tests
129+
run: |
130+
export CODEFLARE_TEST_OUTPUT_DIR=${{ env.TEMP_DIR }}
131+
echo "CODEFLARE_TEST_OUTPUT_DIR=${CODEFLARE_TEST_OUTPUT_DIR}" >> $GITHUB_ENV
132+
133+
set -euo pipefail
134+
pip install poetry
135+
poetry install --with test,docs
136+
echo "Running e2e tests..."
137+
poetry run pytest -v -s ./tests/e2e -m 'kind and nvidia_gpu' > ${CODEFLARE_TEST_OUTPUT_DIR}/pytest_output.log 2>&1
138+
env:
139+
GRPC_DNS_RESOLVER: "native"
140+
129141
- name: Switch to kind-cluster context to print logs
130142
if: always() && steps.deploy.outcome == 'success'
131143
run: kubectl config use-context kind-cluster
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: UI notebooks tests
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.head_ref }}-${{ github.workflow }}
7+
cancel-in-progress: true
8+
9+
env:
10+
CODEFLARE_OPERATOR_IMG: "quay.io/project-codeflare/codeflare-operator:dev"
11+
12+
jobs:
13+
verify-0_basic_ray:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Checkout common repo code
23+
uses: actions/checkout@v4
24+
with:
25+
repository: "project-codeflare/codeflare-common"
26+
ref: "main"
27+
path: "common"
28+
29+
- name: Checkout CodeFlare operator repository
30+
uses: actions/checkout@v4
31+
with:
32+
repository: project-codeflare/codeflare-operator
33+
path: codeflare-operator
34+
35+
- name: Set Go
36+
uses: actions/setup-go@v5
37+
with:
38+
go-version-file: "./codeflare-operator/go.mod"
39+
cache-dependency-path: "./codeflare-operator/go.sum"
40+
41+
- name: Set up gotestfmt
42+
uses: gotesttools/gotestfmt-action@v2
43+
with:
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Set up specific Python version
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: "3.9"
50+
cache: "pip" # caching pip dependencies
51+
52+
- name: Setup and start KinD cluster
53+
uses: ./common/github-actions/kind
54+
55+
- name: Deploy CodeFlare stack
56+
id: deploy
57+
run: |
58+
cd codeflare-operator
59+
echo Setting up CodeFlare stack
60+
make setup-e2e
61+
echo Deploying CodeFlare operator
62+
make deploy -e IMG="${CODEFLARE_OPERATOR_IMG}" -e ENV="e2e"
63+
kubectl wait --timeout=120s --for=condition=Available=true deployment -n openshift-operators codeflare-operator-manager
64+
cd ..
65+
66+
- name: Setup Guided notebooks execution
67+
run: |
68+
echo "Installing papermill and dependencies..."
69+
pip install poetry ipython ipykernel jupyterlab
70+
# Disable virtualenv due to problems using packaged in virtualenv in papermill
71+
poetry config virtualenvs.create false
72+
73+
echo "Installing SDK..."
74+
poetry install --with test,docs
75+
76+
- name: Install Yarn dependencies
77+
run: |
78+
poetry run yarn install
79+
poetry run yarn playwright install
80+
working-directory: ui-tests
81+
82+
- name: Run UI notebook tests
83+
run: |
84+
set -euo pipefail
85+
poetry run yarn test
86+
87+
working-directory: ui-tests
88+
89+
- name: Upload Playwright Test assets
90+
if: always()
91+
uses: actions/upload-artifact@v3
92+
with:
93+
name: ipywidgets-test-assets
94+
path: |
95+
ui-tests/test-results
96+
97+
- name: Upload Playwright Test report
98+
if: always()
99+
uses: actions/upload-artifact@v3
100+
with:
101+
name: ipywidgets-test-report
102+
path: |
103+
ui-tests/playwright-report

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ Pipfile.lock
88
build/
99
tls-cluster-namespace
1010
quicktest.yaml
11+
node_modules
12+
.DS_Store
13+
ui-tests/playwright-report
14+
ui-tests/test-results

ui-tests/.yarnrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
disable-self-update-check true
2+
ignore-optional true
3+
network-timeout "300000"
4+
registry "https://registry.npmjs.org/"

ui-tests/jupyter_server_config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from jupyterlab.galata import configure_jupyter_server
2+
3+
configure_jupyter_server(c)
4+
5+
# Uncomment to set server log level to debug level
6+
# c.ServerApp.log_level = "DEBUG"

ui-tests/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "@jupyter-widgets/ui-tests",
3+
"private": true,
4+
"version": "0.1.0",
5+
"description": "ipywidgets UI Tests",
6+
"scripts": {
7+
"start": "jupyter lab --config ./jupyter_server_config.py",
8+
"start:detached": "jlpm start&",
9+
"test": "npx playwright test",
10+
"test:debug": "PWDEBUG=1 npx playwright test",
11+
"test:report": "http-server ./playwright-report -a localhost -o",
12+
"test:update": "npx playwright test --update-snapshots",
13+
"deduplicate": "jlpm && yarn-deduplicate -s fewer --fail"
14+
},
15+
"author": "Project Jupyter",
16+
"license": "BSD-3-Clause",
17+
"devDependencies": {
18+
"@jupyterlab/galata": "^5.0.1",
19+
"@playwright/test": "^1.32.0",
20+
"yarn-deduplicate": "^6.0.1"
21+
}
22+
}

ui-tests/playwright.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const baseConfig = require('@jupyterlab/galata/lib/playwright-config');
2+
3+
module.exports = {
4+
...baseConfig,
5+
timeout: 240000,
6+
webServer: {
7+
command: 'yarn start',
8+
url: 'http://localhost:8888/lab',
9+
timeout: 120 * 1000,
10+
reuseExistingServer: !process.env.CI,
11+
},
12+
retries: 1,
13+
};

0 commit comments

Comments
 (0)