mattermost-mobile-upstream/detox/utils/cli-args.js
yasser khan bcac248ec0
feat(e2e): Integrate TSIO reporting (#9925)
Retire legacy maestro per-platform contexts from cancel-e2e-runs and
document the canonical PR, master, and CMT status context mapping.
Wire Detox + Maestro (PR/main/CMT) into Test System IO with a single
commit status (e2e/mobile; CMT uses e2e/compatibility-matrix-testing)
and groups mobile-pr / mobile-main / cmt-mobile.

Upload shard results with correct framework labels, merge Jest shards
into TSIO Detox shape, stub missing/dead shards as failures, and post
channel summaries after status settles. Matterwick MASTER is treated as
MAIN for mobile-main routing.

Also harden report/fail paths, stage Maestro screenshots per flow for
TSIO galleries, fix a few Detox setup/testID issues, and skip known
platform flakes so the pipeline stays actionable while TSIO lands.
2026-07-23 06:43:28 +00:00

35 lines
918 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
/**
* Minimal `--key value` / `--key=value` argv parser for CI utility scripts.
*
* @param {string[]} argv
* @returns {Record<string, string>}
*/
function parseArgs(argv) {
const out = {};
for (let i = 2; i < argv.length; i++) {
let key = argv[i];
if (!key.startsWith('--')) {
continue;
}
key = key.slice(2);
if (key.includes('=')) {
const idx = key.indexOf('=');
out[key.slice(0, idx)] = key.slice(idx + 1);
} else {
const next = argv[i + 1];
if (next === undefined || next.startsWith('--')) {
out[key] = 'true';
} else {
out[key] = next;
i++;
}
}
}
return out;
}
module.exports = {parseArgs};