Mochawesome/Testomatio/junit reporter: run-workers: Running of test with --suite doesn't aggregate results from all suites per browser
还没有人认领这个 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
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 16
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codeceptjs/CodeceptJS 的其他 Issue
-
stale
难度 2/5 1-3 小时 新手友好度 72/100
codeceptjs/CodeceptJS#5420 · 1 条评论 ·
-
stale
难度 2/5 1-3 小时 新手友好度 76/100
codeceptjs/CodeceptJS#5358 · 1 条评论 ·
-
stale
难度 2/5 1-3 小时 新手友好度 78/100
codeceptjs/CodeceptJS#4958 · 10 条评论 · 2 个 reaction ·
-
stale
难度 1/5 1 小时以内 新手友好度 72/100
codeceptjs/CodeceptJS#4778 · 3 条评论 ·
-
stale
难度 4/5 3-5 天 新手友好度 38/100
codeceptjs/CodeceptJS#5618 · 1 条评论 ·
查看 codeceptjs/CodeceptJS 的全部 Issue
相似的 Issue
-
ai-observability bug team/ai-observability
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 68/100
AllTheMods/ATM-10-L#19 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
SignalK/n2k-signalk#345 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 1/5 1-3 小时 新手友好度 88/100
JuliaPluto/PlutoPlotly.jl#72 ·