Skip to content

Commit 2128799

Browse files
committed
UI visual regression testing to cover UI widgets visibility
1 parent fb59ba6 commit 2128799

11 files changed

+4245
-1
lines changed
+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: UI notebooks tests
2+
3+
on: [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-20.04-4core
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
70+
poetry config virtualenvs.create false
71+
echo "Installing SDK..."
72+
poetry install --with test,docs
73+
74+
- name: Install Yarn dependencies
75+
run: |
76+
poetry run yarn install
77+
poetry run yarn playwright install chromium
78+
working-directory: ui-tests
79+
80+
- name: Run UI notebook tests
81+
run: |
82+
set -euo pipefail
83+
poetry run yarn test
84+
working-directory: ui-tests
85+
86+
- name: Print CodeFlare operator logs
87+
if: always() && steps.deploy.outcome == 'success'
88+
run: |
89+
echo "Printing CodeFlare operator logs"
90+
kubectl logs -n openshift-operators --tail -1 -l app.kubernetes.io/name=codeflare-operator | tee ${CODEFLARE_TEST_OUTPUT_DIR}/codeflare-operator.log
91+
92+
- name: Print KubeRay operator logs
93+
if: always() && steps.deploy.outcome == 'success'
94+
run: |
95+
echo "Printing KubeRay operator logs"
96+
kubectl logs -n ray-system --tail -1 -l app.kubernetes.io/name=kuberay | tee ${CODEFLARE_TEST_OUTPUT_DIR}/kuberay.log
97+
98+
- name: Upload Playwright Test assets
99+
if: always()
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: ipywidgets-test-assets
103+
path: |
104+
ui-tests/test-results
105+
106+
- name: Upload Playwright Test report
107+
if: always()
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: ipywidgets-test-report
111+
path: |
112+
ui-tests/playwright-report

.gitignore

+4
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

0 commit comments

Comments
 (0)