Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update(console): e2e test order, handler auto select #2283

Merged
merged 2 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions console/playwright/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
# DEBUG=true
# DEBUG=pw:browser*
LITE=false
CLEAN_AUTH=true
CLOSE_AFTER_TEST=false
CLOSE_SAVE_VIDEO=true
1 change: 1 addition & 0 deletions console/playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const config: PlaywrightTestConfig = {
},
},
dependencies: ['setup'],
testMatch: ['**/admin.spec.ts', '**/*.spec.ts'],
},

// {
Expand Down
2 changes: 1 addition & 1 deletion console/playwright/tests/auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ USERS.map(async (user) => {
// testInfo.project.outputDir
const fileName = path.join('test-storage', 'storage-' + user.role + '.json')

if (fs.existsSync(fileName)) return
if (fs.existsSync(fileName) && process.env.CLEAN_AUTH !== 'true') return

setup(`authenticate as ${user.role}`, async ({ page }) => {
await page.goto(config.use?.baseURL as string)
Expand Down
6 changes: 6 additions & 0 deletions console/src/domain/job/components/JobForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ export default function JobForm({ job, onSubmit }: IJobFormProps) {
[setStepSpecOverWrites]
)

useEffect(() => {
if (!modelVersionHandler) {
setModelVersionHandler(fullStepSource?.find((v) => v)?.job_name ?? '')
}
}, [fullStepSource, modelVersionHandler])

return (
<Form form={form} initialValues={values} onFinish={handleFinish} onValuesChange={handleValuesChange}>
<Divider orientation='top'>{t('Environment')}</Divider>
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e_test/start_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ api_test() {

console_test() {
if ! in_github_action; then
docker run --rm --ipc=host -w /app -e PROXY=${SWNAME//./-}.pre.intra.starwhale.ai -v $SWROOT/console/playwright:/app mcr.microsoft.com/playwright:v1.33.0-jammy /bin/bash -c "yarn && yarn test" || exit 1
docker run --rm --ipc=host -w /app -e PROXY=http://${SWNAME//./-}.pre.intra.starwhale.ai -v $SWROOT/console/playwright:/app mcr.microsoft.com/playwright:v1.33.0-jammy /bin/bash -c "yarn && yarn test" || exit 1
fi
}

Expand Down