Skip to content

Doubao-powered voice input for Linux, Wayland and Omarchy

ci(workflow): shard Midscene desktop suites

quanru137edde15f89
diff --git a/.github/workflows/deploy-midscene-report.yml b/.github/workflows/deploy-midscene-report.yml
index 0774916..037275e 100644
--- a/.github/workflows/deploy-midscene-report.yml
+++ b/.github/workflows/deploy-midscene-report.yml
@@ -17,15 +17,19 @@ on:
type: string
primary-project:
description: Midscene Test project used for the main report and preview
- required: true
+ required: false
type: string
auxiliary-project:
description: Midscene Test project used for the second report and preview
- required: true
+ required: false
type: string
auxiliary-report-label:
description: Label for the second project report
- required: true
+ required: false
+ type: string
+ report-groups:
+ description: JSON groups used to combine independently executed projects
+ required: false
type: string
run-result:
description: Result of the job that produced the report artifact
@@ -72,20 +76,29 @@ jobs:
PRIMARY_PROJECT: ${{ inputs.primary-project }}
AUXILIARY_PROJECT: ${{ inputs.auxiliary-project }}
AUXILIARY_REPORT_LABEL: ${{ inputs.auxiliary-report-label }}
+ REPORT_GROUPS: ${{ inputs.report-groups }}
run: |
- node scripts/build-pages-report.mjs \
- --report-dir "$RUNNER_TEMP/midscene-report" \
- --site-dir "$RUNNER_TEMP/pages-site" \
- --run-id "$GITHUB_RUN_ID" \
- --workflow-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
- --generated-at "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
- --retention "$REPORT_RETENTION" \
- --pages-url "$PAGES_BASE_URL" \
- --label "$REPORT_LABEL" \
- --primary-project "$PRIMARY_PROJECT" \
- --primary-report-label "Doubao Say" \
- --auxiliary-project "$AUXILIARY_PROJECT" \
- --auxiliary-report-label "$AUXILIARY_REPORT_LABEL"
+ arguments=(
+ --report-dir "$RUNNER_TEMP/midscene-report"
+ --site-dir "$RUNNER_TEMP/pages-site"
+ --run-id "$GITHUB_RUN_ID"
+ --workflow-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
+ --generated-at "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
+ --retention "$REPORT_RETENTION"
+ --pages-url "$PAGES_BASE_URL"
+ --label "$REPORT_LABEL"
+ )
+ if [[ -n $REPORT_GROUPS ]]; then
+ arguments+=(--report-groups "$REPORT_GROUPS")
+ else
+ arguments+=(
+ --primary-project "$PRIMARY_PROJECT"
+ --primary-report-label "Doubao Say"
+ --auxiliary-project "$AUXILIARY_PROJECT"
+ --auxiliary-report-label "$AUXILIARY_REPORT_LABEL"
+ )
+ fi
+ node scripts/build-pages-report.mjs "${arguments[@]}"
- name: Upload the restricted Pages payload
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
diff --git a/.github/workflows/midscene-omarchy-4.0.3.yml b/.github/workflows/midscene-omarchy-4.0.3.yml
index af3ac70..1512993 100644
--- a/.github/workflows/midscene-omarchy-4.0.3.yml
+++ b/.github/workflows/midscene-omarchy-4.0.3.yml
@@ -4,7 +4,7 @@ run-name: Omarchy 4.0.3
on:
push:
branches: [main]
- paths:
+ paths: &e2e-paths
- ".github/workflows/midscene-omarchy-4.0.3.yml"
- ".github/workflows/deploy-midscene-report.yml"
- "scripts/build-pages-report.mjs"
@@ -33,33 +33,7 @@ on:
- "omarchy/**"
pull_request:
branches: [main]
- paths:
- - ".github/workflows/midscene-omarchy-4.0.3.yml"
- - ".github/workflows/deploy-midscene-report.yml"
- - "scripts/build-pages-report.mjs"
- - "scripts/report-cases.mjs"
- - "scripts/render-ci-report-summary.mjs"
- - "scripts/verify-pages-report.mjs"
- - "scripts/verify-omarchy-evidence.mjs"
- - "scripts/omarchy-shell-evidence.mjs"
- - "tests/contracts/test_pages_report_history.mjs"
- - "tests/e2e/package.json"
- - "tests/e2e/package-lock.json"
- - "tests/e2e/gtk_fixture.py"
- - "tests/e2e/gtk_onboarding_fixture.py"
- - "tests/e2e/gtk_runtime_fixture.py"
- - "tests/e2e/capture-report-preview.mjs"
- - "tests/e2e/cases/**"
- - "tests/e2e/midscene.config.ts"
- - "tests/e2e/run-omarchy-midscene.sh"
- - "tests/e2e/restore-omarchy-vm.sh"
- - "tests/e2e/omarchy-vm.env"
- - "src/**"
- - "manifest.json"
- - "install.sh"
- - "setup-omarchy.sh"
- - "start.sh"
- - "omarchy/**"
+ paths: *e2e-paths
workflow_dispatch:
permissions:
@@ -67,19 +41,27 @@ permissions:
packages: read
concurrency:
- # Keep only one pending run for this workflow and ref. Ubuntu, Omarchy, main,
- # and unrelated PRs must not replace one another in GitHub's concurrency queue.
group: midscene-model-e2e-${{ github.workflow }}-${{ github.ref }}
- # A newer PR commit supersedes its predecessor. Main runs remain serialized
- # so report publication always follows commit order.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
- omarchy-vm:
- name: Midscene onboarding and shell visuals
+ omarchy-e2e:
+ name: Midscene visual (${{ matrix.project }})
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
- timeout-minutes: 90
+ timeout-minutes: 60
+ strategy:
+ # Each shard restores an independent disposable VM. Sharing one Hyprland
+ # session would make fixture resets, focus and screenshots race.
+ fail-fast: false
+ max-parallel: 4
+ matrix:
+ project:
+ - omarchy-shard-1
+ - omarchy-shard-2
+ - omarchy-shard-3
+ - omarchy-shard-4
+ - omarchy-shell
env:
MIDSCENE_MODEL_API_KEY: ${{ secrets.MIDSCENE_MODEL_API_KEY }}
MIDSCENE_MODEL_NAME: ${{ secrets.MIDSCENE_MODEL_NAME }}
@@ -88,11 +70,9 @@ jobs:
MIDSCENE_MODEL_REASONING_ENABLED: ${{ secrets.MIDSCENE_MODEL_REASONING_ENABLED }}
MIDSCENE_COMPUTER_HEADLESS_LINUX: "true"
MIDSCENE_REPLANNING_CYCLE_LIMIT: "40"
- # GitHub runners intermittently time out while Node races IPv4 and IPv6
- # addresses. The configured model endpoint is reachable over IPv4.
+ # The configured model endpoint is reachable over IPv4; disabling Node's
+ # family race avoids intermittent runner-side IPv6 connection timeouts.
NODE_OPTIONS: "--dns-result-order=ipv4first --no-network-family-autoselection"
- outputs:
- report-artifact-id: ${{ steps.report.outputs.artifact-id }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
@@ -152,46 +132,73 @@ jobs:
done
exit 1
- - name: Run real Omarchy Midscene E2E
- run: tests/e2e/run-omarchy-midscene.sh
+ - name: Run real Omarchy Midscene project
+ env:
+ PROJECT: ${{ matrix.project }}
+ run: tests/e2e/run-omarchy-midscene.sh "$PROJECT"
- - name: Capture the report result for the CI summary
+ - name: Capture report evidence
if: always() && steps.test-dependencies.outcome == 'success'
+ env:
+ PROJECT: ${{ matrix.project }}
run: |
node tests/e2e/capture-report-preview.mjs \
--report-dir tests/e2e/midscene_run \
- --primary-project omarchy-onboarding \
- --auxiliary-project omarchy-shell
+ --projects "$PROJECT"
- name: Upload installer evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
- name: omarchy-vm-installer-evidence
+ name: omarchy-vm-installer-evidence-${{ matrix.project }}
path: .midscene-omarchy/omarchy-iso/test-runs/**/runs/**
if-no-files-found: warn
retention-days: 3
- - name: Upload Omarchy Midscene report
- id: report
+ - name: Upload Omarchy Midscene shard report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
- name: omarchy-midscene-e2e-report
+ name: omarchy-midscene-${{ matrix.project }}
path: tests/e2e/midscene_run/
if-no-files-found: warn
retention-days: 7
- - name: Verify visual evidence before publishing
- if: success()
+ - name: Verify Omarchy shell visual evidence
+ if: success() && matrix.project == 'omarchy-shell'
run: node scripts/verify-omarchy-evidence.mjs tests/e2e/midscene_run
+ report-bundle:
+ name: Assemble Midscene report bundle
+ needs: omarchy-e2e
+ if: always()
+ runs-on: ubuntu-latest
+ outputs:
+ report-artifact-id: ${{ steps.report.outputs.artifact-id }}
+ steps:
+ # Keep shard directories separate. Native report filenames can share a
+ # timestamp, while the Pages builder locates reports by project identity.
+ - name: Download every shard report
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ pattern: omarchy-midscene-*
+ path: ${{ runner.temp }}/midscene-report-shards
+
+ - name: Upload combined report bundle
+ id: report
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ with:
+ name: omarchy-midscene-e2e-report
+ path: ${{ runner.temp }}/midscene-report-shards/
+ if-no-files-found: error
+ retention-days: 7
+
pages-report:
name: GitHub Pages report
- needs: omarchy-vm
+ needs: [omarchy-e2e, report-bundle]
if: >-
always() &&
- needs.omarchy-vm.outputs.report-artifact-id != '' &&
+ needs.report-bundle.outputs.report-artifact-id != '' &&
github.event_name != 'pull_request' &&
github.ref_name == vars.PAGES_REPORT_BRANCH
permissions:
@@ -204,7 +211,6 @@ jobs:
artifact-name: omarchy-midscene-e2e-report
report-label: Omarchy 4.0.3
summary-title: Omarchy
- primary-project: omarchy-onboarding
- auxiliary-project: omarchy-shell
- auxiliary-report-label: Omarchy visual checks
- run-result: ${{ needs.omarchy-vm.result }}
+ report-groups: >-
+ [{"role":"primary","label":"Doubao Say","projects":["omarchy-shard-1","omarchy-shard-2","omarchy-shard-3","omarchy-shard-4"]},{"role":"auxiliary","label":"Omarchy visual checks","projects":["omarchy-shell"]}]
+ run-result: ${{ needs.omarchy-e2e.result }}
diff --git a/.github/workflows/midscene-ubuntu-22.04.yml b/.github/workflows/midscene-ubuntu-22.04.yml
index 5df4f37..276f4cb 100644
--- a/.github/workflows/midscene-ubuntu-22.04.yml
+++ b/.github/workflows/midscene-ubuntu-22.04.yml
@@ -4,7 +4,7 @@ run-name: Ubuntu 22.04
on:
push:
branches: [main]
- paths:
+ paths: &e2e-paths
- ".github/workflows/midscene-ubuntu-22.04.yml"
- ".github/workflows/deploy-midscene-report.yml"
- "scripts/build-pages-report.mjs"
@@ -24,43 +24,35 @@ on:
- "src/**"
pull_request:
branches: [main]
- paths:
- - ".github/workflows/midscene-ubuntu-22.04.yml"
- - ".github/workflows/deploy-midscene-report.yml"
- - "scripts/build-pages-report.mjs"
- - "scripts/report-cases.mjs"
- - "scripts/render-ci-report-summary.mjs"
- - "scripts/verify-pages-report.mjs"
- - "tests/contracts/test_pages_report_history.mjs"
- - "tests/e2e/package.json"
- - "tests/e2e/package-lock.json"
- - "tests/e2e/gtk_fixture.py"
- - "tests/e2e/gtk_onboarding_fixture.py"
- - "tests/e2e/gtk_runtime_fixture.py"
- - "tests/e2e/capture-report-preview.mjs"
- - "tests/e2e/polish_fixture.py"
- - "tests/e2e/cases/**"
- - "tests/e2e/midscene.config.ts"
- - "src/**"
+ paths: *e2e-paths
workflow_dispatch:
permissions:
contents: read
concurrency:
- # Keep only one pending run for this workflow and ref. Ubuntu, Omarchy, main,
- # and unrelated PRs must not replace one another in GitHub's concurrency queue.
group: midscene-model-e2e-${{ github.workflow }}-${{ github.ref }}
- # A newer PR commit supersedes its predecessor. Main runs remain serialized
- # so report publication always follows commit order.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
- ubuntu-gtk:
- name: Midscene onboarding and polishing visuals
+ ubuntu-e2e:
+ name: Midscene visual (${{ matrix.project }})
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-22.04
- timeout-minutes: 90
+ timeout-minutes: 45
+ strategy:
+ # Every matrix child owns its Xvfb display and fixture process. Keep
+ # concurrency at the Actions layer because ComputerAgent sets DISPLAY
+ # process-wide and cannot safely isolate concurrent projects in one job.
+ fail-fast: false
+ max-parallel: 4
+ matrix:
+ project:
+ - ubuntu-shard-1
+ - ubuntu-shard-2
+ - ubuntu-shard-3
+ - ubuntu-shard-4
+ - ubuntu-polishing
env:
MIDSCENE_MODEL_API_KEY: ${{ secrets.MIDSCENE_MODEL_API_KEY }}
MIDSCENE_MODEL_NAME: ${{ secrets.MIDSCENE_MODEL_NAME }}
@@ -69,11 +61,9 @@ jobs:
MIDSCENE_MODEL_REASONING_ENABLED: ${{ secrets.MIDSCENE_MODEL_REASONING_ENABLED }}
MIDSCENE_COMPUTER_HEADLESS_LINUX: "true"
MIDSCENE_REPLANNING_CYCLE_LIMIT: "40"
- # GitHub's Ubuntu 22.04 runner intermittently times out while Node races
- # IPv4 and IPv6 addresses. The model endpoint is reachable over IPv4.
+ # The configured model endpoint is reachable over IPv4; disabling Node's
+ # family race avoids intermittent runner-side IPv6 connection timeouts.
NODE_OPTIONS: "--dns-result-order=ipv4first --no-network-family-autoselection"
- outputs:
- report-artifact-id: ${{ steps.report.outputs.artifact-id }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
@@ -131,8 +121,7 @@ jobs:
id: test-dependencies
working-directory: tests/e2e
# sharp's platform packages are pinned explicitly. Skipping lifecycle
- # scripts avoids an npm ordering bug that tries to build sharp before
- # those prebuilt packages are linked.
+ # scripts avoids npm trying to build sharp before those packages link.
run: |
for attempt in 1 2 3; do
if npm ci --include=optional --ignore-scripts; then
@@ -143,46 +132,64 @@ jobs:
done
exit 1
- - name: Run Ubuntu 22.04 Midscene E2E
- working-directory: tests/e2e
- env:
- NODE_OPTIONS: --dns-result-order=ipv4first --no-network-family-autoselection --require=./node_modules/@computer-use/libnut/dist/import_libnut.js
- run: >-
- timeout --signal=TERM --kill-after=10s 50m
- npm test -- --project ubuntu
-
- - name: Verify polishing overlay with Midscene
+ - name: Run Midscene project
working-directory: tests/e2e
env:
+ PROJECT: ${{ matrix.project }}
NODE_OPTIONS: --dns-result-order=ipv4first --no-network-family-autoselection --require=./node_modules/@computer-use/libnut/dist/import_libnut.js
run: >-
timeout --signal=TERM --kill-after=10s 35m
- npm test -- --project ubuntu-polishing
+ npm test -- --project "$PROJECT"
- - name: Capture the report result for the CI summary
+ - name: Capture report evidence
if: always() && steps.test-dependencies.outcome == 'success'
+ env:
+ PROJECT: ${{ matrix.project }}
run: |
node tests/e2e/capture-report-preview.mjs \
--report-dir tests/e2e/midscene_run \
- --primary-project ubuntu \
- --auxiliary-project ubuntu-polishing
+ --projects "$PROJECT"
- - name: Upload Midscene report
- id: report
+ - name: Upload Midscene shard report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
- name: midscene-ubuntu-22.04-e2e-report
+ name: midscene-ubuntu-22.04-${{ matrix.project }}
path: tests/e2e/midscene_run/
if-no-files-found: warn
retention-days: 7
+ report-bundle:
+ name: Assemble Midscene report bundle
+ needs: ubuntu-e2e
+ if: always()
+ runs-on: ubuntu-latest
+ outputs:
+ report-artifact-id: ${{ steps.report.outputs.artifact-id }}
+ steps:
+ # Keep shard directories separate. Native report filenames can share a
+ # timestamp, while the Pages builder locates reports by project identity.
+ - name: Download every shard report
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ pattern: midscene-ubuntu-22.04-*
+ path: ${{ runner.temp }}/midscene-report-shards
+
+ - name: Upload combined report bundle
+ id: report
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ with:
+ name: midscene-ubuntu-22.04-e2e-report
+ path: ${{ runner.temp }}/midscene-report-shards/
+ if-no-files-found: error
+ retention-days: 7
+
pages-report:
name: GitHub Pages report
- needs: ubuntu-gtk
+ needs: [ubuntu-e2e, report-bundle]
if: >-
always() &&
- needs.ubuntu-gtk.outputs.report-artifact-id != '' &&
+ needs.report-bundle.outputs.report-artifact-id != '' &&
github.event_name != 'pull_request' &&
github.ref_name == vars.PAGES_REPORT_BRANCH
permissions:
@@ -195,7 +202,6 @@ jobs:
artifact-name: midscene-ubuntu-22.04-e2e-report
report-label: Ubuntu 22.04
summary-title: Ubuntu
- primary-project: ubuntu
- auxiliary-project: ubuntu-polishing
- auxiliary-report-label: Polishing overlay report
- run-result: ${{ needs.ubuntu-gtk.result }}
+ report-groups: >-
+ [{"role":"primary","label":"Doubao Say","projects":["ubuntu-shard-1","ubuntu-shard-2","ubuntu-shard-3","ubuntu-shard-4"]},{"role":"auxiliary","label":"Polishing overlay report","projects":["ubuntu-polishing"]}]
+ run-result: ${{ needs.ubuntu-e2e.result }}
diff --git a/scripts/build-pages-report.mjs b/scripts/build-pages-report.mjs
index 216d4cb..390459a 100644
--- a/scripts/build-pages-report.mjs
+++ b/scripts/build-pages-report.mjs
@@ -16,8 +16,8 @@ import {
} from './omarchy-shell-evidence.mjs';
import { reportCases } from './report-cases.mjs';
-const MANIFEST_VERSION = 4;
-const SUPPORTED_MANIFEST_VERSIONS = new Set([1, 2, 3, MANIFEST_VERSION]);
+const MANIFEST_VERSION = 5;
+const SUPPORTED_MANIFEST_VERSIONS = new Set([1, 2, 3, 4, MANIFEST_VERSION]);
function parseArguments(argv) {
const options = {};
@@ -40,6 +40,65 @@ function required(options, name) {
return value;
}
+function parseReportGroups(options) {
+ if (!options['report-groups']) return null;
+ let groups;
+ try {
+ groups = JSON.parse(options['report-groups']);
+ } catch (error) {
+ throw new Error(`Invalid --report-groups JSON: ${error.message}`);
+ }
+ if (
+ !Array.isArray(groups) ||
+ groups.length === 0 ||
+ groups.some(
+ (group) =>
+ !['primary', 'auxiliary'].includes(group.role) ||
+ typeof group.label !== 'string' ||
+ !Array.isArray(group.projects) ||
+ group.projects.length === 0 ||
+ group.projects.some(
+ (project) =>
+ typeof project !== 'string' || !/^[a-z0-9-]+$/.test(project),
+ ),
+ )
+ ) {
+ throw new Error('--report-groups must describe labeled project groups');
+ }
+ const projects = groups.flatMap((group) => group.projects);
+ if (new Set(projects).size !== projects.length) {
+ throw new Error('--report-groups cannot contain duplicate projects');
+ }
+ return groups;
+}
+
+function projectSlug(project) {
+ const slug = project
+ .toLowerCase()
+ .replace(/[^a-z0-9]+/g, '-')
+ .replace(/^-|-$/g, '');
+ if (!slug) throw new Error(`Cannot build a filename for project ${project}`);
+ return slug;
+}
+
+async function findUniqueFile(directory, basename) {
+ const matches = [];
+ async function visit(current) {
+ for (const entry of await readdir(current, { withFileTypes: true })) {
+ const item = path.join(current, entry.name);
+ if (entry.isDirectory()) await visit(item);
+ else if (entry.isFile() && entry.name === basename) matches.push(item);
+ }
+ }
+ await visit(directory);
+ if (matches.length !== 1) {
+ throw new Error(
+ `Expected one ${basename} in the report bundle, found ${matches.length}`,
+ );
+ }
+ return matches[0];
+}
+
function validateRunId(value) {
if (!/^\d+$/.test(value)) {
throw new Error('Run ID must contain digits only');
@@ -138,6 +197,7 @@ function collectAssertionResults(run) {
}
function buildReportEntry({
+ includeCaseReportPath = false,
label,
previewPath,
project,
@@ -157,6 +217,7 @@ function buildReportEntry({
description: testCase.description,
descriptionKind: testCase.descriptionKind,
previewPath: `${path.posix.dirname(reportPath)}/${testCase.previewFile}`,
+ ...(includeCaseReportPath ? { reportPath } : {}),
}));
return {
role,
@@ -175,6 +236,101 @@ function buildReportEntry({
};
}
+function buildReportGroup({ label, reports, role }) {
+ const reportEntries = reports.map((item) =>
+ buildReportEntry({
+ ...item,
+ includeCaseReportPath: true,
+ label,
+ role,
+ }),
+ );
+ const sum = (field, nested) =>
+ reportEntries.reduce((total, entry) => total + entry[field][nested], 0);
+ const status = reportEntries.every((entry) => entry.status === 'success')
+ ? 'success'
+ : 'failed';
+ return {
+ role,
+ projects: reportEntries.map((entry) => entry.project),
+ label,
+ status,
+ previewStep: status === 'success' ? 'last' : 'last-error',
+ reports: reportEntries.map((entry) => ({
+ project: entry.project,
+ status: entry.status,
+ previewStep: entry.previewStep,
+ reportPath: entry.reportPath,
+ previewPath: entry.previewPath,
+ })),
+ scenarios: {
+ passed: sum('scenarios', 'passed'),
+ total: sum('scenarios', 'total'),
+ },
+ assertions: {
+ passed: sum('assertions', 'passed'),
+ total: sum('assertions', 'total'),
+ },
+ cases: reportEntries.flatMap((entry) => entry.cases),
+ };
+}
+
+function validReportEntry(entry, files) {
+ const legacyReport =
+ typeof entry.project === 'string' &&
+ typeof entry.reportPath === 'string' &&
+ typeof entry.previewPath === 'string' &&
+ files?.includes(entry.reportPath) &&
+ files?.includes(entry.previewPath);
+ const shardedReport =
+ Array.isArray(entry.projects) &&
+ entry.projects.length > 0 &&
+ entry.projects.every((project) => typeof project === 'string') &&
+ Array.isArray(entry.reports) &&
+ entry.reports.length === entry.projects.length &&
+ entry.reports.every(
+ (report) =>
+ typeof report.project === 'string' &&
+ typeof report.status === 'string' &&
+ ['last', 'last-error'].includes(report.previewStep) &&
+ files?.includes(report.reportPath) &&
+ files?.includes(report.previewPath),
+ );
+ return (
+ ['primary', 'auxiliary'].includes(entry.role) &&
+ typeof entry.label === 'string' &&
+ typeof entry.status === 'string' &&
+ ['last', 'last-error'].includes(entry.previewStep) &&
+ (legacyReport || shardedReport) &&
+ Number.isInteger(entry.scenarios?.passed) &&
+ Number.isInteger(entry.scenarios?.total) &&
+ Number.isInteger(entry.assertions?.passed) &&
+ Number.isInteger(entry.assertions?.total) &&
+ (entry.cases === undefined ||
+ (Array.isArray(entry.cases) &&
+ entry.cases.every(
+ (testCase) =>
+ typeof testCase.caseId === 'string' &&
+ typeof testCase.name === 'string' &&
+ ['success', 'failed'].includes(testCase.status) &&
+ typeof testCase.stepId === 'string' &&
+ ['last-screenshot', 'first-failing-screenshot'].includes(
+ testCase.selection,
+ ) &&
+ (testCase.description === undefined ||
+ (typeof testCase.description === 'string' &&
+ testCase.description.length > 0)) &&
+ (testCase.descriptionKind === undefined ||
+ ['ai', 'error', 'result'].includes(testCase.descriptionKind)) &&
+ (testCase.description === undefined) ===
+ (testCase.descriptionKind === undefined) &&
+ files?.includes(testCase.previewPath) &&
+ (testCase.reportPath === undefined ||
+ files?.includes(testCase.reportPath)),
+ )))
+ );
+}
+
function validateHistoryManifest(manifest) {
if (
!manifest ||
@@ -199,42 +355,7 @@ function validateHistoryManifest(manifest) {
))) ||
(report.entries !== undefined &&
(!Array.isArray(report.entries) ||
- report.entries.some(
- (entry) =>
- !['primary', 'auxiliary'].includes(entry.role) ||
- typeof entry.project !== 'string' ||
- typeof entry.label !== 'string' ||
- typeof entry.status !== 'string' ||
- !['last', 'last-error'].includes(entry.previewStep) ||
- !report.files?.includes(entry.reportPath) ||
- !report.files?.includes(entry.previewPath) ||
- !Number.isInteger(entry.scenarios?.passed) ||
- !Number.isInteger(entry.scenarios?.total) ||
- !Number.isInteger(entry.assertions?.passed) ||
- !Number.isInteger(entry.assertions?.total) ||
- (entry.cases !== undefined &&
- (!Array.isArray(entry.cases) ||
- entry.cases.some(
- (testCase) =>
- typeof testCase.caseId !== 'string' ||
- typeof testCase.name !== 'string' ||
- !['success', 'failed'].includes(testCase.status) ||
- typeof testCase.stepId !== 'string' ||
- !['last-screenshot', 'first-failing-screenshot'].includes(
- testCase.selection,
- ) ||
- (testCase.description !== undefined &&
- (typeof testCase.description !== 'string' ||
- testCase.description.length === 0)) ||
- (testCase.descriptionKind !== undefined &&
- !['ai', 'error', 'result'].includes(
- testCase.descriptionKind,
- )) ||
- ((testCase.description === undefined) !==
- (testCase.descriptionKind === undefined)) ||
- !report.files?.includes(testCase.previewPath),
- ))),
- )))
+ report.entries.some((entry) => !validReportEntry(entry, report.files))))
) {
throw new Error(
'Existing Pages manifest contains an invalid report entry',
@@ -304,11 +425,22 @@ function formatDuration(durationMs) {
}
function runStepHref(entry, testCase) {
- return `${path.basename(entry.reportPath)}#${new URLSearchParams({
+ const reportPath = testCase.reportPath ?? entry.reportPath;
+ return `${path.basename(reportPath)}#${new URLSearchParams({
'runner-step': testCase.stepId,
})}`;
}
+function nativeReportLinks(entry) {
+ const reports = entry.reports ?? [entry];
+ return reports
+ .map((report, index) => {
+ const suffix = reports.length > 1 ? ` ${index + 1}` : '';
+ return `<a class="native-report" href="${escapeHtml(path.basename(report.reportPath))}">Open native Midscene report${suffix} →</a>`;
+ })
+ .join(' ');
+}
+
function buildRunIndex(report) {
const sections = report.entries
.map((entry) => {
@@ -338,7 +470,7 @@ function buildRunIndex(report) {
<h2>${escapeHtml(entry.label)}</h2>
<p>${entry.scenarios.passed}/${entry.scenarios.total} cases passed</p>
</div>
- <a class="native-report" href="${escapeHtml(path.basename(entry.reportPath))}">Open native Midscene report →</a>
+ <div>${nativeReportLinks(entry)}</div>
</div>
<div class="table-wrap">
<table>
@@ -458,11 +590,19 @@ export async function buildPagesReport(options) {
const retention = validateRetention(required(options, 'retention'));
const baseUrl = normalizeBaseUrl(required(options, 'pages-url'));
const label = options.label || 'Midscene E2E';
- const primaryProject = required(options, 'primary-project');
+ const reportGroups = parseReportGroups(options);
+ const primaryProject = reportGroups
+ ? null
+ : required(options, 'primary-project');
const primaryReportLabel = options['primary-report-label'] || 'Doubao Say';
- const auxiliaryProject = options['auxiliary-project'];
- const auxiliaryReportLabel = options['auxiliary-report-label'];
- if (Boolean(auxiliaryProject) !== Boolean(auxiliaryReportLabel)) {
+ const auxiliaryProject = reportGroups ? null : options['auxiliary-project'];
+ const auxiliaryReportLabel = reportGroups
+ ? null
+ : options['auxiliary-report-label'];
+ if (
+ !reportGroups &&
+ Boolean(auxiliaryProject) !== Boolean(auxiliaryReportLabel)
+ ) {
throw new Error(
'--auxiliary-project and --auxiliary-report-label must be provided together',
);
@@ -503,14 +643,124 @@ export async function buildPagesReport(options) {
report.run?.projects?.length === 1 &&
report.run.projects[0].name === projectName,
);
- const primaryReport = reportForProject(primaryProject);
- if (!primaryReport) {
- throw new Error(`No Midscene Test report found for project ${primaryProject}`);
+ const reportPrefix = `reports/${runId}`;
+ let selectedReports;
+ let entries;
+ let baseFiles;
+ let reportCopies;
+ if (reportGroups) {
+ const groupedReports = reportGroups.map((group) => ({
+ ...group,
+ reports: group.projects.map((project) => {
+ const report = reportForProject(project);
+ if (!report) {
+ throw new Error(`No Midscene Test report found for project ${project}`);
+ }
+ const slug = projectSlug(project);
+ return {
+ project,
+ report,
+ reportPath: `${reportPrefix}/native-report-${slug}.html`,
+ previewPath: `${reportPrefix}/report-preview-${slug}.png`,
+ };
+ }),
+ }));
+ selectedReports = groupedReports.flatMap((group) =>
+ group.reports.map((item) => item.report),
+ );
+ entries = groupedReports.map((group) => buildReportGroup(group));
+ reportCopies = groupedReports.flatMap((group) =>
+ group.reports.flatMap((item) => [
+ {
+ source: item.report.file,
+ destination: path.basename(item.reportPath),
+ },
+ {
+ sourceName: path.basename(item.previewPath),
+ destination: path.basename(item.previewPath),
+ },
+ ]),
+ );
+ baseFiles = [
+ `${reportPrefix}/index.html`,
+ ...entries.flatMap((entry) =>
+ entry.reports.flatMap((report) => [
+ report.reportPath,
+ report.previewPath,
+ ]),
+ ),
+ ];
+ } else {
+ const primaryReport = reportForProject(primaryProject);
+ if (!primaryReport) {
+ throw new Error(
+ `No Midscene Test report found for project ${primaryProject}`,
+ );
+ }
+ const auxiliaryReport = auxiliaryProject
+ ? reportForProject(auxiliaryProject)
+ : null;
+ selectedReports = [primaryReport, auxiliaryReport].filter(Boolean);
+ const primaryNativeReport = `${reportPrefix}/native-report.html`;
+ const auxiliaryNativeReport = `${reportPrefix}/auxiliary-report.html`;
+ baseFiles = auxiliaryReport
+ ? [
+ 'index.html',
+ 'native-report.html',
+ 'auxiliary-report.html',
+ 'report-preview.png',
+ 'auxiliary-report-preview.png',
+ ].map((name) => `${reportPrefix}/${name}`)
+ : [
+ `${reportPrefix}/index.html`,
+ primaryNativeReport,
+ `${reportPrefix}/report-preview.png`,
+ ];
+ entries = [
+ buildReportEntry({
+ role: 'primary',
+ project: primaryProject,
+ label: primaryReportLabel,
+ report: primaryReport,
+ reportPath: primaryNativeReport,
+ previewPath: `${reportPrefix}/report-preview.png`,
+ }),
+ ...(auxiliaryReport
+ ? [
+ buildReportEntry({
+ role: 'auxiliary',
+ project: auxiliaryProject,
+ label: auxiliaryReportLabel,
+ report: auxiliaryReport,
+ reportPath: auxiliaryNativeReport,
+ previewPath: `${reportPrefix}/auxiliary-report-preview.png`,
+ }),
+ ]
+ : []),
+ ];
+ reportCopies = [
+ {
+ source: primaryReport.file,
+ destination: 'native-report.html',
+ },
+ {
+ sourceName: 'report-preview.png',
+ destination: 'report-preview.png',
+ },
+ ...(auxiliaryReport
+ ? [
+ {
+ source: auxiliaryReport.file,
+ destination: 'auxiliary-report.html',
+ },
+ {
+ sourceName: 'auxiliary-report-preview.png',
+ destination: 'auxiliary-report-preview.png',
+ },
+ ]
+ : []),
+ ];
}
- const auxiliaryReport = auxiliaryProject
- ? reportForProject(auxiliaryProject)
- : null;
- const selectedReports = [primaryReport, auxiliaryReport].filter(Boolean);
const selectedFiles = new Set(selectedReports.map((report) => report.file));
const unexpectedProjects = htmlReports
.filter((report) => !selectedFiles.has(report.file))
@@ -532,44 +782,6 @@ export async function buildPagesReport(options) {
}),
{ passed: 0, tests: 0 },
);
- const reportPrefix = `reports/${runId}`;
- const primaryNativeReport = `${reportPrefix}/native-report.html`;
- const auxiliaryNativeReport = `${reportPrefix}/auxiliary-report.html`;
- const baseFiles = auxiliaryReport
- ? [
- 'index.html',
- 'native-report.html',
- 'auxiliary-report.html',
- 'report-preview.png',
- 'auxiliary-report-preview.png',
- ].map((name) => `${reportPrefix}/${name}`)
- : [
- `${reportPrefix}/index.html`,
- primaryNativeReport,
- `${reportPrefix}/report-preview.png`,
- ];
- const entries = [
- buildReportEntry({
- role: 'primary',
- project: primaryProject,
- label: primaryReportLabel,
- report: primaryReport,
- reportPath: primaryNativeReport,
- previewPath: `${reportPrefix}/report-preview.png`,
- }),
- ...(auxiliaryReport
- ? [
- buildReportEntry({
- role: 'auxiliary',
- project: auxiliaryProject,
- label: auxiliaryReportLabel,
- report: auxiliaryReport,
- reportPath: auxiliaryNativeReport,
- previewPath: `${reportPrefix}/auxiliary-report-preview.png`,
- }),
- ]
- : []),
- ];
const casePreviewFiles = entries.flatMap((entry) =>
entry.cases.map((testCase) => testCase.previewPath),
);
@@ -600,25 +812,19 @@ export async function buildPagesReport(options) {
const currentDirectory = path.join(siteDirectory, reportPrefix);
await mkdir(currentDirectory, { recursive: true });
- if (auxiliaryReport) {
- await copyFile(primaryReport.file, path.join(currentDirectory, 'native-report.html'));
- await copyFile(auxiliaryReport.file, path.join(currentDirectory, 'auxiliary-report.html'));
- await copyFile(path.join(reportDirectory, 'report-preview.png'), path.join(currentDirectory, 'report-preview.png'));
- await copyFile(
- path.join(reportDirectory, 'auxiliary-report-preview.png'),
- path.join(currentDirectory, 'auxiliary-report-preview.png'),
- );
- } else {
- await copyFile(primaryReport.file, path.join(currentDirectory, 'native-report.html'));
- await copyFile(
- path.join(reportDirectory, 'report-preview.png'),
- path.join(currentDirectory, 'report-preview.png'),
- );
+ for (const reportCopy of reportCopies) {
+ const source =
+ reportCopy.source ??
+ (await findUniqueFile(reportDirectory, reportCopy.sourceName));
+ await copyFile(source, path.join(currentDirectory, reportCopy.destination));
}
for (const entry of entries) {
for (const testCase of entry.cases) {
await copyFile(
- path.join(reportDirectory, path.basename(testCase.previewPath)),
+ await findUniqueFile(
+ reportDirectory,
+ path.basename(testCase.previewPath),
+ ),
path.join(currentDirectory, path.basename(testCase.previewPath)),
);
}
diff --git a/scripts/render-ci-report-summary.mjs b/scripts/render-ci-report-summary.mjs
index f94f099..f76ba5b 100644
--- a/scripts/render-ci-report-summary.mjs
+++ b/scripts/render-ci-report-summary.mjs
@@ -88,10 +88,13 @@ export function renderReportSummary({
}`;
const historyUrl = normalizedBaseUrl(pagesUrl).href;
const links = [
- ...report.entries.map(
- (entry) =>
- `[Open ${entry.label}](${reportUrl(pagesUrl, entry.reportPath)})`,
- ),
+ ...report.entries.flatMap((entry) => {
+ const reports = entry.reports ?? [entry];
+ return reports.map((nativeReport, index) => {
+ const suffix = reports.length > 1 ? ` ${index + 1}` : '';
+ return `[Open ${entry.label}${suffix}](${reportUrl(pagesUrl, nativeReport.reportPath)})`;
+ });
+ }),
`[Report history](${historyUrl})`,
].join(' · ');
const caseTables = report.entries.map((entry) => {
@@ -102,7 +105,11 @@ export function renderReportSummary({
if (!testCase.description || !testCase.descriptionKind) {
throw new Error(`${testCase.name} does not contain node text evidence`);
}
- const target = stepUrl(pagesUrl, entry.reportPath, testCase.stepId);
+ const target = stepUrl(
+ pagesUrl,
+ testCase.reportPath ?? entry.reportPath,
+ testCase.stepId,
+ );
const image = reportUrl(pagesUrl, testCase.previewPath);
const status = testCase.status === 'success' ? '✅ Passed' : '❌ Failed';
const evidence =
diff --git a/tests/contracts/test_pages_report_history.mjs b/tests/contracts/test_pages_report_history.mjs
index 222b921..177ae3d 100644
--- a/tests/contracts/test_pages_report_history.mjs
+++ b/tests/contracts/test_pages_report_history.mjs
@@ -14,6 +14,37 @@ import { reportCases } from '../../scripts/report-cases.mjs';
import { renderReportSummary } from '../../scripts/render-ci-report-summary.mjs';
import { verifyPublishedReport } from '../../scripts/verify-pages-report.mjs';
+test('assigns every product case to exactly one balanced shard', async () => {
+ const shardCounts = new Map();
+ let caseCount = 0;
+ for (const file of [
+ 'onboarding.yaml',
+ 'onboarding-regressions.yaml',
+ 'runtime.yaml',
+ ]) {
+ const source = await readFile(
+ new URL(`../e2e/cases/${file}`, import.meta.url),
+ 'utf8',
+ );
+ const cases = source
+ .split(/(?=^ - name:)/m)
+ .filter((section) => section.startsWith(' - name:'));
+ for (const testCase of cases) {
+ const tags = [...testCase.matchAll(/^ tags: \[(shard-[1-4])\]$/gm)];
+ assert.equal(tags.length, 1, testCase.split('\n')[0]);
+ shardCounts.set(tags[0][1], (shardCounts.get(tags[0][1]) ?? 0) + 1);
+ caseCount += 1;
+ }
+ }
+ assert.equal(caseCount, 13);
+ assert.deepEqual(Object.fromEntries(shardCounts), {
+ 'shard-1': 2,
+ 'shard-2': 3,
+ 'shard-3': 4,
+ 'shard-4': 4,
+ });
+});
+
function runnerScript({
assertionCount = 0,
assertionAttempts,
@@ -240,6 +271,80 @@ test('simulates a first deployment when Pages returns 404', async (context) => {
);
});
+test('combines independently executed shards into one report table', async (context) => {
+ const root = await mkdtemp(path.join(os.tmpdir(), 'pages-shards-'));
+ const reportDirectory = path.join(root, 'bundle');
+ for (const project of ['ubuntu-shard-1', 'ubuntu-shard-2']) {
+ const shardDirectory = path.join(reportDirectory, project);
+ const htmlDirectory = path.join(shardDirectory, 'report');
+ await mkdir(htmlDirectory, { recursive: true });
+ await writeFile(
+ path.join(htmlDirectory, `test-run-${project}.html`),
+ runnerScript({ project, startedAt: '2026-09-15T12:00:00Z' }),
+ );
+ await writeFile(
+ path.join(shardDirectory, `report-preview-${project}.png`),
+ `${project} preview`,
+ );
+ await writeFile(
+ path.join(
+ shardDirectory,
+ `case-preview-${project}-case-${project}.jpg`,
+ ),
+ `${project} case preview`,
+ );
+ }
+ const siteDirectory = path.join(root, 'site');
+ const server = await startServer((_request, response) =>
+ response.writeHead(404).end(),
+ );
+ context.after(server.close);
+
+ const manifest = await buildPagesReport({
+ ...options(reportDirectory, siteDirectory, server.url),
+ 'report-groups': JSON.stringify([
+ {
+ role: 'primary',
+ label: 'Doubao Say',
+ projects: ['ubuntu-shard-1', 'ubuntu-shard-2'],
+ },
+ ]),
+ });
+
+ const [entry] = manifest.reports[0].entries;
+ assert.deepEqual(entry.projects, ['ubuntu-shard-1', 'ubuntu-shard-2']);
+ assert.equal(entry.cases.length, 2);
+ assert.equal(entry.scenarios.total, 2);
+ assert.notEqual(entry.cases[0].reportPath, entry.cases[1].reportPath);
+ const runIndex = await readFile(
+ path.join(siteDirectory, 'reports', '200', 'index.html'),
+ 'utf8',
+ );
+ assert.match(
+ runIndex,
+ /native-report-ubuntu-shard-1\.html#runner-step=assert-0-0/,
+ );
+ assert.match(
+ runIndex,
+ /native-report-ubuntu-shard-2\.html#runner-step=assert-0-0/,
+ );
+ const summary = renderReportSummary({
+ manifest,
+ pagesUrl: 'https://example.test/doubao-say/',
+ producerResult: 'success',
+ runId: '200',
+ summaryTitle: 'Ubuntu',
+ });
+ assert.match(
+ summary,
+ /native-report-ubuntu-shard-1\.html#runner-step=assert-0-0/,
+ );
+ assert.match(
+ summary,
+ /native-report-ubuntu-shard-2\.html#runner-step=assert-0-0/,
+ );
+});
+
test('publishes the Doubao Say report as the primary CI entrance', async (context) => {
const root = await mkdtemp(path.join(os.tmpdir(), 'pages-omarchy-'));
const reportDirectory = await fixtureDirectory(root);
@@ -561,7 +666,7 @@ test('restores retained history before adding the new run', async (context) => {
'utf8',
),
);
- assert.equal(writtenManifest.version, 4);
+ assert.equal(writtenManifest.version, 5);
assert.equal(writtenManifest.reports[0].reportPath, 'reports/200/index.html');
assert.equal(
writtenManifest.reports[0].workflowUrl,
diff --git a/tests/e2e/README.md b/tests/e2e/README.md
index a8bf21f..453073f 100644
--- a/tests/e2e/README.md
+++ b/tests/e2e/README.md
@@ -52,19 +52,22 @@ Both distributions execute the same 13 declarative product cases from
`cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, and
`cases/runtime.yaml`, including synthetic microphone, voice, regression, and
post-setup dictation checks. `midscene.config.ts` passes each case
-identity to a fresh fixture, prepares the local Xvfb desktop, GTK fixture or
+identity to a fresh fixture. Four duration-balanced shards run in isolated
+Actions jobs, each with its own Xvfb desktop or Omarchy VM, while cases inside
+one shard remain serial so window focus cannot leak between tests. The config prepares the GTK fixture or
Omarchy VNC viewer, and resets that state for every retry. Custom `shell.*`
Nodes prepare the real Omarchy menu and bar; `cases/omarchy-shell.yaml` keeps
the three pixel-level assertions explicit. Run `npm run nodes` in this
directory to regenerate the Node reference, or
-`npm test -- --project ubuntu` on a prepared Linux desktop.
+`npm test -- --project ubuntu-shard-1` on a prepared Linux desktop.
Projects use Midscene Test's case-level `retry` setting, so a failed model
attempt is rerun with a fresh fixture while successful cases are kept. Every
attempt remains visible in the generated report.
-Each invocation writes a unified Midscene Test HTML report under
-`midscene_run/report/`; CI publishes those reports and renders each project's
-final node as its entrance image. A failed project instead opens and captures
-its most recent error node, so the summary shows the relevant failure detail.
+Each shard writes a Midscene Test HTML report under `midscene_run/report/`.
+CI keeps the native reports separate, then aggregates their cases into one
+evidence table. Every row links to its exact native report node. A failed
+project captures its first failing screenshot, so the summary shows the
+relevant failure detail.
The Ubuntu stage maps the real GTK onboarding window inside the
headless Midscene desktop. Its synthetic fixture starts signed out, opens an
@@ -127,9 +130,10 @@ synthetic callbacks. They do not establish live ASR, recording, durable
credential persistence, system-wide shortcut capture, clipboard paste, or
delivery into an unrelated application.
-Run `npm test -- --project ubuntu` with the system dependencies and model
-configuration from the Ubuntu workflow. The Omarchy projects retain their shared
-onboarding and shell cases.
+Run `npm test -- --project ubuntu-shard-1` with the system dependencies and
+model configuration from the Ubuntu workflow. Replace the final number with
+`2`, `3`, or `4` to run another duration-balanced shard. Omarchy uses the
+matching `omarchy-shard-*` projects and a separate shell project.
## Polishing overlay regression
diff --git a/tests/e2e/capture-report-preview.mjs b/tests/e2e/capture-report-preview.mjs
index eb7eac9..62a2e6a 100644
--- a/tests/e2e/capture-report-preview.mjs
+++ b/tests/e2e/capture-report-preview.mjs
@@ -28,8 +28,20 @@ const reportDirectory = path.resolve(
);
const primaryProject = options['primary-project'];
const auxiliaryProject = options['auxiliary-project'];
-if (!primaryProject) throw new Error('Missing --primary-project');
-if (!auxiliaryProject) throw new Error('Missing --auxiliary-project');
+const projects = options.projects
+ ? options.projects.split(',').map((value) => value.trim()).filter(Boolean)
+ : [primaryProject, auxiliaryProject].filter(Boolean);
+if (projects.length === 0) {
+ throw new Error('Missing --projects or --primary-project');
+}
+const projectSlug = (projectName) => {
+ const slug = projectName
+ .toLowerCase()
+ .replace(/[^a-z0-9]+/g, '-')
+ .replace(/^-|-$/g, '');
+ if (!slug) throw new Error(`Cannot build a preview filename for ${projectName}`);
+ return slug;
+};
const candidates = [
process.env.CHROME_BIN,
@@ -58,13 +70,17 @@ const browser = await puppeteer.launch({
});
try {
- for (const [projectName, outputName, required] of [
- [primaryProject, 'report-preview.png', true],
- [auxiliaryProject, 'auxiliary-report-preview.png', false],
- ]) {
+ for (const [index, projectName] of projects.entries()) {
+ const legacyOutputName = options.projects
+ ? null
+ : index === 0
+ ? 'report-preview.png'
+ : 'auxiliary-report-preview.png';
+ const outputName =
+ legacyOutputName ?? `report-preview-${projectSlug(projectName)}.png`;
const report = await findLatestTestReport(reportDirectory, {
projectName,
- required,
+ required: options.projects ? true : index === 0,
});
if (!report) {
console.log(
diff --git a/tests/e2e/cases/onboarding-regressions.yaml b/tests/e2e/cases/onboarding-regressions.yaml
index 922df92..dc21466 100644
--- a/tests/e2e/cases/onboarding-regressions.yaml
+++ b/tests/e2e/cases/onboarding-regressions.yaml
@@ -1,5 +1,6 @@
cases:
- name: Cancel sign-in and retry
+ tags: [shard-1]
steps:
- aiAssert: The current step is Sign in and both left-arrow Previous and right-arrow Next in the fixed top navigation are disabled.
- aiAct: Scroll inside the Sign in content panel until Open Doubao sign-in is fully visible.
@@ -17,6 +18,7 @@ cases:
- wait: { duration: 500 }
- aiAssert: The synthetic sign-in window closed and Doubao Say automatically advanced to the Microphone step.
- name: Preserve signed-in account across backward navigation
+ tags: [shard-4]
steps:
- aiAssert: The visible Doubao Say window starts on the Sign in step and says the user is not signed in.
- aiAct: Scroll inside the Sign in content panel until Open Doubao sign-in is fully visible.
@@ -34,6 +36,7 @@ cases:
- aiTap: Right-arrow Next button in the fixed top navigation
- aiAssert: The Microphone step shows Let's make sure we can hear you, and no synthetic sign-in window is open.
- name: Require an enabled trigger and retain the replacement
+ tags: [shard-4]
steps:
- aiAssert: The visible Doubao Say window starts on the Sign in step and says the user is not signed in.
- aiAct: Scroll inside the Sign in content panel until Open Doubao sign-in is fully visible.
@@ -55,6 +58,7 @@ cases:
- aiTap: Left-arrow Previous button in the fixed top navigation
- aiAssert: The Trigger key step still shows Active trigger F8 and F8 is selected in the trigger dropdown.
- name: Toggle polishing without losing configuration
+ tags: [shard-3]
steps:
- aiAssert: The visible Doubao Say window starts on the Sign in step and says the user is not signed in.
- aiAct: Scroll inside the Sign in content panel until Open Doubao sign-in is fully visible.
@@ -74,6 +78,7 @@ cases:
- aiAct: Scroll downward inside the central content panel until the Voice polishing Model input and its complete value are fully visible.
- aiAssert: The Voice polishing Model input contains exactly synthetic-model.
- name: Recover from an endpoint failure
+ tags: [shard-1]
steps:
- aiAssert: The visible Doubao Say window starts on the Sign in step and says the user is not signed in.
- aiAct: Scroll inside the Sign in content panel until Open Doubao sign-in is fully visible.
@@ -107,6 +112,7 @@ cases:
- aiAct: Scroll inside the central content panel until the endpoint result text below the retry button is fully visible.
- aiAssert: "The endpoint result says Endpoint works: Synthetic endpoint response, the enabled button says Endpoint works, and the previous Synthetic endpoint unavailable error is no longer visible."
- name: Microphone check gates setup completion
+ tags: [shard-4]
steps:
- fixture.prepare: { mode: microphone-gate }
- aiAssert: The visible Doubao Say window starts on the Microphone step, shows Synthetic microphone one, and offers Check microphone · 3 seconds.
@@ -124,6 +130,7 @@ cases:
- aiAct: Scroll down inside the Voice test content panel until the Finish setup button is fully visible.
- aiAssert: The Finish setup button is visibly enabled.
- name: Complete and cancel a voice test safely
+ tags: [shard-3]
steps:
- fixture.prepare: { mode: voice-test }
- aiAssert: The visible Doubao Say window starts on the Microphone step and the microphone is already configured.
@@ -148,6 +155,7 @@ cases:
- aiAct: Scroll down inside the Voice test content panel until the setup button is fully visible.
- aiAssert: The enabled setup button visibly says Voice test passed and nothing pasted or sent.
- name: Switch to Volcengine and validate credentials
+ tags: [shard-3]
steps:
- fixture.prepare: { mode: volcengine }
- aiAssert: The visible Doubao Say window starts on Sign in with Doubao account selected and right-arrow Next disabled.
@@ -165,6 +173,7 @@ cases:
- aiTap: Right-arrow Next button in the fixed top navigation
- aiAssert: The current step is Microphone and the heading Let's make sure we can hear you is visible.
- name: Changing microphone requires another check
+ tags: [shard-2]
steps:
- fixture.prepare: { mode: microphone-change }
- aiAssert: The visible Doubao Say window starts on the Microphone step with Synthetic microphone one selected.
@@ -184,6 +193,7 @@ cases:
- aiAct: Scroll down inside the Voice test content panel until the Finish setup button is fully visible.
- aiAssert: The Finish setup button is visibly enabled.
- name: Capture and retain a custom trigger shortcut
+ tags: [shard-2]
steps:
- fixture.prepare: { mode: shortcut-capture }
- aiTap: Right-arrow Next button in the fixed top navigation
diff --git a/tests/e2e/cases/onboarding.yaml b/tests/e2e/cases/onboarding.yaml
index d271aa4..312076e 100644
--- a/tests/e2e/cases/onboarding.yaml
+++ b/tests/e2e/cases/onboarding.yaml
@@ -1,5 +1,6 @@
cases:
- name: Complete Doubao Say onboarding on a real desktop
+ tags: [shard-2]
steps:
- aiAssert: The visible Doubao Say window is on Sign in and says the user is not signed in.
- aiAct: Scroll inside the Sign in content panel until Open Doubao sign-in is fully visible.
diff --git a/tests/e2e/cases/runtime.yaml b/tests/e2e/cases/runtime.yaml
index d499ff1..005a8fe 100644
--- a/tests/e2e/cases/runtime.yaml
+++ b/tests/e2e/cases/runtime.yaml
@@ -1,5 +1,6 @@
cases:
- name: Deliver one synthetic dictation to the focused target
+ tags: [shard-3]
steps:
- fixture.prepare: { mode: runtime-delivery }
- aiAssert: A Synthetic dictation target window is focused, its text field is empty, and the status says Idle with 0 deliveries.
@@ -10,6 +11,7 @@ cases:
- wait: { duration: 1200 }
- aiAssert: The overlay is gone, the target field contains exactly Synthetic dictation delivered exactly once, and the status says Delivered once with 1 delivery.
- name: Cancel synthetic dictation without delivering text
+ tags: [shard-4]
steps:
- fixture.prepare: { mode: runtime-cancel }
- aiAssert: A Synthetic dictation target window is focused, its text field is empty, and the status says Idle with 0 deliveries.
diff --git a/tests/e2e/midscene-node-reference.md b/tests/e2e/midscene-node-reference.md
index ccd38f6..a693eb3 100644
--- a/tests/e2e/midscene-node-reference.md
+++ b/tests/e2e/midscene-node-reference.md
@@ -36,9 +36,21 @@ Projects created by `midscene-test create` select `cases/**/*.{yaml,yml}` by def
**Case files:** `cases/polishing.yaml` (Execution Project: ubuntu-polishing)
-**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: ubuntu)
+**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: ubuntu-shard-1)
-**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: omarchy-onboarding)
+**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: ubuntu-shard-2)
+
+**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: ubuntu-shard-3)
+
+**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: ubuntu-shard-4)
+
+**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: omarchy-shard-1)
+
+**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: omarchy-shard-2)
+
+**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: omarchy-shard-3)
+
+**Case files:** `cases/onboarding.yaml`, `cases/onboarding-regressions.yaml`, `cases/runtime.yaml` (Execution Project: omarchy-shard-4)
**Case files:** `cases/omarchy-shell.yaml` (Execution Project: omarchy-shell)
diff --git a/tests/e2e/midscene.config.ts b/tests/e2e/midscene.config.ts
index ed3fec4..84d6311 100644
--- a/tests/e2e/midscene.config.ts
+++ b/tests/e2e/midscene.config.ts
@@ -246,6 +246,21 @@ const moveBarLeft = defineNode<typeof empty, void, DesktopContext>({
},
});
+const productCaseFiles = [
+ 'cases/onboarding.yaml',
+ 'cases/onboarding-regressions.yaml',
+ 'cases/runtime.yaml',
+] as const;
+
+const productShardProjects = (environment: 'ubuntu' | 'omarchy') =>
+ [1, 2, 3, 4].map((shard) => ({
+ name: `${environment}-shard-${shard}`,
+ retry: 2,
+ setup,
+ files: { include: productCaseFiles },
+ tags: { include: [`shard-${shard}`] },
+ }));
+
export default defineTestProject<DesktopContext>({
test: { maxConcurrency: 1, testTimeout: 8 * 60_000 },
// Retries are scoped to failed cases. Every attempt stays visible in the
@@ -257,30 +272,8 @@ export default defineTestProject<DesktopContext>({
setup,
files: { include: ['cases/polishing.yaml'] },
},
- {
- name: 'ubuntu',
- retry: 2,
- setup,
- files: {
- include: [
- 'cases/onboarding.yaml',
- 'cases/onboarding-regressions.yaml',
- 'cases/runtime.yaml',
- ],
- },
- },
- {
- name: 'omarchy-onboarding',
- retry: 2,
- setup,
- files: {
- include: [
- 'cases/onboarding.yaml',
- 'cases/onboarding-regressions.yaml',
- 'cases/runtime.yaml',
- ],
- },
- },
+ ...productShardProjects('ubuntu'),
+ ...productShardProjects('omarchy'),
{
name: 'omarchy-shell',
retry: 2,
diff --git a/tests/e2e/run-omarchy-midscene.sh b/tests/e2e/run-omarchy-midscene.sh
index af3b8b4..7d70251 100755
--- a/tests/e2e/run-omarchy-midscene.sh
+++ b/tests/e2e/run-omarchy-midscene.sh
@@ -2,6 +2,7 @@
set -euo pipefail
readonly ROOT_DIR="$PWD"
+readonly MIDSCENE_PROJECT="${1:?Usage: run-omarchy-midscene.sh PROJECT}"
readonly WORK_DIR="$ROOT_DIR/.midscene-omarchy"
readonly HARNESS_DIR="$WORK_DIR/omarchy-iso"
# shellcheck source=omarchy-vm.env
@@ -152,12 +153,17 @@ ssh_session_tty "printf '%s\\n' omarchy | sudo -S -v && \
ssh_guest "test -f /home/omarchy/.local/share/applications/doubao-say.desktop && \
grep -Fq '$PLUGIN_DIR/start.sh' /home/omarchy/.local/share/applications/doubao-say.desktop"
-npm --prefix tests/e2e test -- --project omarchy-onboarding
-
-# The Midscene project teardown has stopped its onboarding fixture. Dismiss
-# first-run notifications before the shell project inspects Omarchy itself.
-ssh_session "omarchy-shell notifications dismissAll"
-
-# Reuse the same live Hyprland session for a visual comparison against
-# Omarchy's OCR and hyprctl-based acceptance checks.
-npm --prefix tests/e2e test -- --project omarchy-shell
+case "$MIDSCENE_PROJECT" in
+ omarchy-shard-[1-4])
+ npm --prefix tests/e2e test -- --project "$MIDSCENE_PROJECT"
+ ;;
+ omarchy-shell)
+ # Dismiss first-run notifications before inspecting Omarchy itself.
+ ssh_session "omarchy-shell notifications dismissAll"
+ npm --prefix tests/e2e test -- --project "$MIDSCENE_PROJECT"
+ ;;
+ *)
+ echo "Unsupported Omarchy Midscene project: $MIDSCENE_PROJECT" >&2
+ exit 2
+ ;;
+esac