Mochawesome/Testomatio/junit reporter: run-workers: Running of test with --suite doesn't aggregate results from all suites per browser
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, playwright, typescript
- Lĩnh vực
- testing
Hướng nghiên cứu
Bắt đầu với codecept.conf.ts và tái hiện vấn đề bằng codeceptjs run-workers 3 dev --by suite --reporter mocha-multi đối với SuiteA_test.ts và SuiteB_test.ts. Theo dõi cách kết quả của worker đến được các đường dẫn đầu ra đã cấu hình của Mochawesome và mocha-junit-reporter; được xem là hoàn tất khi các artifact console.log, HTML, JSON và XML cho cả chromium và firefox đều chứa cả hai suite.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 4.2k
- Fork
- 756
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 16
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codeceptjs/CodeceptJS
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#5420 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
codeceptjs/CodeceptJS#5358 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
codeceptjs/CodeceptJS#4958 · 10 bình luận · 2 reaction ·
-
stale
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#4778 · 3 bình luận ·
-
stale
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
codeceptjs/CodeceptJS#5618 · 1 bình luận ·
Tất cả issue của codeceptjs/CodeceptJS
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/cloudstack#14222 ·
-
Browser Waiting for: Product Owner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
getsentry/sentry-javascript#24577 · 1 bình luận ·
-
curation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
amponce/archive-movie-browser#186 ·
-
light
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
aemdemos/patients-stryker#253 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
clerk/javascript#9852 ·