Skip to content

Commit f92f3e3

Browse files
authored
Testcafe: Add tenant without audit log (#1644)
1 parent cd72c53 commit f92f3e3

File tree

13 files changed

+144
-85
lines changed

13 files changed

+144
-85
lines changed

.github/workflows/jobs.yaml

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
runs-on: ${{ matrix.os }}
2121
strategy:
2222
matrix:
23-
go-version: [1.17.x]
24-
os: [ubuntu-latest]
23+
go-version: [ 1.17.x ]
24+
os: [ ubuntu-latest ]
2525
steps:
2626
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
2727
uses: actions/setup-go@v2
@@ -63,6 +63,7 @@ jobs:
6363
repository: minio/operator
6464
path: operator
6565
- uses: actions/cache@v2
66+
name: Go Mod Cache
6667
with:
6768
path: |
6869
~/.cache/go-build
@@ -77,25 +78,35 @@ jobs:
7778

7879
- uses: actions/cache@v2
7980
id: yarn-cache
81+
name: Yarn Cache
8082
with:
8183
path: |
8284
${{ steps.yarn-cache-dir-path.outputs.dir }}
8385
./portal-ui/node_modules/
84-
./portal-ui/build/
8586
key: ${{ runner.os }}-yarn-${{ hashFiles('./portal-ui/yarn.lock') }}
8687
restore-keys: |
8788
${{ runner.os }}-yarn-
8889
89-
- name: Install Dependencies
90-
if: steps.yarn-cache.outputs.cache-hit != 'true'
91-
working-directory: ./
92-
run: make assets
90+
- uses: actions/cache@v2
91+
id: assets-cache
92+
name: Assets Cache
93+
with:
94+
path: |
95+
./portal-ui/build/
96+
key: ${{ runner.os }}-assets-${{ github.run_id }}
97+
restore-keys: |
98+
${{ runner.os }}-assets-
9399
100+
- name: Install Dependencies
101+
working-directory: ./portal-ui
102+
continue-on-error: false
103+
run: |
104+
yarn install
94105
- name: Check for Warnings in build output
95106
working-directory: ./portal-ui
96107
continue-on-error: false
97108
run: |
98-
chmod +x check-warnings.sh && ./check-warnings.sh
109+
./check-warnings.sh
99110
100111
compile-job:
101112
name: Compiles on Go ${{ matrix.go-version }} and ${{ matrix.os }}
@@ -106,8 +117,8 @@ jobs:
106117
runs-on: ${{ matrix.os }}
107118
strategy:
108119
matrix:
109-
go-version: [1.17.x]
110-
os: [ubuntu-latest]
120+
go-version: [ 1.17.x ]
121+
os: [ ubuntu-latest ]
111122
steps:
112123
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
113124
uses: actions/setup-go@v2
@@ -134,8 +145,8 @@ jobs:
134145
runs-on: ${{ matrix.os }}
135146
strategy:
136147
matrix:
137-
go-version: [1.17.x]
138-
os: [ubuntu-latest]
148+
go-version: [ 1.17.x ]
149+
os: [ ubuntu-latest ]
139150
steps:
140151
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
141152
uses: actions/setup-go@v2
@@ -162,8 +173,8 @@ jobs:
162173
runs-on: ${{ matrix.os }}
163174
strategy:
164175
matrix:
165-
go-version: [1.17.x]
166-
os: [ubuntu-latest]
176+
go-version: [ 1.17.x ]
177+
os: [ ubuntu-latest ]
167178
steps:
168179
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
169180
uses: actions/setup-go@v2
@@ -190,8 +201,8 @@ jobs:
190201
runs-on: ${{ matrix.os }}
191202
strategy:
192203
matrix:
193-
go-version: [1.17.x]
194-
os: [ubuntu-latest]
204+
go-version: [ 1.17.x ]
205+
os: [ ubuntu-latest ]
195206
steps:
196207
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
197208
uses: actions/setup-go@v2
@@ -218,8 +229,8 @@ jobs:
218229
runs-on: ${{ matrix.os }}
219230
strategy:
220231
matrix:
221-
go-version: [1.17.x]
222-
os: [ubuntu-latest]
232+
go-version: [ 1.17.x ]
233+
os: [ ubuntu-latest ]
223234
steps:
224235
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
225236
uses: actions/setup-go@v2
@@ -246,8 +257,8 @@ jobs:
246257
runs-on: ${{ matrix.os }}
247258
strategy:
248259
matrix:
249-
go-version: [1.17.x]
250-
os: [ubuntu-latest]
260+
go-version: [ 1.17.x ]
261+
os: [ ubuntu-latest ]
251262
steps:
252263
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
253264
uses: actions/setup-go@v2
@@ -274,8 +285,8 @@ jobs:
274285
runs-on: ${{ matrix.os }}
275286
strategy:
276287
matrix:
277-
go-version: [1.17.x]
278-
os: [ubuntu-latest]
288+
go-version: [ 1.17.x ]
289+
os: [ ubuntu-latest ]
279290
steps:
280291
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
281292
uses: actions/setup-go@v2
@@ -302,8 +313,8 @@ jobs:
302313
runs-on: ${{ matrix.os }}
303314
strategy:
304315
matrix:
305-
go-version: [1.17.x]
306-
os: [ubuntu-latest]
316+
go-version: [ 1.17.x ]
317+
os: [ ubuntu-latest ]
307318
steps:
308319
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
309320
uses: actions/setup-go@v2
@@ -331,7 +342,7 @@ jobs:
331342

332343
strategy:
333344
matrix:
334-
go-version: [1.17.x]
345+
go-version: [ 1.17.x ]
335346

336347
steps:
337348
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -416,6 +427,7 @@ jobs:
416427
repository: minio/operator
417428
path: operator
418429
- uses: actions/cache@v2
430+
name: Go Mod Cache
419431
with:
420432
path: |
421433
~/.cache/go-build
@@ -430,19 +442,24 @@ jobs:
430442

431443
- uses: actions/cache@v2
432444
id: yarn-cache
445+
name: Yarn Cache
433446
with:
434447
path: |
435448
${{ steps.yarn-cache-dir-path.outputs.dir }}
436449
./portal-ui/node_modules/
437-
./portal-ui/build/
438450
key: ${{ runner.os }}-yarn-${{ hashFiles('./portal-ui/yarn.lock') }}
439451
restore-keys: |
440452
${{ runner.os }}-yarn-
441453
442-
- name: Install Dependencies
443-
if: steps.yarn-cache.outputs.cache-hit != 'true'
444-
working-directory: ./
445-
run: make assets
454+
- uses: actions/cache@v2
455+
id: assets-cache
456+
name: Assets Cache
457+
with:
458+
path: |
459+
./portal-ui/build/
460+
key: ${{ runner.os }}-assets-${{ github.run_id }}
461+
restore-keys: |
462+
${{ runner.os }}-assets-
446463
447464
- name: Build Console on ${{ matrix.os }}
448465
env:
@@ -484,6 +501,7 @@ jobs:
484501
- name: Check out code into the Go module directory
485502
uses: actions/checkout@v2
486503
- uses: actions/cache@v2
504+
name: Go Mod Cache
487505
with:
488506
path: |
489507
~/.cache/go-build
@@ -498,6 +516,7 @@ jobs:
498516

499517
- uses: actions/cache@v2
500518
id: yarn-cache
519+
name: Yarn Cache
501520
with:
502521
path: |
503522
${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -507,10 +526,15 @@ jobs:
507526
restore-keys: |
508527
${{ runner.os }}-yarn-
509528
510-
- name: Install Dependencies
511-
if: steps.yarn-cache.outputs.cache-hit != 'true'
512-
working-directory: ./
513-
run: make assets
529+
- uses: actions/cache@v2
530+
id: assets-cache
531+
name: Assets Cache
532+
with:
533+
path: |
534+
./portal-ui/build/
535+
key: ${{ runner.os }}-assets-${{ github.run_id }}
536+
restore-keys: |
537+
${{ runner.os }}-assets-
514538
515539
- name: Build Console on ${{ matrix.os }}
516540
env:

portal-ui/check-warnings.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ die() {
1111
try() { "$@" &> yarn.log || die "cannot $*"; }
1212

1313
rm yarn.log
14-
try yarn build
14+
try make build-static
1515

1616
if cat yarn.log | grep "Compiled with warnings"; then
1717
echo "There are warnings in the code"

portal-ui/src/screens/Console/Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ const FormSwitchWrapper = ({
153153
disableFocusRipple
154154
disableTouchRipple
155155
value={value}
156+
id={id}
156157
/>
157158
{!switchOnly && (
158159
<span

portal-ui/src/screens/Console/Common/FormComponents/InputBoxWrapper/InputBoxWrapper.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ interface InputBoxProps {
5555
placeholder?: string;
5656
min?: string;
5757
max?: string;
58+
overlayId?: string;
5859
overlayIcon?: any;
5960
overlayAction?: () => void;
6061
overlayObject?: any;
@@ -125,6 +126,7 @@ const InputBoxWrapper = ({
125126
placeholder = "",
126127
min,
127128
max,
129+
overlayId,
128130
overlayIcon = null,
129131
overlayObject = null,
130132
extraInputProps = {},
@@ -215,6 +217,7 @@ const InputBoxWrapper = ({
215217
}
216218
: () => null
217219
}
220+
id={overlayId}
218221
size={"small"}
219222
disableFocusRipple={false}
220223
disableRipple={false}

portal-ui/src/screens/Console/Common/GenericWizard/GenericWizard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ const GenericWizard = ({
165165
{wizardSteps.map((step, index) => {
166166
return (
167167
<ListItem
168-
id={"wizard-step-" + step.label}
168+
id={
169+
"wizard-step-" + step.label.toLowerCase().replaceAll(" ", "-")
170+
}
169171
button
170172
disableRipple
171173
onClick={() => pageChange(index)}

portal-ui/src/screens/Console/Common/ModalWrapper/ConfirmDialog.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const ConfirmDialog = ({
9595
{...cancelButtonProps}
9696
variant="outlined"
9797
color="primary"
98+
id={"confirm-cancel"}
9899
>
99100
{cancelText}
100101
</Button>
@@ -110,6 +111,7 @@ const ConfirmDialog = ({
110111
loadingPosition="start"
111112
startIcon={<React.Fragment />}
112113
autoFocus
114+
id={"confirm-ok"}
113115
{...confirmButtonProps}
114116
>
115117
{confirmText}

portal-ui/src/screens/Console/Tenants/AddTenant/Steps/ConfigLogSearch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ const ConfigLogSearch = ({
260260
<Grid item xs={12} className={classes.configSectionItem}>
261261
<FormSwitchWrapper
262262
value="logSearchConfig"
263-
id="log_search_configuration"
264-
name="log_search_configuration"
263+
id="log-search-enabled"
264+
name="log_search_enabled"
265265
checked={logSearchEnabled}
266266
onChange={(e) => {
267267
const targetD = e.target;

portal-ui/src/screens/Console/Tenants/AddTenant/Steps/TenantResources/NameTenantMain.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ const NameTenantMain = ({
321321
label="Namespace"
322322
value={namespace}
323323
error={validationErrors["namespace"] || ""}
324+
overlayId={"add-namespace"}
324325
overlayIcon={showCreateButton ? <AddIcon /> : null}
325326
overlayAction={addNamespace}
326327
required

portal-ui/src/screens/Console/Tenants/ListTenants/TenantListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const TenantListItem = ({ tenant, classes }: ITenantListItem) => {
160160

161161
return (
162162
<Fragment>
163-
<div className={classes.tenantItem}>
163+
<div className={classes.tenantItem} id={`list-tenant-${tenant.name}`}>
164164
<Grid container>
165165
<Grid item xs={8}>
166166
<div className={classes.title}>{tenant.name}</div>

portal-ui/src/screens/LoginPage/LoginPage.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ const Login = ({
436436
type="submit"
437437
variant="contained"
438438
color="primary"
439+
id="do-login"
439440
className={classes.submit}
440441
disabled={secretKey === "" || accessKey === "" || loginSending}
441442
>
@@ -459,6 +460,7 @@ const Login = ({
459460
type="submit"
460461
variant="contained"
461462
color="primary"
463+
id="sso-login"
462464
className={classes.submit}
463465
>
464466
Login with SSO
@@ -502,6 +504,7 @@ const Login = ({
502504
type="submit"
503505
variant="contained"
504506
color="primary"
507+
id="do-login"
505508
className={classes.submit}
506509
disabled={jwt === "" || loginSending}
507510
>
@@ -534,6 +537,7 @@ const Login = ({
534537
endIcon={<RefreshIcon />}
535538
color={"primary"}
536539
variant="outlined"
540+
id="retry"
537541
className={classes.retryButton}
538542
>
539543
Retry

0 commit comments

Comments
 (0)