Skip to content

Commit ff0fea6

Browse files
committed
split tests
1 parent 2e5aad3 commit ff0fea6

118 files changed

Lines changed: 433 additions & 74 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-github-pages.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ env:
2020
CORE_TEST_PROJECT: tests/PrompterOne.Core.Tests/PrompterOne.Core.Tests.csproj
2121
PLAYWRIGHT_CLI: tests/PrompterOne.Web.UITests/bin/Debug/net10.0/.playwright/package/cli.js
2222
SOLUTION_FILE: PrompterOne.slnx
23-
UI_TEST_PROJECT: tests/PrompterOne.Web.UITests/PrompterOne.Web.UITests.csproj
2423

2524
jobs:
2625
build_supporting_suites:
@@ -74,8 +73,8 @@ jobs:
7473
dotnet test --project "$CORE_TEST_PROJECT"
7574
dotnet test --project "$APP_TEST_PROJECT"
7675
77-
build_browser_suite:
78-
name: Restore + Build Browser Suite
76+
build_browser_suites:
77+
name: Restore + Build Browser Suites
7978
runs-on: macos-latest
8079

8180
permissions:
@@ -96,10 +95,26 @@ jobs:
9695
- name: Build solution
9796
run: dotnet build "$SOLUTION_FILE" -warnaserror
9897

99-
test_browser_suite:
100-
name: Run Browser Suite
101-
needs: build_browser_suite
98+
test_browser_suites:
99+
name: Run Browser Suite (${{ matrix.suite.name }})
100+
needs: build_browser_suites
102101
runs-on: macos-latest
102+
strategy:
103+
fail-fast: false
104+
matrix:
105+
suite:
106+
- name: Shell
107+
artifact: shell
108+
project: tests/PrompterOne.Web.UITests.Shell/PrompterOne.Web.UITests.Shell.csproj
109+
- name: Studio
110+
artifact: studio
111+
project: tests/PrompterOne.Web.UITests.Studio/PrompterOne.Web.UITests.Studio.csproj
112+
- name: Editor
113+
artifact: editor
114+
project: tests/PrompterOne.Web.UITests.Editor/PrompterOne.Web.UITests.Editor.csproj
115+
- name: Reader
116+
artifact: reader
117+
project: tests/PrompterOne.Web.UITests.Reader/PrompterOne.Web.UITests.Reader.csproj
103118

104119
permissions:
105120
contents: read
@@ -130,20 +145,20 @@ jobs:
130145
run: node "$PLAYWRIGHT_CLI" install chromium
131146

132147
- name: Test browser suite
133-
run: dotnet test --project "$UI_TEST_PROJECT"
148+
run: dotnet test --project "${{ matrix.suite.project }}"
134149

135150
- name: Upload Playwright artifacts
136151
if: always()
137152
uses: actions/upload-artifact@v7
138153
with:
139-
name: playwright-artifacts-release-pipeline
154+
name: playwright-artifacts-release-pipeline-${{ matrix.suite.artifact }}
140155
path: output/playwright/
141156
if-no-files-found: ignore
142157
prepare_release:
143158
name: Resolve Release Version
144159
needs:
145160
- test_supporting_suites
146-
- test_browser_suite
161+
- test_browser_suites
147162
runs-on: ubuntu-latest
148163
env:
149164
APP_PROJECT: src/PrompterOne.Web/PrompterOne.Web.csproj

.github/workflows/pr-validation.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ env:
1818
CORE_TEST_PROJECT: tests/PrompterOne.Core.Tests/PrompterOne.Core.Tests.csproj
1919
PLAYWRIGHT_CLI: tests/PrompterOne.Web.UITests/bin/Debug/net10.0/.playwright/package/cli.js
2020
SOLUTION_FILE: PrompterOne.slnx
21-
UI_TEST_PROJECT: tests/PrompterOne.Web.UITests/PrompterOne.Web.UITests.csproj
2221

2322
jobs:
2423
build_supporting_suites:
@@ -66,8 +65,8 @@ jobs:
6665
dotnet test --project "$CORE_TEST_PROJECT"
6766
dotnet test --project "$APP_TEST_PROJECT"
6867
69-
build_browser_suite:
70-
name: Restore + Build Browser Suite
68+
build_browser_suites:
69+
name: Restore + Build Browser Suites
7170
runs-on: macos-latest
7271

