Mochawesome/Testomatio/junit reporter: run-workers: Running of test with --suite doesn't aggregate results from all suites per browser
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- javascript, playwright, typescript
- 領域
- testing
研究方向
從 codecept.conf.ts 開始,針對 SuiteA_test.ts 和 SuiteB_test.ts 使用 codeceptjs run-workers 3 dev --by suite --reporter mocha-multi 重現問題。追蹤 worker 結果如何到達已設定的 Mochawesome 和 mocha-junit-reporter 輸出路徑;完成的條件是,chromium 和 firefox 的 console.log、HTML、JSON 以及 XML artifact 都包含兩個 suite。
由索引模型根據 Issue 內容生成。
描述
The issue is even in older versions, e.g. in 3.5.3. Retested with the latest 3.7.6 and the issue persists.
npm i mochawesomenpm i mocha-junit-reporternpm i mocha-multi- Run the tests
codeceptjs run-workers 3 dev --by suite --reporter mocha-multi(parallelization per browser and per suite). Another variant is--suitesinstead of--by suite, but it behaves the same way.
$ codeceptjs run-workers 3 dev --by suite --reporter mocha-multi
CodeceptJS v3.7.6 #StandWithUkraine
Running tests in 3 workers...
[Worker 03] ✔ SuiteB › Scenario 1 in 4ms
[Worker 03] ✔ SuiteB › Scenario 2 in 1ms
[Worker 01] ✔ SuiteA › Scenario 1 in 5ms
[Worker 01] ✔ SuiteA › Scenario 2 in 1ms
[Worker 02] ✔ SuiteA › Scenario 1 in 3ms
[Worker 02] ✔ SuiteA › Scenario 2 in 1ms
[Worker 04] ✔ SuiteB › Scenario 1 in 4ms
[Worker 04] ✔ SuiteB › Scenario 2 in 1ms
OK | 8 passed // 3s
Expected result:
output/console.logcontains data from both test suitesoutput/dev_chromium1/report.htmlcontains data from both test suitesoutput/dev_chromium1/report.jsoncontains data from both test suitesoutput/dev_chromium1/result.xmlcontains data from both test suitesoutput/dev_firefox1/report.htmlcontains data from both test suitesoutput/dev_firefox1/report.jsoncontains data from both test suitesoutput/dev_firefox1/result.xmlcontains data from both test suites
This way it works with run-multiple (parallelization per browser, but test suites are run in sequence) ✔️
Actual result:
- All the mentioned files contains data from the SuiteA only. The SuiteB is missing there 🐞 . A problem seems to be that test suites overwrite each other's results when running in threads.
Config codecept.conf.ts:
import { setHeadlessWhen, setCommonPlugins } from "@codeceptjs/configure";
// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);
// enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins
setCommonPlugins();
export const config: CodeceptJS.MainConfig = {
tests: "./*_test.ts",
output: "./output",
helpers: {
Playwright: {
browser: "chromium",
url: "http://localhost",
show: true,
},
Mochawesome: {
uniqueScreenshotNames: true,
},
},
include: {
I: "./steps_file",
},
multiple: {
dev: {
browsers: [
{
browser: "chromium",
outputName: "chromium",
},
{
browser: "firefox",
outputName: "firefox",
},
],
},
},
mocha: {
reporterOptions: {
"codeceptjs-cli-reporter": {
stdout: "-",
options: {
verbose: true,
debug: true,
steps: true,
},
},
mochawesome: {
stdout: "./output/console.log",
options: {
reportDir: "./output",
reportFilename: "report",
},
},
"mocha-junit-reporter": {
stdout: "./output/console.log",
options: {
mochaFile: "./output/result.xml",
jenkinsMode: true,
attachments: true, //add screenshot for a failed test
},
},
},
},
name: "my",
};
Test suites:
SuiteA_test.ts
Feature("SuiteA");
Scenario("Scenario 1", ({ I }) => {
I.say("Executing Scenario 1 in Suite A");
});
Scenario("Scenario 2", ({ I }) => {
I.say("Executing Scenario 2 in Suite A");
});
SuiteB_test.ts
Feature("SuiteB");
Scenario("Scenario 1", ({ I }) => {
I.say("Executing Scenario 1 in Suite B");
});
Scenario("Scenario 2", ({ I }) => {
I.say("Executing Scenario 2 in Suite B");
});
Used SW:
- CodeceptJS 3.7.6
- mochawesome 7.1.4
- mocha-junit-reporter 2.2.1
- mocha-multi 1.1.7
- 主要語言
- JavaScript
- 星號
- 4.2k
- 分支
- 756
- 平均合併
- 1 天 8 小時
- 30 天內合併 PR
- 18
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
codeceptjs/CodeceptJS 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
codeceptjs/CodeceptJS#5731 ·
維護者通常 1 天內回覆
-
`I.waitForFile` (FileSystem helper) fails if directory does not exist (yet)可能已有人在做 @danielrentz 於 249 天前認領。 未關閉stale
難度 2/5 1-3 小時 新手友好度 72/100
codeceptjs/CodeceptJS#5420 · 1 則留言 ·
維護者通常 1 天內回覆
-
stale
難度 2/5 1-3 小時 新手友好度 76/100
codeceptjs/CodeceptJS#5358 · 1 則留言 ·
維護者通常 1 天內回覆
-
stale
難度 2/5 1-3 小時 新手友好度 78/100
codeceptjs/CodeceptJS#4958 · 10 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
stale
難度 1/5 1 小時以內 新手友好度 72/100
codeceptjs/CodeceptJS#4778 · 3 則留言 ·
維護者通常 1 天內回覆
查看 codeceptjs/CodeceptJS 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
[quality] useFocusTrap's Shift+Tab wrap and non-Tab/non-Escape key arms are never driven end to end可能已有人在做 @hivecommons-hive 今天認領。 未關閉agent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
agentic-workflows
難度 1/5 1 小時以內 新手友好度 85/100
githubnext/gh-aw-workshop#4220 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 92/100
JuliusBrussee/caveman#1189 ·
維護者通常 1 天內回覆
-
priority:low ready-for-dev
難度 2/5 1-3 小時 新手友好度 78/100
OpenHands/extensions#738 ·
維護者通常 1 天內回覆