Skip to content

Commit 67f369b

Browse files
committed
gh-actions: Extend action to run Frontend Unit tests
Extend Frontend Test action to run also KWA frontend unit tests. Signed-off-by: Orfeas Kourkakis <[email protected]>
1 parent 68ecb1c commit 67f369b

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/workflows/test-node.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,45 @@ jobs:
1414
uses: actions/checkout@v3
1515

1616
- name: Setup Node
17-
uses: actions/setup-node@v2
17+
uses: actions/setup-node@v3
1818
with:
1919
node-version: 12.18.1
2020

2121
- name: Run Node test
2222
run: |
2323
npm install prettier --prefix ./pkg/new-ui/v1beta1/frontend
2424
make prettier-check
25+
26+
frontend-unit-tests:
27+
name: Frontend Unit Tests
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Check out code
32+
uses: actions/checkout@v3
33+
34+
- name: Setup Node
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: 12.18.1
38+
39+
- name: Fetch Kubeflow and install common code dependencies
40+
run: |
41+
cd /tmp && git clone https://github.com/kubeflow/kubeflow.git
42+
cd kubeflow
43+
git checkout c4ca7a9
44+
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
45+
npm i
46+
npm run build
47+
npm link ./dist/kubeflow
48+
49+
- name: Install KWA dependencies
50+
run: |
51+
cd pkg/new-ui/v1beta1/frontend
52+
npm i
53+
npm link kubeflow
54+
55+
- name: Run unit tests
56+
run: |
57+
cd pkg/new-ui/v1beta1/frontend
58+
npm run test:prod

pkg/new-ui/v1beta1/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"build:prod": "npm run copyLibAssets && ng build --base-href /katib/ --deploy-url /katib/static/ --outputPath dist/static --configuration production",
99
"copyLibAssets": "cp -r ./node_modules/kubeflow/assets/* ./src/assets/",
1010
"test": "ng test",
11+
"test:prod": "ng test --browsers=ChromeHeadless --watch=false",
1112
"lint": "ng lint",
1213
"format:check": "prettier --check 'src/**/*.{jsx,js,ts,html,scss,css}' || node scripts/check-format-error.js",
1314
"format:write": "prettier --write 'src/**/*.{jsx,js,ts,html,scss,css}'",

0 commit comments

Comments
 (0)