Run scenarios in parallel

未關閉
#390 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
45/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
php
領域
testing

研究方向

Start from issue #384 to get per-scenario timings. Examine the composer prepare-tests script and the Behat runner that currently executes scenarios serially. Implement worker isolation (own DB, temp dir) and a scenario-level splitter, then verify behat-rerun and merged reports still work.

由索引模型根據 Issue 內容生成。

描述

scope:testing status:unconfirmed

Scenarios run strictly one after another, even though almost all of them are independent and the CI runners have several cores. In a local experiment with 213 entity-command scenarios, a serial run took 491 seconds. With 8 workers it took 164 seconds when split by feature file, where one large file set the floor. Split by scenario, it took 140 seconds (3.5×).

Steps:

  1. Give each worker its own state: temporary directory, HOME, WP-CLI cache and test database. composer prepare-tests needs to grant access to the additional databases.
  2. Keep scenarios that rely on fixed shared resources, such as port 8080 or the scaffold test database, from running at the same time.
  3. Split the work by scenario rather than by file, balanced by the per-scenario timings from #384.
  4. Merge the results into a single report and keep behat-rerun working.

Measuring: take the baseline from #384, then open a draft PR, run the same CI jobs against it with the parallel runner enabled and record both results here before we decide. CI runners have fewer cores than a development machine, so the gain there will be smaller than locally.

主要語言
PHP
星號
42
分支
29
平均合併
21 小時 6 分鐘
30 天內合併 PR
24

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

wp-cli/wp-cli-tests 的其他 Issue

查看 wp-cli/wp-cli-tests 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。