Skip to content

Commit 5fae1d4

Browse files
committed
fix: resolve errors in e2e tests for cypress
Signed-off-by: tariq-hasan <[email protected]>
1 parent 0b4e7c1 commit 5fae1d4

File tree

9 files changed

+25849
-10853
lines changed

9 files changed

+25849
-10853
lines changed

.github/workflows/test-node.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Node
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: 12.18.1
24+
node-version: 16.20.2
2525

2626
- name: Format katib code
2727
run: |
@@ -44,12 +44,12 @@ jobs:
4444
- name: Setup Node
4545
uses: actions/setup-node@v4
4646
with:
47-
node-version: 12.18.1
47+
node-version: 16.20.2
4848

4949
- name: Fetch Kubeflow and install common code dependencies
5050
run: |
5151
COMMIT=$(cat pkg/ui/v1beta1/frontend/COMMIT)
52-
cd /tmp && git clone https://github.com/kubeflow/kubeflow.git
52+
cd /tmp && git clone https://github.com/tariq-hasan/kubeflow.git
5353
cd kubeflow
5454
git checkout $COMMIT
5555
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
@@ -74,15 +74,15 @@ jobs:
7474
steps:
7575
- name: Checkout
7676
uses: actions/checkout@v4
77-
- name: Setup node version to 12
77+
- name: Setup node version to 16
7878
uses: actions/setup-node@v4
7979
with:
80-
node-version: 12
80+
node-version: 16
8181

8282
- name: Fetch Kubeflow and install common code dependencies
8383
run: |
8484
COMMIT=$(cat pkg/ui/v1beta1/frontend/COMMIT)
85-
cd /tmp && git clone https://github.com/kubeflow/kubeflow.git
85+
cd /tmp && git clone https://github.com/tariq-hasan/kubeflow.git
8686
cd kubeflow
8787
git checkout $COMMIT
8888
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
@@ -97,5 +97,4 @@ jobs:
9797
- name: Serve UI & run Cypress tests in Chrome and Firefox
9898
run: |
9999
cd pkg/ui/v1beta1/frontend
100-
npm run start & npx wait-on http://localhost:4200
101-
npm run ui-test-ci-all
100+
npm run start & npx wait-on http://localhost:4200 && npm run ui-test-ci-all

cmd/ui/v1beta1/Dockerfile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,41 @@ RUN apt-get update && apt-get install git -y
55

66
WORKDIR /kf
77
COPY ./pkg/ui/v1beta1/frontend/COMMIT ./
8-
RUN git clone https://github.com/kubeflow/kubeflow.git && \
8+
RUN git clone https://github.com/tariq-hasan/kubeflow.git && \
99
COMMIT=$(cat ./COMMIT) && \
1010
cd kubeflow && \
1111
git checkout $COMMIT
1212

1313
# --- Build the frontend kubeflow library ---
14-
FROM node:12 AS frontend-kubeflow-lib
14+
FROM node:16 AS frontend-kubeflow-lib
1515

1616
WORKDIR /src
1717

1818
ARG LIB=/kf/kubeflow/components/crud-web-apps/common/frontend/kubeflow-common-lib
1919
COPY --from=fetch-kubeflow-kubeflow $LIB/package*.json ./
20-
RUN npm ci
20+
RUN npm config set fetch-retry-mintimeout 200000 && \
21+
npm config set fetch-retry-maxtimeout 1200000 && \
22+
npm config get registry && \
23+
npm config set registry https://registry.npmjs.org/ && \
24+
npm config get https-proxy && \
25+
npm config rm https-proxy && \
26+
npm ci
2127

2228
COPY --from=fetch-kubeflow-kubeflow $LIB/ ./
2329
RUN npm run build
2430

2531
# --- Build the frontend ---
26-
FROM node:12 AS frontend
32+
FROM node:16 AS frontend
2733

2834
WORKDIR /src
2935
COPY ./pkg/ui/v1beta1/frontend/package*.json ./
30-
RUN npm ci
36+
RUN npm config set fetch-retry-mintimeout 20000 && \
37+
npm config set fetch-retry-maxtimeout 120000 && \
38+
npm config get registry && \
39+
npm config set registry https://registry.npmjs.org/ && \
40+
npm config get https-proxy && \
41+
npm config rm https-proxy && \
42+
npm ci
3143

3244
COPY ./pkg/ui/v1beta1/frontend/ .
3345
COPY --from=frontend-kubeflow-lib /src/dist/kubeflow/ ./node_modules/kubeflow/

pkg/ui/v1beta1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To make changes to the UI you need to install:
1919

2020
- Tools, defined [here](https://github.com/kubeflow/katib/blob/master/docs/developer-guide.md#requirements).
2121

22-
- `node` (v12.18.1) and `npm` (v6.13). Recommended to install `node` and `npm` using [`nvm`](https://github.com/nvm-sh/nvm). After installing `nvm`, you can run `nvm install 12.18.1` to install `node` version 12.18.1 and run `nvm use 12.18.1` to use that version.
22+
- `node` (v16.20.2) and `npm` (v8.19.4). Recommended to install `node` and `npm` using [`nvm`](https://github.com/nvm-sh/nvm). After installing `nvm`, you can run `nvm install 16.20.2` to install `node` version 16.20.2 and run `nvm use 16.20.2` to use that version.
2323

2424
## Development
2525

pkg/ui/v1beta1/frontend/COMMIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
046c6d3c8
1+
7e52c174d

pkg/ui/v1beta1/frontend/angular.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"build": {
1818
"builder": "@angular-devkit/build-angular:browser",
1919
"options": {
20+
"allowedCommonJsDependencies": [
21+
"date-fns",
22+
"lodash"
23+
],
2024
"preserveSymlinks": true,
2125
"outputPath": "dist/frontend",
2226
"index": "src/index.html",

pkg/ui/v1beta1/frontend/cypress/e2e/index-page.cy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ describe('Index page', () => {
5252
const status = parseStatus(experiments[i]);
5353
if (status.phase === STATUS_TYPE.READY) {
5454
cy.wrap(element)
55-
.find('lib-status>mat-icon')
55+
.find('lib-status-icon>mat-icon')
5656
.should('contain', 'check_circle');
5757
} else if (status.phase === STATUS_TYPE.STOPPED) {
5858
cy.wrap(element)
59-
.find('lib-status>lib-icon')
59+
.find('lib-status-icon>lib-icon')
6060
.should('have.attr', 'icon', 'custom:stoppedResource');
6161
} else if (status.phase === STATUS_TYPE.UNAVAILABLE) {
6262
cy.wrap(element)
63-
.find('lib-status>mat-icon')
63+
.find('lib-status-icon>mat-icon')
6464
.should('contain', 'timelapse');
6565
} else if (status.phase === STATUS_TYPE.WARNING) {
6666
cy.wrap(element)
67-
.find('lib-status>mat-icon')
67+
.find('lib-status-icon>mat-icon')
6868
.should('contain', 'warning');
6969
} else if (
7070
status.phase === STATUS_TYPE.WAITING ||

0 commit comments

Comments
 (0)