7372
steps:
@@ -85,10 +84,26 @@ jobs:
8584
- name: Build solution
8685
run: dotnet build "$SOLUTION_FILE" -warnaserror
8786

88-
test_browser_suite:
89-
name: Run Browser Suite
90-
needs: build_browser_suite
87+
test_browser_suites:
88+
name: Run Browser Suite (${{ matrix.suite.name }})
89+
needs: build_browser_suites
9190
runs-on: macos-latest
91+
strategy:
92+
fail-fast: false
93+
matrix:
94+
suite:
95+
- name: Shell
96+
artifact: shell
97+
project: tests/PrompterOne.Web.UITests.Shell/PrompterOne.Web.UITests.Shell.csproj
98+
- name: Studio
99+
artifact: studio
100+
project: tests/PrompterOne.Web.UITests.Studio/PrompterOne.Web.UITests.Studio.csproj
101+
- name: Editor
102+
artifact: editor
103+
project: tests/PrompterOne.Web.UITests.Editor/PrompterOne.Web.UITests.Editor.csproj
104+
- name: Reader
105+
artifact: reader
106+
project: tests/PrompterOne.Web.UITests.Reader/PrompterOne.Web.UITests.Reader.csproj
92107

93108
steps:
94109
- name: Checkout
@@ -116,12 +131,12 @@ jobs:
116131
run: node "$PLAYWRIGHT_CLI" install chromium
117132

118133
- name: Test browser suite
119-
run: dotnet test --project "$UI_TEST_PROJECT" --verbosity normal
134+
run: dotnet test --project "${{ matrix.suite.project }}" --verbosity normal
120135

121136
- name: Upload Playwright artifacts
122137
if: always()
123138
uses: actions/upload-artifact@v7
124139
with:
125-
name: playwright-artifacts-pr-validation
140+
name: playwright-artifacts-pr-validation-${{ matrix.suite.artifact }}
126141
path: output/playwright/
127142
if-no-files-found: ignore

AGENTS.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Rule format:
110110
- For deploy-only, domain, CI, or static-site hosting tasks, do not spend time on unrelated app/browser test suites unless the user explicitly asks or the runtime behavior itself changes; prefer workflow, build, and publish-config validation only.
111111
- Repo-wide .NET SDK and test-runner selection belong in the root `global.json`; do not split `global.json` test-runner opt-ins per project or subfolder once the user asks for a global test-platform policy.
112112
- Browser and component tests must use one selector format only: `data-test`; do not mix in any alternate test-attribute naming variants.
113+
- Every runnable test project must declare `MaxParallelTestsForPipeline : EnvironmentAwareParallelLimitBase` with `LocalLimit = 15`; do not keep lower per-project local parallel caps unless the user explicitly asks for an exception.
113114
- Selector-contract remediation requests must be handled repo-wide across all relevant test files (`Web.Tests` and `Web.UITests`), not as partial per-file cleanups.
114115
- Repo-wide quality audits and agent-generated review handoff artifacts must be written as root-level task files so other coding agents can pick them up quickly; do not bury those temporary audit results under `docs/` unless the task is explicitly about durable product documentation.
115116
- Repo-wide cleanup and review passes must explicitly inventory forbidden implementation string literals, `MarkupString` or raw-HTML UI composition, duplicated JS/CSS patterns, architecture-boundary drift, and `foreach`-driven test scenarios that should become isolated TUnit cases.
@@ -122,9 +123,9 @@ Rule format:
122123
### Commands
123124

