Skip to content

Commit af11ffc

Browse files
authored
feat(ci): add QW to P0 smoke + full regression matrix (#60)
- .github/workflows/p0.yml: matrix += qw, env += SITE_QW_*, name "5 sites" - .github/workflows/full-regression.yml: same matrix + env + name - docs/cicd.md: secrets table += QW row, gh CLI loop += QW, count 12 → 15 - README.md: pages/tests path listing, test commands, CI table all += qw - CLAUDE.md: CI section matrix description updated to 5 sites Depends on PR #58 (feat/qw-site-onboarding): tests/qw/ must exist on main before this matrix expansion can pass CI. GitHub Actions secrets needed (set separately via gh CLI): SITE_QW_URL, SITE_QW_USERNAME, SITE_QW_PASSWORD
1 parent 06a61f4 commit af11ffc

5 files changed

Lines changed: 22 additions & 14 deletions

File tree

.github/workflows/full-regression.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Full Regression (4 sites)
1+
name: Full Regression (5 sites)
22

33
# 觸發條件:
44
# - 每週一 08:00 台灣(= 00:00 UTC Monday)跑完整 regression,週末產品變動週一上班看得到
@@ -28,7 +28,7 @@ jobs:
2828
# 任一 site fail 不取消其他 site,讓所有結果可見
2929
fail-fast: false
3030
matrix:
31-
site: [rc, lt, re, rd]
31+
site: [rc, lt, re, rd, qw]
3232

3333
# 同 site 帳號不能並行(會互踢 session);與 p0.yml 共用同一個 lock group → 若同時 PR 跑與
3434
# cron 跑撞在一起,後者會等前者完成(避免帳號互踢)
@@ -70,6 +70,9 @@ jobs:
7070
SITE_RD_URL: ${{ secrets.SITE_RD_URL }}
7171
SITE_RD_USERNAME: ${{ secrets.SITE_RD_USERNAME }}
7272
SITE_RD_PASSWORD: ${{ secrets.SITE_RD_PASSWORD }}
73+
SITE_QW_URL: ${{ secrets.SITE_QW_URL }}
74+
SITE_QW_USERNAME: ${{ secrets.SITE_QW_USERNAME }}
75+
SITE_QW_PASSWORD: ${{ secrets.SITE_QW_PASSWORD }}
7376
run: |
7477
# 跑該 site 整個目錄(含 P0 + 全 feature);--reruns 1 處理 flaky;--tb=short 縮短 log
7578
pytest tests/${{ matrix.site }}/ \

.github/workflows/p0.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: P0 Smoke (4 sites)
1+
name: P0 Smoke (5 sites)
22

33
# 觸發條件:
44
# - PR 開啟 / 更新時自動跑(擋住有問題的 merge)
@@ -33,7 +33,7 @@ jobs:
3333
# 任一 site fail 不取消其他 site,讓所有結果可見
3434
fail-fast: false
3535
matrix:
36-
site: [rc, lt, re, rd]
36+
site: [rc, lt, re, rd, qw]
3737

3838
# 同 site 帳號不能並行(會互踢 session,見 memory feedback_single_session_per_account);
3939
# 不同 site 可並行(不同帳號互不影響)
@@ -77,6 +77,9 @@ jobs:
7777
SITE_RD_URL: ${{ secrets.SITE_RD_URL }}
7878
SITE_RD_USERNAME: ${{ secrets.SITE_RD_USERNAME }}
7979
SITE_RD_PASSWORD: ${{ secrets.SITE_RD_PASSWORD }}
80+
SITE_QW_URL: ${{ secrets.SITE_QW_URL }}
81+
SITE_QW_USERNAME: ${{ secrets.SITE_QW_USERNAME }}
82+
SITE_QW_PASSWORD: ${{ secrets.SITE_QW_PASSWORD }}
8083
run: |
8184
pytest tests/${{ matrix.site }}/test_p0_smoke.py \
8285
-m p0 \

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Reports are written to `reports/report.html` (self-contained HTML).
4040

4141
GitHub Actions 自動跑測試:
4242

43-
- `p0.yml`:PR 開啟 / push to main / 每天 09:00 台灣 / 手動 → RC + LT + RE + RD P0 smoke 4 站 matrix
44-
- `full-regression.yml`:每週一 08:00 台灣 / 手動 → 4 站全套(P0 + feature)
43+
- `p0.yml`:PR 開啟 / push to main / 每天 09:00 台灣 / 手動 → RC + LT + RE + RD + QW P0 smoke 5 站 matrix
44+
- `full-regression.yml`:每週一 08:00 台灣 / 手動 → 5 站全套(P0 + feature)
4545
- `docs-sync-check.yml`:PR 時檢查 code 變動是否有對應 .md 更新(hook 機制 + CI 雙保險)
4646

4747
詳細的 trigger 規則、cron 時段、secrets 清單、如何看 run / 下載 artifact / 加 secret / debug fail → 見 [`docs/cicd.md`](docs/cicd.md)

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ conftest.py — 全域 fixtures、環境偵測(Window
2222
config/settings.py — 多站台 SiteConfig,從 .env 讀取
2323
pages/factory.py — 前台:site_id → LoginPage/HomePage 路由(registry dict)
2424
pages/dashboard/factory.py — 後台:site_id → DashboardLoginPage/ManagementPage 路由
25-
pages/rc/, pages/lt/, pages/re/, pages/rd/ — 各站前台 Page Objects
25+
pages/rc/, pages/lt/, pages/re/, pages/rd/, pages/qw/ — 各站前台 Page Objects
2626
pages/dashboard/<site_id>/ — 各站後台 Page Objects
27-
tests/rc/, tests/lt/, tests/re/, tests/rd/ — 各站前台測試(含 test_p0_smoke.py + feature/)
27+
tests/rc/, tests/lt/, tests/re/, tests/rd/, tests/qw/ — 各站前台測試(含 test_p0_smoke.py + feature/)
2828
tests/api/<site_id>/ — API 層測試(不啟動瀏覽器,requests 直打 API)
2929
tests/dashboard/<site_id>/ — 後台管理介面測試
3030
utils/locale_helper.py — set_locale():注入 `i18n_locale` cookie(LT 用)
@@ -60,6 +60,7 @@ playwright install chromium
6060
.venv/bin/pytest tests/lt/ # lt 站
6161
.venv/bin/pytest tests/re/ # re 站
6262
.venv/bin/pytest tests/rd/ # rd 站
63+
.venv/bin/pytest tests/qw/ # qw 站
6364
.venv/bin/pytest tests/api/ # 僅 API 測試
6465
.venv/bin/pytest tests/dashboard/ # 僅後台測試
6566
.venv/bin/pytest tests/lt/test_p0_smoke.py -m p0 # lt P0 smoke
@@ -81,8 +82,8 @@ GitHub Actions 自動跑測試與 docs 同步檢查:
8182

8283
| Workflow | 觸發 | 跑什麼 |
8384
|---|---|---|
84-
| `.github/workflows/p0.yml` | PR / push to main / daily 09:00 台灣 / 手動 | 4 站 P0 smoke matrix |
85-
| `.github/workflows/full-regression.yml` | 週一 08:00 台灣 / 手動 | 4 站全套(P0 + feature) |
85+
| `.github/workflows/p0.yml` | PR / push to main / daily 09:00 台灣 / 手動 | 5 站 P0 smoke matrix(rc/lt/re/rd/qw) |
86+
| `.github/workflows/full-regression.yml` | 週一 08:00 台灣 / 手動 | 5 站全套(P0 + feature) |
8687
| `.github/workflows/docs-sync-check.yml` | PR | code 變動是否同步更新 docs |
8788

8889
操作細節(trigger 規則、cron 時段、secrets 清單、看 run / 下載 artifact / debug、docs sync check 操作 + override)見 [`docs/cicd.md`](docs/cicd.md)

docs/cicd.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ GitHub Actions 自動跑這個 repo 的測試。當前 3 個 workflow:
44

55
| Workflow | 觸發 | 跑什麼 | 預估時長 |
66
|---|---|---|---|
7-
| `p0.yml` | PR / push to main / daily cron / 手動 | 4 站 P0 smoke matrix | ~3 分(4 job 並行) |
8-
| `full-regression.yml` | weekly cron(週一) / 手動 | 4 站全套(P0 + feature) | ~17 分(4 job 並行) |
7+
| `p0.yml` | PR / push to main / daily cron / 手動 | 5 站 P0 smoke matrix(rc/lt/re/rd/qw) | ~3 分(5 job 並行) |
8+
| `full-regression.yml` | weekly cron(週一) / 手動 | 5 站全套(P0 + feature) | ~17 分(5 job 並行) |
99
| `docs-sync-check.yml` | PR | code 變動是否同步 docs | < 30 秒 |
1010

1111
## Cron 時段(台灣時區)
@@ -19,19 +19,20 @@ GitHub Actions 自動跑這個 repo 的測試。當前 3 個 workflow:
1919

2020
## Secrets 清單
2121

22-
`https://github.com/<owner>/<repo>/settings/secrets/actions` 設定,共 12 個:
22+
`https://github.com/<owner>/<repo>/settings/secrets/actions` 設定,共 15 個:
2323

2424
| Site | Secrets |
2525
|---|---|
2626
| RC | `SITE_RC_URL` / `SITE_RC_USERNAME` / `SITE_RC_PASSWORD` |
2727
| LT | `SITE_LT_URL` / `SITE_LT_USERNAME` / `SITE_LT_PASSWORD` |
2828
| RE | `SITE_RE_URL` / `SITE_RE_USERNAME` / `SITE_RE_PASSWORD` |
2929
| RD | `SITE_RD_URL` / `SITE_RD_USERNAME` / `SITE_RD_PASSWORD` |
30+
| QW | `SITE_QW_URL` / `SITE_QW_USERNAME` / `SITE_QW_PASSWORD` |
3031

3132
### `gh` CLI 從本機 .env 一次設好
3233

3334
```bash
34-
for site in RC LT RE RD; do
35+
for site in RC LT RE RD QW; do
3536
for k in URL USERNAME PASSWORD; do
3637
grep "^SITE_${site}_${k}=" .env | cut -d= -f2- | gh secret set "SITE_${site}_${k}"
3738
done

0 commit comments

Comments
 (0)