mattermost-mobile-upstream/detox/utils
yasser khan cf509f26c1
Some checks are pending
ci / test (push) Waiting to run
ci / lint-typecheck (push) Waiting to run
ci / detox-lint-typecheck (push) Waiting to run
ci(e2e): enforce triage verdicts on PR and main E2E lanes by default (#10303)
* ci(e2e): enforce triage verdicts on PR and main E2E lanes by default

A lane red only on failures that are not the PR's now turns green, as on
mattermost and desktop. The E2E_TRIAGE_MODE variable can still set
report-only. The templates' triage announcement follows the same default.

* ci(e2e): don't announce triage on a PR that triage runs report-only for

With the E2E/Triage-report-only label, or labels that cannot be read,
triage runs report-only and never settles the e2e-test/triage check,
so the pending announcement stayed forever. e2e-override-label now
reports that label, and the templates announce only without it.

* ci(e2e): settle a triage check report-only leaves pending; retry status posts on 5xx

- Announce triage only when the report-only label check says 'false'.
- When triage does not enforce (the report-only label added after the
  announcement, unreadable labels, or a triage that stopped early), the
  e2e-triage action settles this run's own pending e2e-test/triage check
  from the lanes' current states.
- createCommitStatus tries a GitHub 5xx or a dropped connection again
  (3 attempts); a 4xx still fails at once. A 500 on the iPad lane of this
  PR failed a job whose tests passed.

* ci(e2e): retry a 5xx whose body cannot be read; keep test wait records per test

* ci(e2e): bound the 5xx body read in status posts; fix test lint

* ci(e2e): settle the triage check in a final job, from tested code

The settle step inside the triage composite never ran when triage was
skipped (a re-run that turned every lane green), and wrote without a
retry. A final job now settles this run's own e2e-test/triage check once
every lane is final: pending, or red while every lane is green. A lane
that is pending or never posted counts as not final, never green. The
decision lives in detox/utils/tsio-triage-settle.js with unit tests, and
the write goes through createCommitStatus, which now also retries a 429.

* ci(e2e): triage a lane that ended abandoned, not only failed

Run 41818921294: five Android shards never got a runner, so the lane's
workflow ended "abandoned" and triage, which ran only on "failure",
was skipped. The lane stayed red with no verdict and no re-run. Triage
now runs on any lane result but success or skipped.

* ci(e2e): retry the settle job's status reads; share the GitHub retry

- githubRequestWithRetry (tsio-report-status.js) holds the retry policy
  (5xx, 429, dropped connection; a stalled body is bounded); createCommitStatus
  and the settle job's status reads both use it, so a transient error on the
  read no longer leaves e2e-test/triage pending.
- The settle script imports TRIAGE_CHECK_CONTEXT instead of redefining it.
- The tsio-triage gate's comment says where 'abandoned' was seen.

* fix(e2e): bound status-body reads and abort unused response bodies in githubRequestWithRetry

* fix(e2e): scope settle lane statuses to runId and bound status-body reads

* ci(e2e): check out the settle script from the dispatch ref, not MOBILE_VERSION

The settle job checked out its script at the commit under test. A PR commit that
predates detox/utils/tsio-triage-settle.js has no script, so the node step fails
and this run's e2e-test/triage check is never settled; and the job holds a token
that writes statuses, so it should not run the branch's code. It now checks out
the dispatch ref, as the triage action does; --sha still names the tested commit.

* fix(e2e): keep ABAC grant tests inside the 300s test budget

#10301 made MM-68219_5 and MM-70693_2 wait up to four minutes, after the grant
check, for the server to deny the user again. Login, channel open and the grant
wait already take 136-210s, so whenever the deny was slow the test hit Jest's
300s timeout: MM-68219_5 timed out on both attempts on main (fca832c) and on
this PR, and MM-70693_2 on main.

The restore only matters to an in-place retry (iOS CI); Android re-runs the
spec file with new users. The test now restores the attribute without waiting,
and checks the server-side deny at its start instead: a first attempt already
has it, so that returns on the first poll; a retry waits up to two minutes for
the previous attempt's restore to land.
2026-11-05 14:35:43 +05:30
..
artifacts.js test(detox): re-submit RF→Detox migration without unintended UI changes (#9847) 2026-06-19 22:44:02 +05:30
build-tsio-job-config.js ci(e2e): make E2E/Override waive checks instead of cancelling runs (#9975) 2026-07-31 14:22:19 +02:00
build-tsio-job-config.test.js ci(e2e): make E2E/Override waive checks instead of cancelling runs (#9975) 2026-07-31 14:22:19 +02:00
check-server-mutation-manifest.js E2E: apply one server baseline at provisioning (#10258) 2026-10-21 23:36:31 +05:30
check-server-mutation-manifest.test.js E2E: apply one server baseline at provisioning (#10258) 2026-10-21 23:36:31 +05:30
cli-args.js feat(e2e): Integrate TSIO reporting (#9925) 2026-07-23 06:43:28 +00:00
cmt-channel-notify.js fix(e2e): stabilize CMT and main Detox/Maestro E2E flakes (#10301) 2026-11-04 13:07:51 +05:30
cmt-channel-notify.test.js fix(e2e): stabilize CMT and main Detox/Maestro E2E flakes (#10301) 2026-11-04 13:07:51 +05:30
constants.js Detox/E2E: Scripts to run tests and save report (#6560) 2022-08-13 08:37:24 -04:00
disable_ios_autofill.js test(detox): re-submit RF→Detox migration without unintended UI changes (#9847) 2026-06-19 22:44:02 +05:30
e2e-run-breakdown.js ci(e2e): triage CMT failures per test and add run breakdown tool (#10279) 2026-10-27 08:18:48 +02:00
e2e-run-breakdown.test.js ci(e2e): triage CMT failures per test and add run breakdown tool (#10279) 2026-10-27 08:18:48 +02:00
failed-jest-specs.js ci(e2e): triage red Detox and Maestro runs against test history (#10172) 2026-10-26 10:26:45 +05:30
failed-jest-specs.test.js ci(e2e): triage red Detox and Maestro runs against test history (#10172) 2026-10-26 10:26:45 +05:30
generate_detox_config_ci.js test(detox): re-submit RF→Detox migration without unintended UI changes (#9847) 2026-06-19 22:44:02 +05:30
jest_stare.js test(detox): re-submit RF→Detox migration without unintended UI changes (#9847) 2026-06-19 22:44:02 +05:30
maestro_report.js test(e2e): close manual release-test gaps (#10125) 2026-09-11 09:48:02 +05:30
maestro_report.test.js test(e2e): close manual release-test gaps (#10125) 2026-09-11 09:48:02 +05:30
maestro_test_cases.js feat(e2e): Integrate TSIO reporting (#9925) 2026-07-23 06:43:28 +00:00
maestro-triage-evidence.js ci(e2e): triage red Detox and Maestro runs against test history (#10172) 2026-10-26 10:26:45 +05:30
maestro-triage-evidence.test.js ci(e2e): triage red Detox and Maestro runs against test history (#10172) 2026-10-26 10:26:45 +05:30
merge-jest-results-for-tsio.js E2E: run shared channels tests on CI, demo plugin v0.12.2 on all full-suite servers (#10267) 2026-10-27 11:42:07 +05:30
merge-jest-results-for-tsio.test.js E2E: run shared channels tests on CI, demo plugin v0.12.2 on all full-suite servers (#10267) 2026-10-27 11:42:07 +05:30
network-outage-specs.js E2E: CI flake fixes; bump Maestro 2.11.0 and Detox 20.51.4 (#10257) 2026-10-19 22:58:41 +05:30
network-outage-specs.test.js E2E: CI flake fixes; bump Maestro 2.11.0 and Detox 20.51.4 (#10257) 2026-10-19 22:58:41 +05:30
post_message_as.js Detox/E2E: Migrate e2e javascript to typescript (#6059) 2022-03-17 17:35:26 -07:00
report.js fix: stabilize server switch, saved posts, favorites, and related runtime races (#10122) 2026-09-09 00:35:15 +05:30
report.test.js fix: stabilize server switch, saved posts, favorites, and related runtime races (#10122) 2026-09-09 00:35:15 +05:30
rerun-failed.js ci(e2e): say whether each main-run failure is new, still failing, flaky or a setup problem (#10284) 2026-11-03 07:45:59 +05:30
rerun-failed.test.js ci(e2e): say whether each main-run failure is new, still failing, flaky or a setup problem (#10284) 2026-11-03 07:45:59 +05:30
resolve-tsio-job-config.sh ci(e2e): per-job TSIO report groups, commit statuses, and webhook sidecar (#9969) 2026-07-29 13:45:06 +05:30
retriable_cloud_error.js test(e2e): close manual release-test gaps (#10125) 2026-09-11 09:48:02 +05:30
retriable_cloud_error.test.js test(e2e): close manual release-test gaps (#10125) 2026-09-11 09:48:02 +05:30
spec-durations.js chore(e2e): Cache app builds. Skip E2E on docs only PR. (#9930) 2026-08-04 19:13:39 +05:30
test_cases.js chore(e2e): Fix e2e artifact upload path for CMT workflow (#9955) 2026-07-21 11:44:34 +03:00
triage-evidence.js ci(e2e): triage red Detox and Maestro runs against test history (#10172) 2026-10-26 10:26:45 +05:30
triage-evidence.test.js ci(e2e): triage red Detox and Maestro runs against test history (#10172) 2026-10-26 10:26:45 +05:30
tsio-channel-notify-rollup.js ci(e2e): say whether each main-run failure is new, still failing, flaky or a setup problem (#10284) 2026-11-03 07:45:59 +05:30
tsio-channel-notify-rollup.test.js ci(e2e): say whether each main-run failure is new, still failing, flaky or a setup problem (#10284) 2026-11-03 07:45:59 +05:30
tsio-report-status.js ci(e2e): enforce triage verdicts on PR and main E2E lanes by default (#10303) 2026-11-05 14:35:43 +05:30
tsio-report-status.test.js ci(e2e): enforce triage verdicts on PR and main E2E lanes by default (#10303) 2026-11-05 14:35:43 +05:30
tsio-triage-settle.js ci(e2e): enforce triage verdicts on PR and main E2E lanes by default (#10303) 2026-11-05 14:35:43 +05:30
tsio-triage-settle.test.js ci(e2e): enforce triage verdicts on PR and main E2E lanes by default (#10303) 2026-11-05 14:35:43 +05:30
webhook_utils.js Add Multiselect, Dynamic Select, Multiform, and Field Refresh Support for Interactive Dialogs (#9484) 2026-03-18 15:15:08 -06:00
write-tsio-failure-stub.mjs feat(e2e): Integrate TSIO reporting (#9925) 2026-07-23 06:43:28 +00:00
xml_escape.test.js Fix/detox hittest cluster (#10023) 2026-08-27 08:58:03 +05:30