feat: 修复测试套件问题并添加Woodpecker CI配置
- 修复API测试认证问题:创建全局认证设置,更新Playwright配置 - 优化回归测试稳定性:增加超时时间到15秒,修复定位器 - 创建Woodpecker CI工作流:CI、部署和质量门禁配置 - 添加Jest配置和测试脚本 - 移除登录页面的默认账号密码显示(安全问题修复)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
when:
|
||||
branch: [main, develop]
|
||||
event: [push, pull_request]
|
||||
|
||||
steps:
|
||||
lint:
|
||||
image: node:18-alpine
|
||||
commands:
|
||||
- npm ci
|
||||
- npm run lint
|
||||
- npm run type-check
|
||||
|
||||
test:
|
||||
image: node:18-alpine
|
||||
commands:
|
||||
- npm ci
|
||||
- npm run db:push
|
||||
- npm run test:unit
|
||||
- npx playwright install --with-deps
|
||||
- npm run test:e2e
|
||||
|
||||
build:
|
||||
image: node:18-alpine
|
||||
commands:
|
||||
- npm ci
|
||||
- npm run build
|
||||
when:
|
||||
status: [success]
|
||||
@@ -0,0 +1,12 @@
|
||||
when:
|
||||
branch: [main]
|
||||
event: [push]
|
||||
|
||||
steps:
|
||||
deploy:
|
||||
image: node:18-alpine
|
||||
commands:
|
||||
- npm ci
|
||||
- npm run build
|
||||
- echo "Deploying to production..."
|
||||
secrets: [deploy_key]
|
||||
@@ -0,0 +1,18 @@
|
||||
when:
|
||||
event: [pull_request]
|
||||
branch: [main, develop]
|
||||
|
||||
steps:
|
||||
quality-check:
|
||||
image: node:18-alpine
|
||||
commands:
|
||||
- npm ci
|
||||
- npm run lint
|
||||
- npm run type-check
|
||||
- npm run test:unit -- --coverage
|
||||
- |
|
||||
COVERAGE=$(cat coverage/coverage-summary.json | grep -o '"lines":{"pct":[0-9.]*' | grep -o '[0-9.]*$')
|
||||
if [ $(echo "$COVERAGE < 70" | bc -l) -eq 1 ]; then
|
||||
echo "Coverage $COVERAGE% is below threshold 70%"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user