124125
- `build`: `dotnet build ./PrompterOne.slnx -warnaserror`
125-
- `test`: `dotnet test --project ./tests/PrompterOne.Core.Tests/PrompterOne.Core.Tests.csproj && dotnet test --project ./tests/PrompterOne.Web.Tests/PrompterOne.Web.Tests.csproj && dotnet test --project ./tests/PrompterOne.Web.UITests/PrompterOne.Web.UITests.csproj`
126+
- `test`: `dotnet test --project ./tests/PrompterOne.Core.Tests/PrompterOne.Core.Tests.csproj && dotnet test --project ./tests/PrompterOne.Web.Tests/PrompterOne.Web.Tests.csproj && dotnet test --project ./tests/PrompterOne.Web.UITests.Shell/PrompterOne.Web.UITests.Shell.csproj && dotnet test --project ./tests/PrompterOne.Web.UITests.Studio/PrompterOne.Web.UITests.Studio.csproj && dotnet test --project ./tests/PrompterOne.Web.UITests.Editor/PrompterOne.Web.UITests.Editor.csproj && dotnet test --project ./tests/PrompterOne.Web.UITests.Reader/PrompterOne.Web.UITests.Reader.csproj`
126127
- `format`: `dotnet format ./PrompterOne.slnx`
127-
- `coverage`: `dotnet test --project ./tests/PrompterOne.Core.Tests/PrompterOne.Core.Tests.csproj -- --coverage --coverage-output-format cobertura && dotnet test --project ./tests/PrompterOne.Web.Tests/PrompterOne.Web.Tests.csproj -- --coverage --coverage-output-format cobertura && dotnet test --project ./tests/PrompterOne.Web.UITests/PrompterOne.Web.UITests.csproj -- --coverage --coverage-output-format cobertura`
128+
- `coverage`: `dotnet test --project ./tests/PrompterOne.Core.Tests/PrompterOne.Core.Tests.csproj -- --coverage --coverage-output-format cobertura && dotnet test --project ./tests/PrompterOne.Web.Tests/PrompterOne.Web.Tests.csproj -- --coverage --coverage-output-format cobertura && dotnet test --project ./tests/PrompterOne.Web.UITests.Shell/PrompterOne.Web.UITests.Shell.csproj -- --coverage --coverage-output-format cobertura && dotnet test --project ./tests/PrompterOne.Web.UITests.Studio/PrompterOne.Web.UITests.Studio.csproj -- --coverage --coverage-output-format cobertura && dotnet test --project ./tests/PrompterOne.Web.UITests.Editor/PrompterOne.Web.UITests.Editor.csproj -- --coverage --coverage-output-format cobertura && dotnet test --project ./tests/PrompterOne.Web.UITests.Reader/PrompterOne.Web.UITests.Reader.csproj -- --coverage --coverage-output-format cobertura`
128129

129130
For this `.NET` repo:
130131

@@ -139,18 +140,22 @@ Useful focused commands:
139140
- app run: `cd ./src/PrompterOne.Web && dotnet run`
140141
- core tests: `dotnet test --project ./tests/PrompterOne.Core.Tests/PrompterOne.Core.Tests.csproj`
141142
- component tests: `dotnet test --project ./tests/PrompterOne.Web.Tests/PrompterOne.Web.Tests.csproj`
142-
- ui tests: `dotnet test --project ./tests/PrompterOne.Web.UITests/PrompterOne.Web.UITests.csproj`
143+
- ui tests: `dotnet test --project ./tests/PrompterOne.Web.UITests.Shell/PrompterOne.Web.UITests.Shell.csproj && dotnet test --project ./tests/PrompterOne.Web.UITests.Studio/PrompterOne.Web.UITests.Studio.csproj && dotnet test --project ./tests/PrompterOne.Web.UITests.Editor/PrompterOne.Web.UITests.Editor.csproj && dotnet test --project ./tests/PrompterOne.Web.UITests.Reader/PrompterOne.Web.UITests.Reader.csproj`
144+
- ui shell tests: `dotnet test --project ./tests/PrompterOne.Web.UITests.Shell/PrompterOne.Web.UITests.Shell.csproj`
145+
- ui studio tests: `dotnet test --project ./tests/PrompterOne.Web.UITests.Studio/PrompterOne.Web.UITests.Studio.csproj`
146+
- ui editor tests: `dotnet test --project ./tests/PrompterOne.Web.UITests.Editor/PrompterOne.Web.UITests.Editor.csproj`
147+
- ui reader tests: `dotnet test --project ./tests/PrompterOne.Web.UITests.Reader/PrompterOne.Web.UITests.Reader.csproj`
143148
- playwright browser install: `node ./tests/PrompterOne.Web.UITests/bin/Debug/net10.0/.playwright/package/cli.js install chromium`
144149
- Build the relevant project immediately before starting a local dev server so `dotnet run` cannot serve stale WASM assets or binaries.
145150

146151
Browser test execution rules:
147152

