Skip to content

Commit f9d376d

Browse files
petrsvihlikclaude
andauthored
test: consolidate the two E2E projects into WopiHost.E2ETests (#548)
The Collabora and ONLYOFFICE e2e projects were near-duplicates: DockerCheck and PlaywrightFixture were byte-for-byte copies, and the two app fixtures shared the whole boot-wait-probe-capture skeleton. One project now carries both suites: - Fixtures/WopiAppFixtureBase absorbs the shared scaffolding (AppHost boot via the configureBuilder seam, resource waits, client readiness poll against the Aspire-discovered endpoint, RunProcessAsync/docker diagnostics, repo-root resolution). Derived fixtures supply only lane specifics: flags, resource names, readiness semantics (Collabora: /hosting/discovery 200; ONLYOFFICE: /healthcheck body "true"), timeouts, and client-log capture. - Suites live under Collabora/ and OnlyOffice/, each tagged with a Client trait on top of Category=E2E. The nightly workflows run the same project with --filter "Client=Collabora" / "Client=OnlyOffice" (the runsettings bypass stays; once cleared, the CLI filter applies alone). - Both collections keep DisableParallelization=true, so an unfiltered local run boots the two Aspire stacks sequentially, never concurrently (they pin the same host ports). The repo's "duplicate PlaywrightFixture deliberately" precedent (SmokeTests vs e2e) doesn't apply between the two e2e suites — they have identical dependency surfaces — so merging removes real duplication without coupling anything new. Also halves the per-PR compile cost (one Aspire.Hosting.Testing project in WOPI.slnx instead of two). Verified: all three tests pass locally through the exact workflow commands (Client=Collabora: open + save; Client=OnlyOffice: open). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 675b16d commit f9d376d

26 files changed

Lines changed: 639 additions & 991 deletions

.github/workflows/e2e-collabora.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ jobs:
4040
run: echo "COBALT_PACKAGES_TOKEN=${{ secrets.COBALT_PACKAGES_TOKEN }}" >> $GITHUB_ENV
4141

4242
- name: Restore
43-
run: dotnet restore test/WopiHost.E2ETests.Collabora/WopiHost.E2ETests.Collabora.csproj
43+
run: dotnet restore test/WopiHost.E2ETests/WopiHost.E2ETests.csproj
4444

4545
- name: Build
46-
run: dotnet build test/WopiHost.E2ETests.Collabora/WopiHost.E2ETests.Collabora.csproj --no-restore /p:ContinuousIntegrationBuild=true
46+
run: dotnet build test/WopiHost.E2ETests/WopiHost.E2ETests.csproj --no-restore /p:ContinuousIntegrationBuild=true
4747

4848
- name: Install Playwright browsers
4949
# --with-deps installs the apt packages Chromium needs on a fresh ubuntu-latest. The
5050
# build emits playwright.ps1 next to the test assembly under artifacts/bin/ (the repo
5151
# uses UseArtifactsOutput); the path mirrors test/WopiHost.SmokeTests's CI step.
52-
run: pwsh artifacts/bin/WopiHost.E2ETests.Collabora/debug/playwright.ps1 install --with-deps chromium
52+
run: pwsh artifacts/bin/WopiHost.E2ETests/debug/playwright.ps1 install --with-deps chromium
5353

5454
- name: Pre-pull Collabora image
5555
# Pre-pulling outside the test makes the test's WaitForResourceHealthyAsync timeout
@@ -61,18 +61,18 @@ jobs:
6161
- name: Run e2e
6262
# -p:RunSettingsFilePath= clears the repo-root .runsettings autoloaded via
6363
# Directory.Build.props. That runsettings filters out Category=E2E so per-PR
64-
# `dotnet test` skips this suite; we need to undo that filter for the dedicated
65-
# workflow. We do NOT use --filter "Category=E2E" because dotnet test ANDs the CLI
66-
# filter with the runsettings filter, yielding (Category!=E2E)&(Category=E2E) which
67-
# matches zero tests. Bypassing the runsettings entirely is the cleanest opt-in.
68-
run: dotnet test test/WopiHost.E2ETests.Collabora/WopiHost.E2ETests.Collabora.csproj --no-build -p:RunSettingsFilePath= --verbosity normal --logger "console;verbosity=detailed"
64+
# `dotnet test` skips this project; the dedicated workflow undoes that and then picks
65+
# its suite with the Client trait. The Client filter must NOT be combined with the
66+
# runsettings (dotnet test ANDs CLI and runsettings filters — (Category!=E2E)&(...)
67+
# matches zero tests); with the runsettings cleared, the CLI filter applies alone.
68+
run: dotnet test test/WopiHost.E2ETests/WopiHost.E2ETests.csproj --no-build -p:RunSettingsFilePath= --filter "Client=Collabora" --verbosity normal --logger "console;verbosity=detailed"
6969

7070
- name: Upload Playwright traces on failure
7171
if: failure()
7272
uses: actions/upload-artifact@v7
7373
with:
7474
name: playwright-traces
7575
path: |
76-
artifacts/bin/WopiHost.E2ETests.Collabora/**/test-results/**
77-
artifacts/bin/WopiHost.E2ETests.Collabora/**/playwright-report/**
76+
artifacts/bin/WopiHost.E2ETests/**/test-results/**
77+
artifacts/bin/WopiHost.E2ETests/**/playwright-report/**
7878
if-no-files-found: ignore

.github/workflows/e2e-onlyoffice.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ jobs:
4141
run: echo "COBALT_PACKAGES_TOKEN=${{ secrets.COBALT_PACKAGES_TOKEN }}" >> $GITHUB_ENV
4242

4343
- name: Restore
44-
run: dotnet restore test/WopiHost.E2ETests.OnlyOffice/WopiHost.E2ETests.OnlyOffice.csproj
44+
run: dotnet restore test/WopiHost.E2ETests/WopiHost.E2ETests.csproj
4545

4646
- name: Build
47-
run: dotnet build test/WopiHost.E2ETests.OnlyOffice/WopiHost.E2ETests.OnlyOffice.csproj --no-restore /p:ContinuousIntegrationBuild=true
47+
run: dotnet build test/WopiHost.E2ETests/WopiHost.E2ETests.csproj --no-restore /p:ContinuousIntegrationBuild=true
4848

4949
- name: Install Playwright browsers
5050
# --with-deps installs the apt packages Chromium needs on a fresh ubuntu-latest. The build
5151
# emits playwright.ps1 next to the test assembly under artifacts/bin/ (the repo uses
5252
# UseArtifactsOutput); the path mirrors the Collabora e2e step.
53-
run: pwsh artifacts/bin/WopiHost.E2ETests.OnlyOffice/debug/playwright.ps1 install --with-deps chromium
53+
run: pwsh artifacts/bin/WopiHost.E2ETests/debug/playwright.ps1 install --with-deps chromium
5454

5555
- name: Pre-pull ONLYOFFICE image
5656
# Pre-pulling outside the test makes the fixture's healthcheck timeout bound the runtime cost
@@ -61,17 +61,18 @@ jobs:
6161
- name: Run e2e
6262
# -p:RunSettingsFilePath= clears the repo-root .runsettings autoloaded via
6363
# Directory.Build.props. That runsettings filters out Category=E2E so per-PR `dotnet test`
64-
# skips this suite; we undo that filter for the dedicated workflow. We do NOT use
65-
# --filter "Category=E2E" because dotnet test ANDs the CLI filter with the runsettings filter,
66-
# yielding (Category!=E2E)&(Category=E2E) which matches zero tests.
67-
run: dotnet test test/WopiHost.E2ETests.OnlyOffice/WopiHost.E2ETests.OnlyOffice.csproj --no-build -p:RunSettingsFilePath= --verbosity normal --logger "console;verbosity=detailed"
64+
# skips this project; the dedicated workflow undoes that and then picks its suite with the
65+
# Client trait. The Client filter must NOT be combined with the runsettings (dotnet test
66+
# ANDs CLI and runsettings filters — (Category!=E2E)&(...) matches zero tests); with the
67+
# runsettings cleared, the CLI filter applies alone.
68+
run: dotnet test test/WopiHost.E2ETests/WopiHost.E2ETests.csproj --no-build -p:RunSettingsFilePath= --filter "Client=OnlyOffice" --verbosity normal --logger "console;verbosity=detailed"
6869

6970
- name: Upload Playwright traces on failure
7071
if: failure()
7172
uses: actions/upload-artifact@v7
7273
with:
7374
name: playwright-traces-onlyoffice
7475
path: |
75-
artifacts/bin/WopiHost.E2ETests.OnlyOffice/**/test-results/**
76-
artifacts/bin/WopiHost.E2ETests.OnlyOffice/**/playwright-report/**
76+
artifacts/bin/WopiHost.E2ETests/**/test-results/**
77+
artifacts/bin/WopiHost.E2ETests/**/playwright-report/**
7778
if-no-files-found: ignore

.runsettings

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
Directory.Build.props; dotnet test does NOT auto-discover .runsettings by convention.
55
66
TestCaseFilter excludes tests carrying the "E2E" trait so plain `dotnet test` skips the
7-
Collabora end-to-end suite by default. That suite needs Docker + a real Collabora container
8-
cold-start + Playwright; running it on every PR would burn CI minutes and gate PRs on a
9-
flaky integration whose failures are mostly upstream.
7+
end-to-end suites (Collabora + ONLYOFFICE) by default. Those suites need Docker + a real
8+
client-container cold-start + Playwright; running them on every PR would burn CI minutes
9+
and gate PRs on flaky integrations whose failures are mostly upstream.
1010
1111
To opt back in for a single run, pass an MSBuild property that clears
1212
RunSettingsFilePath, which bypasses this file. Be aware that a CLI test filter does NOT
1313
work as an override here, because dotnet test ANDs the CLI filter with the runsettings
1414
filter (yielding (Category!=E2E)&(Category=E2E), which matches zero tests).
15-
See test/WopiHost.E2ETests.Collabora/README.md for the full local-run command.
15+
See test/WopiHost.E2ETests/README.md for the full local-run command.
1616
-->
1717
<RunSettings>
1818
<RunConfiguration>

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2121
<!-- Auto-load the repo-root .runsettings for `dotnet test`. dotnet test does NOT
2222
auto-discover .runsettings by convention — this property is the documented seam.
23-
The runsettings currently carries a TestCaseFilter that excludes the E2E suite
24-
from default runs; see .runsettings and test/WopiHost.E2ETests.Collabora/README.md. -->
23+
The runsettings currently carries a TestCaseFilter that excludes the E2E suites
24+
from default runs; see .runsettings and test/WopiHost.E2ETests/README.md. -->
2525
<RunSettingsFilePath>$(MSBuildThisFileDirectory).runsettings</RunSettingsFilePath>
2626
</PropertyGroup>
2727

WOPI.slnx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
<Project Path="test/WopiHost.Core.Tests/WopiHost.Core.Tests.csproj" />
2727
<Project Path="test/WopiHost.IntegrationTests/WopiHost.IntegrationTests.csproj" />
2828
<Project Path="test/WopiHost.Discovery.Tests/WopiHost.Discovery.Tests.csproj" />
29-
<Project Path="test/WopiHost.E2ETests.Collabora/WopiHost.E2ETests.Collabora.csproj" />
30-
<Project Path="test/WopiHost.E2ETests.OnlyOffice/WopiHost.E2ETests.OnlyOffice.csproj" />
29+
<Project Path="test/WopiHost.E2ETests/WopiHost.E2ETests.csproj" />
3130
<Project Path="test/WopiHost.FileSystemProvider.Tests/WopiHost.FileSystemProvider.Tests.csproj" />
3231
<Project Path="test/WopiHost.MemoryLockProvider.Tests/WopiHost.MemoryLockProvider.Tests.csproj" />
3332
<Project Path="test/WopiHost.RedisLockProvider.Tests/WopiHost.RedisLockProvider.Tests.csproj" />

infra/WopiHost.AppHost/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,11 @@ dotnet run --project infra/WopiHost.AppHost -- --AppHost:UseOnlyOffice=false
7272
## End-to-end tests
7373
7474
Each lane has a nightly E2E suite that boots this AppHost via `Aspire.Hosting.Testing` and drives the
75-
editor with Playwright:
75+
editor with Playwright. Both live in [`test/WopiHost.E2ETests`](../../test/WopiHost.E2ETests) (one
76+
project, suites selected by a `Client` trait):
7677
77-
- [`test/WopiHost.E2ETests.Collabora`](../../test/WopiHost.E2ETests.Collabora) →
78-
[`e2e-collabora.yml`](../../.github/workflows/e2e-collabora.yml)
79-
- [`test/WopiHost.E2ETests.OnlyOffice`](../../test/WopiHost.E2ETests.OnlyOffice) →
80-
[`e2e-onlyoffice.yml`](../../.github/workflows/e2e-onlyoffice.yml)
78+
- [`e2e-collabora.yml`](../../.github/workflows/e2e-collabora.yml) → `--filter "Client=Collabora"`
79+
- [`e2e-onlyoffice.yml`](../../.github/workflows/e2e-onlyoffice.yml) → `--filter "Client=OnlyOffice"`
8180
8281
Neither gates per-PR CI (they're `[Trait("Category", "E2E")]`, filtered out by the repo-root
8382
`.runsettings`); they run on a nightly cron + `workflow_dispatch`.

0 commit comments

Comments
 (0)