chore: Skills + CLAUDE.md + Playwright 配置更新

- SRE-QA Skills 擴充
- CLAUDE.md 指引更新
- playwright.config.ts 優化

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-03-29 16:04:43 +08:00
parent a5a6bd3408
commit 3bfb9c51f5
14 changed files with 66 additions and 13 deletions

View File

@@ -10,10 +10,10 @@
| 欄位 | 值 |
|------|-----|
| **版本** | v1.5 |
| **版本** | v1.6 |
| **建立日期** | 2026-03-20 (台北) |
| **建立者** | Claude Code |
| **最後修改** | 2026-03-26 03:30 (台北) |
| **最後修改** | 2026-03-29 15:30 (台北) |
| **修改者** | Claude Code |
### 變更紀錄
@@ -26,6 +26,7 @@
| v1.3 | 2026-03-26 | Claude Code | **Phase 15 觀測性測試** |
| v1.4 | 2026-03-26 | Claude Code | **Runner 殭屍進程診斷流程** |
| v1.5 | 2026-03-26 | Claude Code | **LLM 測試策略** (首席架構師審查 P3) |
| v1.6 | 2026-03-29 | Claude Code | **告警鏈路 E2E 驗證** (監控整合主計畫) |
---
@@ -127,7 +128,7 @@ cd apps/web && node scripts/verify-frontend.js
#!/bin/bash
# scripts/smoke-test-alert-chain.sh
API_URL="${1:-http://192.168.0.120:32334}"
API_URL="${1:-http://192.168.0.125:32334}" # VIP (K-HA)
echo "🔔 Testing alert chain..."
@@ -675,6 +676,38 @@ def validate_traditional_chinese(response: str) -> bool:
---
## 🚨 告警鏈路 E2E 驗證 (2026-03-29 監控整合主計畫)
> **來源**: `docs/proposals/MONITORING_MASTER_PLAN.md` Wave A.6 + B.2
> **腳本**: `ops/scripts/alert_chain_smoke_test.py`
### 驗證項目
| 鏈路 | 端點 | 預期回應 |
|------|------|----------|
| Alertmanager | `/api/v1/webhooks/alertmanager` | 200 + incident_id |
| Sentry | `/api/v1/webhooks/sentry/error` | 200 + accepted |
| SignOz | `/api/v1/webhooks/signoz/alert` | 200 + accepted |
| Telegram | `/api/v1/telegram/status` | 200 + connected |
### CD 整合 (部署後自動驗證)
```yaml
# .github/workflows/cd.yaml
- name: Alert Chain Smoke Test
run: python ops/scripts/alert_chain_smoke_test.py
env:
API_BASE: "http://awoooi-api.awoooi-prod.svc.cluster.local:8000"
```
### 失敗處置
1. Smoke Test 失敗 → CD Job 失敗
2. 直接發送 Telegram 告警 (繞過 API)
3. Incident 自動建立 (source: smoke_test)
---
## 參考文檔
- `apps/web/playwright.config.ts`: Playwright 設定

View File

@@ -66,6 +66,14 @@
→ [SERVICE-ENDPOINTS.md](docs/reference/SERVICE-ENDPOINTS.md) - 五主機架構與服務端點
→ [K3S-OPTIMIZATION-RUNBOOK.md](docs/runbooks/K3S-OPTIMIZATION-RUNBOOK.md) - K3s 維運手冊
## 🎨 靈感實驗室
→ [INSPIRATION_LAB.md](docs/INSPIRATION_LAB.md) - 學習/模仿/發想/待定案內容
**用途**: 收集外部參考、突發奇想、待討論項目
**分類**: 視覺/UI/UX/風格/功能/工具/服務/突發奇想
**注意**: 內容皆為「待評估」,採用前需統帥批准
## 🛑 修改前
修改以下檔案前,**必須先讀** [HARD_RULES.md](docs/HARD_RULES.md)

View File

@@ -6,6 +6,10 @@ import { defineConfig, devices } from '@playwright/test'
* Phase VI: 截圖 + 錄影自動產出
*/
// Phase 20: 支持環境變數覆蓋 baseURL可針對生產環境測試
const baseURL = process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:3000'
const isRemote = baseURL !== 'http://localhost:3000'
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
@@ -18,8 +22,8 @@ export default defineConfig({
],
use: {
// Base URL for navigation
baseURL: 'http://localhost:3000',
// Base URL for navigation (可通過 PLAYWRIGHT_BASE_URL 環境變數覆蓋)
baseURL,
// 截圖與錄影 - 統帥強制要求
screenshot: 'on',
@@ -45,10 +49,13 @@ export default defineConfig({
],
// Web server configuration - start Next.js dev server
webServer: {
command: 'pnpm dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 120000,
},
// 當使用遠端 URL (PLAYWRIGHT_BASE_URL) 時跳過本地 dev server
...(isRemote ? {} : {
webServer: {
command: 'pnpm dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 120000,
},
}),
})

View File

@@ -1,4 +1,9 @@
{
"status": "passed",
"failedTests": []
"status": "failed",
"failedTests": [
"94fa7afe4e6a4e928349-633a680572361bdf5194",
"1d558d822f954f202738-9e4cbb0b4b576ba06caf",
"1d558d822f954f202738-f1470b7d8f420ca6e014",
"1d558d822f954f202738-ce4b8fd616c6dffaee87"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB