Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
41 changes: 40 additions & 1 deletion .github/workflows/compatibility-matrix-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,33 @@ jobs:
description: "Compatibility Matrix Testing for ${{ inputs.DESKTOP_VERSION }} version"
status: pending

- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
continue-on-error: true
with:
ref: ${{ inputs.DESKTOP_VERSION }}
persist-credentials: false
sparse-checkout: |
e2e/utils/github-actions.js
sparse-checkout-cone-mode: false

- name: Post pending e2e/linux|macos|windows
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
continue-on-error: true
env:
DESKTOP_SHA: ${{ needs.calculate-commit-hash.outputs.DESKTOP_SHA }}
CMT_MATRIX: ${{ needs.calculate-commit-hash.outputs.CMT_MATRIX }}
with:
script: |
const {updateInitialOsStatuses} = require('./e2e/utils/github-actions.js');
const matrix = JSON.parse(process.env.CMT_MATRIX || '{}');
const platforms = (matrix.environment || []).map((env) => ({platform: env.os}));
await updateInitialOsStatuses({
github,
context,
sha: process.env.DESKTOP_SHA,
platforms,
});

# Input follows the below schema (Matterwick ≥ v0.4.16).
# {
# "environment": [
Expand Down Expand Up @@ -177,9 +204,11 @@ jobs:
persist-credentials: false
sparse-checkout: |
e2e/utils/tsio-report-status.js
e2e/utils/cmt-channel-notify.js
e2e/utils/github-actions.js
sparse-checkout-cone-mode: false

- name: Render TSIO summary + flip commit status
- name: Render TSIO summary + flip commit statuses
id: summary
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
Expand All @@ -192,13 +221,23 @@ jobs:
# matching failed test (hung worker teardown, crashed runner, npm ci
# failure) would otherwise still read as "100% passed".
UPSTREAM_JOBS_SUCCEEDED: ${{ needs.e2e.result == 'success' }}
CMT_MATRIX: ${{ needs.calculate-commit-hash.outputs.CMT_MATRIX }}
with:
script: |
const {canonicalizeOs} = require('./e2e/utils/github-actions.js');
const matrix = JSON.parse(process.env.CMT_MATRIX || '{}');
const expectedOs = [...new Set(
(matrix.environment || []).
map((env) => canonicalizeOs(env.os, env.runner)).
filter(Boolean),
)];
const {reportUrl, status, stats} = await require('./e2e/utils/tsio-report-status.js')({
core, context, github,
compositeIdentity: JSON.parse(process.env.TSIO_COMPOSITE_IDENTITY),
totalReportsExpected: parseInt(process.env.TSIO_TOTAL_REPORTS_EXPECTED, 10),
commitStatusContext: process.env.COMMIT_STATUS_CONTEXT,
perOsCommitStatuses: true,
expectedOs,
upstreamJobsSucceeded: process.env.UPSTREAM_JOBS_SUCCEEDED === 'true',
failOnTestFailures: true,
});
Expand Down
76 changes: 61 additions & 15 deletions .github/workflows/e2e-functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,30 @@ jobs:
run: |
# Matterwick still dispatches macos-latest; pin explicitly so the job
# does not drift when GitHub retargets that label to macOS 26.
platforms=$(echo "${INSTANCE_DETAILS}" | jq -c 'map(if .runner == "macos-latest" then .runner = "macos-26" else . end)')
# Normalize platform to canonical linux|macos|windows (derive from runner
# when needed) so job names and e2e/<os> statuses stay consistent.
platforms=$(echo "${INSTANCE_DETAILS}" | jq -c '
map(
(if .runner == "macos-latest" then .runner = "macos-26" else . end) |
. as $row |
($row.platform // $row.os // "") as $raw |
(
if $raw == "linux" or $raw == "macos" or $raw == "windows" then $raw
elif (($row.runner // "") | test("^(ubuntu|linux)")) then "linux"
elif (($row.runner // "") | test("^(macos|darwin)")) then "macos"
elif (($row.runner // "") | test("^windows")) then "windows"
else null
end
) as $canon |
if $canon == null then empty
else ($row | .platform = $canon | del(.os))
end
)
')
if [ "$(echo "${platforms}" | jq 'length')" -eq 0 ]; then
echo "No supported platforms in instance_details (need linux|macos|windows)" >&2
exit 1
fi
echo "platforms=${platforms}" >> "$GITHUB_OUTPUT"

# Resolve the SHA under test from version_name (branch/tag/SHA), not github.sha
Expand Down Expand Up @@ -98,7 +121,7 @@ jobs:
echo "composite-identity-json=${COMPOSITE_IDENTITY}" >> "$GITHUB_OUTPUT"

update-initial-status:
name: Set pending TSIO status
name: Set pending E2E OS statuses
runs-on: ubuntu-24.04
needs:
- prepare-matrix
Expand All @@ -108,16 +131,31 @@ jobs:
steps:
# Best-effort: a transient status-API hiccup here must never block the
# actual test matrix from running.
- uses: mattermost/actions/delivery/update-commit-status@218fd96a63451259dc100e1292a5e44af92fe15d
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
continue-on-error: true
with:
ref: ${{ inputs.version_name }}
persist-credentials: false
sparse-checkout: |
e2e/utils/github-actions.js
sparse-checkout-cone-mode: false

- name: Post pending e2e/linux|macos|windows (+ policy)
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLATFORMS: ${{ needs.prepare-matrix.outputs.platforms }}
DESKTOP_SHA: ${{ needs.prepare-matrix.outputs.desktop-sha }}
with:
repository_full_name: ${{ github.repository }}
commit_sha: ${{ needs.prepare-matrix.outputs.desktop-sha }}
context: e2e-test/desktop-playwright
description: "Running Electron Playwright E2E tests..."
status: pending
script: |
const {updateInitialOsStatuses} = require('./e2e/utils/github-actions.js');
await updateInitialOsStatuses({
github,
context,
sha: process.env.DESKTOP_SHA,
platforms: JSON.parse(process.env.PLATFORMS || '[]'),
includePolicy: true,
});

e2e-tests:
needs:
Expand All @@ -144,9 +182,8 @@ jobs:
tsio-config: ${{ format('{{"composite_identity":{0},"total_reports_expected":"{1}"}}', needs.prepare-matrix.outputs.tsio-composite-identity, needs.prepare-matrix.outputs.tsio-total-reports-expected) }}
secrets: inherit

# The single E2E status check for PR/master (e2e-test/desktop-playwright),
# replacing the former 5 (e2e/linux, e2e/macos, e2e/windows,
# policy-test/macos, policy-test/windows).
# Per-OS E2E commit statuses (e2e/linux, e2e/macos, e2e/windows) plus
# e2e/macos-policy and e2e/windows-policy for the dedicated policy legs.
#
# Uses e2e/utils/tsio-report-status.js, not test-system-io-summary — summary
# only reads /api/v1/orchestration/status, which report-upload never
Expand All @@ -171,26 +208,35 @@ jobs:
persist-credentials: false
sparse-checkout: |
e2e/utils/tsio-report-status.js
e2e/utils/cmt-channel-notify.js
e2e/utils/github-actions.js
sparse-checkout-cone-mode: false

- name: Render TSIO summary + flip commit status
- name: Render TSIO summary + flip per-OS commit statuses
id: summary
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
TSIO_COMPOSITE_IDENTITY: ${{ needs.prepare-matrix.outputs.tsio-composite-identity }}
TSIO_TOTAL_REPORTS_EXPECTED: ${{ needs.prepare-matrix.outputs.tsio-total-reports-expected }}
TSIO_POLL_ATTEMPTS: 12
TSIO_POLL_DELAY_MS: 5000
COMMIT_STATUS_CONTEXT: e2e-test/desktop-playwright
UPSTREAM_JOBS_SUCCEEDED: ${{ needs.e2e-tests.result == 'success' && needs.e2e-policy-tests.result == 'success' }}
PLATFORMS: ${{ needs.prepare-matrix.outputs.platforms }}
with:
script: |
const {canonicalizeOs, E2E_POLICY_OS_LIST} = require('./e2e/utils/github-actions.js');
const platforms = JSON.parse(process.env.PLATFORMS || '[]');
const expectedOs = [...new Set(
platforms.map((p) => canonicalizeOs(p.platform || p.os, p.runner)).filter(Boolean),
)];
const {reportUrl, status, stats} = await require('./e2e/utils/tsio-report-status.js')({
core, context, github,
compositeIdentity: JSON.parse(process.env.TSIO_COMPOSITE_IDENTITY),
totalReportsExpected: parseInt(process.env.TSIO_TOTAL_REPORTS_EXPECTED, 10),
upstreamJobsSucceeded: process.env.UPSTREAM_JOBS_SUCCEEDED === 'true',
commitStatusContext: process.env.COMMIT_STATUS_CONTEXT,
perOsCommitStatuses: true,
expectedOs,
expectedPolicyOs: E2E_POLICY_OS_LIST,
failOnTestFailures: true,
});
core.info(`TSIO report ${reportUrl}: ${status} (${JSON.stringify(stats)})`);
Expand Down
Loading
Loading