148-
- Use one `dotnet test` process at a time for the browser suite.
149-
- The browser suite self-hosts the built WASM assets on a dynamically assigned loopback HTTP origin.
153+
- Use one `dotnet test` process at a time for a browser suite project when running locally.
154+
- The browser suite family self-hosts the built WASM assets on a dynamically assigned loopback HTTP origin.
150155
- Each browser-suite host startup MUST request a fresh OS-assigned loopback port via `http://127.0.0.1:0`. Never pin or reuse a fixed browser-test port across runs.
151-
- Inside that single process, the browser suite may run up to `4` parallel TUnit workers locally; when repeated full-suite CI runs prove resource contention, lower the CI worker cap instead of weakening browser assertions.
152-
- Do not run `PrompterOne.Web.UITests` in parallel with another `dotnet build` or `dotnet test` command.
153-
- In GitHub Actions, run the browser suite in its own dedicated macOS job and keep supporting suites in a separate job so CI can parallelize work without Linux x64 browser-runner contention stretching release validation.
156+
- Inside a single browser-suite process, the suite may run up to `15` parallel TUnit workers locally; when repeated full-suite CI runs prove resource contention, lower the CI worker cap instead of weakening browser assertions.
157+
- Do not run any `PrompterOne.Web.UITests*` project in parallel with another `dotnet build` or `dotnet test` command on the same local machine context.
158+
- In GitHub Actions, run the browser suite family in dedicated macOS jobs or matrix entries and keep supporting suites in separate jobs so CI can parallelize work without Linux x64 browser-runner contention stretching release validation.
154159
- GitHub Actions pipelines must expose explicit staged jobs with readable names such as restore, build, supporting tests, browser tests, release publish, and deploy; vague single-job `validate` graphs are not acceptable when the user needs to see pipeline phases clearly in the Actions UI.
155160
- When monitoring long-running GitHub Actions jobs from the terminal, poll with coarse waits of roughly `3-5` minutes between checks; frequent short-interval polling is noise and does not help on multi-minute browser suites.
156161
- Browser acceptance tests must stay on the production-shaped runtime path; do not add or keep `?wasm-debug=1` or similar debug-query scenarios in automated acceptance coverage unless the user explicitly asks for that path.
@@ -200,6 +205,10 @@ Current local `AGENTS.md` files:
200205
- [tests/PrompterOne.Testing/AGENTS.md](./tests/PrompterOne.Testing/AGENTS.md)
201206
- [tests/PrompterOne.Web.Tests/AGENTS.md](./tests/PrompterOne.Web.Tests/AGENTS.md)
202207
- [tests/PrompterOne.Web.UITests/AGENTS.md](./tests/PrompterOne.Web.UITests/AGENTS.md)
208+
- [tests/PrompterOne.Web.UITests.Shell/AGENTS.md](./tests/PrompterOne.Web.UITests.Shell/AGENTS.md)
209+
- [tests/PrompterOne.Web.UITests.Studio/AGENTS.md](./tests/PrompterOne.Web.UITests.Studio/AGENTS.md)
210+
- [tests/PrompterOne.Web.UITests.Editor/AGENTS.md](./tests/PrompterOne.Web.UITests.Editor/AGENTS.md)
211+
- [tests/PrompterOne.Web.UITests.Reader/AGENTS.md](./tests/PrompterOne.Web.UITests.Reader/AGENTS.md)
203212

204213
### Maintainability Limits
205214

PrompterOne.slnx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
<Project Path="tests/PrompterOne.Testing/PrompterOne.Testing.csproj" />
1010
<Project Path="tests/PrompterOne.Web.Tests/PrompterOne.Web.Tests.csproj" />
1111
<Project Path="tests/PrompterOne.Web.UITests/PrompterOne.Web.UITests.csproj" />
12+
<Project Path="tests/PrompterOne.Web.UITests.Shell/PrompterOne.Web.UITests.Shell.csproj" />
13+
<Project Path="tests/PrompterOne.Web.UITests.Studio/PrompterOne.Web.UITests.Studio.csproj" />
14+
<Project Path="tests/PrompterOne.Web.UITests.Editor/PrompterOne.Web.UITests.Editor.csproj" />
15+
<Project Path="tests/PrompterOne.Web.UITests.Reader/PrompterOne.Web.UITests.Reader.csproj" />
1216
<Project Path="tests/PrompterOne.Core.Tests/PrompterOne.Core.Tests.csproj" />
1317
</Folder>
1418
</Solution>

0 commit comments

Comments
 (0)