Skip to content

Commit cb8aee4

Browse files
e2e: handle utilization mismatch
1 parent 520afbb commit cb8aee4

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

packages/curve-ui-kit/src/themes/stories/Tabs.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ComponentProps, useState } from 'react'
2+
import { Stack } from '@mui/material'
23
import type { Meta, StoryObj } from '@storybook/react-vite'
34
import { TabsSwitcher, type TabOption } from '../../shared/ui/TabsSwitcher'
4-
import { Stack } from '@mui/material'
55

66
type Tab = `${number}`
77
const tabs: TabOption<Tab>[] = [

tests/cypress/support/helpers/lending-mocks.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,14 @@ function oneLendingVaultResponse(chain: Chain): GetMarketsResponse {
8989
},
9090
{
9191
// largest TVL to test the sorting
92-
...oneLendingPool(chain, { utilization: oneFloat() }),
93-
total_assets_usd: 60_000_000,
94-
total_debt_usd: 50_000_000,
95-
collateral_balance_usd: 50_000_000,
96-
borrowed_balance_usd: 50_000_000,
92+
...oneLendingPool(chain, { utilization: oneFloat(), tvl: MAX_USD_VALUE }),
9793
address: HighTVLAddress,
9894
vault: HighTVLAddress,
9995
controller: HighTVLAddress,
10096
},
10197
{
10298
// 99% utilization to test the sorting and slider filter
103-
...oneLendingPool(chain, { utilization: oneFloat() }),
104-
total_assets_usd: 100_000_000,
105-
total_debt_usd: 99_000_000,
99+
...oneLendingPool(chain, { utilization: 0.99 }),
106100
address: HighUtilizationAddress,
107101
vault: HighUtilizationAddress,
108102
controller: HighUtilizationAddress,

tests/download-artifacts.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import { execFileSync, spawnSync } from 'node:child_process'
2-
import { mkdir, readdir, unlink } from 'node:fs/promises'
3-
import path from 'node:path'
1+
import path from 'path'
2+
import { execFileSync, spawnSync, type ExecFileSyncOptionsWithStringEncoding } from 'child_process'
3+
import { mkdir, readdir, unlink } from 'fs/promises'
44

55
type Extractor = (zipPath: string, targetDir: string) => void
66

7+
const { BRANCH, WORKFLOW, DEST_DIR, REPOSITORY = 'curvefi/curve-frontend' } = process.env
8+
79
/**
810
* Execute a command and return trimmed stdout.
911
*/
10-
const run = (command: string, args: string[], options?: Parameters<typeof execFileSync>[2]): string =>
12+
const run = (command: string, args: string[], options?: ExecFileSyncOptionsWithStringEncoding): string =>
1113
execFileSync(command, args, {
1214
encoding: 'utf8',
1315
stdio: ['inherit', 'pipe', 'pipe'],
@@ -46,6 +48,8 @@ const findLatestRunId = (branch: string, workflow: string): string =>
4648
run('gh', [
4749
'run',
4850
'list',
51+
'--repo',
52+
REPOSITORY,
4953
'--branch',
5054
branch,
5155
'--workflow',
@@ -62,7 +66,7 @@ const findLatestRunId = (branch: string, workflow: string): string =>
6266
* Download artifacts for the given run into dest.
6367
*/
6468
const downloadArtifacts = (runId: string, dest: string) => {
65-
runStreaming('gh', ['run', 'download', runId, '--dir', dest])
69+
runStreaming('gh', ['run', 'download', runId, '--repo', REPOSITORY, '--dir', dest])
6670
}
6771

6872
/**
@@ -100,7 +104,6 @@ async function downloadLatestArtifacts(): Promise<void> {
100104
const repoRoot = run('git', ['rev-parse', '--show-toplevel'])
101105
process.chdir(repoRoot)
102106

103-
const { BRANCH, WORKFLOW, DEST_DIR } = process.env
104107
const branch = BRANCH?.trim() || run('git', ['rev-parse', '--abbrev-ref', 'HEAD'])
105108
const workflow = WORKFLOW?.trim() || 'ci.yaml'
106109
const runId = findLatestRunId(branch, workflow)

0 commit comments

Comments
 (0)