Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/workers.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,19 @@ const createWorkerObjects = (testGroups, config, testRoot, options, selectedRuns
});
}
const workersToExecute = [];

const currentOutputFolder = config.output;
const currentMochawesomeReportDir = config.mocha.reporterOptions?.mochawesome.options.reportDir;

collection.createRuns(selectedRuns, config).forEach((worker) => {
const _config = { ...config };
_config.output = `${currentOutputFolder}/${worker.config.browser.browser}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ${worker.name} is better than ${worker.config.browser.browser}

Then an output folder name will be e.g. personal:chromium1 (or dev:chromium1) instead of chromium and it's more similar to naming when using run-multiple mode.

The run-multiple mode uses personal_chromium_1 (<profile>_<browser_name>_<browser_order>)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you help tell what worker.name returns?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I run a test in VSCode in debug mode and just saw the value. I guess "worker.name" returns <profile_name>:<browser_name>1.
Not sure for 1 means. I thought that it's a worker ID, but in my testing it's always 1 even for multiple workers (e.g. 2 workers).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your reply!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, folder name is e.g. dev_firefox1 (profile "dev", browser "firefox") after the latest fixes ✔️ .
Also XML report result.xml is stored to a folder per browser ✔️ .

if (config.mocha && config.mocha.reporterOptions) {
_config.mocha.reporterOptions.mochawesome.options.reportDir = `${currentMochawesomeReportDir}/${worker.config.browser.browser}`;
}
const workerName = worker.getOriginalName() || worker.getName();
const workerConfig = worker.getConfig();
workersToExecute.push(getOverridenConfig(workerName, workerConfig, config));
workersToExecute.push(getOverridenConfig(workerName, workerConfig, _config));
});
const workers = [];
let index = 0;
Expand Down