Skip to content

Integration tests: mark per-test and consolidate uploads#8068

Merged
hatton merged 3 commits into
speedUpCSharpTestsfrom
fasterIntegrationTests
Jul 16, 2026
Merged

Integration tests: mark per-test and consolidate uploads#8068
hatton merged 3 commits into
speedUpCSharpTestsfrom
fasterIntegrationTests

Conversation

@andrew-polk

@andrew-polk andrew-polk commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Builds on #8067 (base branch: speedUpCSharpTests) — refines the integration tests it marked.

  1. Per-test [Category("Integration")] instead of fixture-level. Most of BookUploadAndDownloadTests (17 tests: URL parsing, settings sanitizing, path logic) and BloomS3ClientTests (12 tests: AvoidThisFile, GetBaseUrl) are local-only and fast; they now run even when Integration is excluded. With --filter TestCategory!=Integration, 65 of the namespace's 72 tests run in ~0.6s. BloomS3StandardUpDownloadTests and ProblemBookUploaderTests stay fixture-marked (every test needs the network).

  2. Fewer uploads, same assertions. Stack sampling showed each upload costs two long-running server operations (mostly waiting on the server), so:

    • UploadBook_SetsInterestingParseFieldsCorrectly merged into UploadBook_SameId_ReplacesUploadBook_SameId_ReplacesFilesAndSetsParseFieldsCorrectly (both needed an upload + same-id re-upload; one cycle now carries both sets of assertions, plus a new record-id-matches-upload assertion).
    • UploadBook_FillsInMetaData merged with DownloadUrl_GetsDocument_AndSettings → one book with a missing instance id and collection settings serves both, feeding all three download variants (direct S3, plain order-URL, forEdit).

    Fixture goes from 7 uploads (14 long-running operations) to 4 (8). All 72 namespace tests pass against the live services.

    (Considered shrinking upload payloads too, but test books are already a handful of tiny text files; the cost is per-operation server latency, not bytes.)

Also adds a PAPERCUTS.md entry documenting the 9 environmental full-suite failures agents see (missing BloomPdfMaker.exe and Test-XMatter packs in the isolated agent output tree).

🤖 Generated with Claude Code

Devin review


This change is Reviewable

andrew-polk and others added 2 commits July 15, 2026 11:20
Two refinements to the WebLibraryIntegration tests:

1. Move [Category("Integration")] from fixture level to the individual
   tests that actually hit the network. Most of BookUploadAndDownloadTests
   (17 of its tests: url parsing, settings sanitizing, path logic) and
   BloomS3ClientTests (AvoidThisFile, GetBaseUrl) are local-only and
   fast, and now run even when Integration is excluded: 65 of the
   namespace's 72 tests run in 0.6s with
   --filter TestCategory!=Integration. BloomS3StandardUpDownloadTests
   and ProblemBookUploaderTests stay fixture-marked because every test
   in them needs the network.

2. Consolidate uploads, since profiling showed each upload costs two
   long-running server operations (mostly waiting on the server):
   - UploadBook_SetsInterestingParseFieldsCorrectly merged into
     UploadBook_SameId_Replaces: both needed an upload + same-id
     re-upload, so one cycle now carries both sets of assertions.
   - UploadBook_FillsInMetaData merged with
     DownloadUrl_GetsDocument_AndSettings: one book with a missing
     instance id AND collection settings serves both.
   This cuts the fixture from 7 uploads (14 long-running operations)
   to 4 (8), keeping all assertions and all download variants.

(Considered shrinking upload payloads too, but the test books are
already just a handful of tiny text files; the cost is per-operation
server latency, not bytes.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR refines integration test categorization in BookUploadAndDownloadTests and BloomS3ClientTests, moving [Category("Integration")] from the fixture level to individual test methods so that the majority of local-only, fast tests run even when integration tests are excluded. It also consolidates two pairs of tests that each needed a full upload cycle, cutting the fixture's upload count from 7 to 4.

  • Per-test categorization: The fixture-level [Category("Integration")] attribute is removed from both classes; only tests that actually make network calls (DownloadBook_DoesNotExist_Throws, and the upload/download tests) keep the attribute, enabling 65 of 72 namespace tests to run in ~0.6s locally.
  • Test consolidation: UploadBook_SameId_Replaces + UploadBook_SetsInterestingParseFieldsCorrectly are merged (both needed upload + re-upload); UploadBook_FillsInMetaData + DownloadUrl_GetsDocument_AndSettings are merged (one book with missing instance id and collection settings feeds all three download variants), with dest and dest2 correctly separated to avoid path collisions.
  • PAPERCUTS.md: New file documents 9 known environmental test failures (missing BloomPdfMaker.exe and Test-XMatter packs) that agents will encounter in the isolated output tree.

Important Files Changed

Filename Overview
src/BloomTests/WebLibraryIntegration/BookUploadAndDownloadTests.cs Fixture-level [Category("Integration")] replaced with per-test attributes; two pairs of tests merged to share upload cycles with all assertions preserved, dest/dest2 separation added to avoid path collisions, and the previously flagged updateSource != "BloomDesktop old" guard restored on the re-upload block.
src/BloomTests/WebLibraryIntegration/BloomS3ClientTests.cs Fixture-level [Category("Integration")] removed; only DownloadBook_DoesNotExist_Throws (the one S3 network call) keeps the attribute; AvoidThisFile and GetBaseUrl tests are now correctly classified as local-only.
PAPERCUTS.md New file documenting 9 known environmental test failures (missing BloomPdfMaker.exe and Test-XMatter packs) in the agent output tree, with format and house rules as specified by the bloom-team-skills papercut convention.

Reviews (3): Last reviewed commit: "Restore updateSource re-upload assertion..." | Re-trigger Greptile

Comment thread src/BloomTests/WebLibraryIntegration/BookUploadAndDownloadTests.cs
The merged UploadBook_SameId_ReplacesFilesAndSetsParseFieldsCorrectly
kept the original's check that a re-upload's updateSource is not the
legacy "BloomDesktop old" only for the first upload; the re-upload
block needs it too, since "BloomDesktop old" also passes the retained
StartsWith("BloomDesktop ") check. (Caught by preflight's local review.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude/Fable] Consulted Devin on 2026-07-15 up to commit e2ad251 — review clean (no bugs, no flags).

@andrew-polk
andrew-polk marked this pull request as ready for review July 15, 2026 21:18
@StephenMcConnel
StephenMcConnel deleted the branch speedUpCSharpTests July 15, 2026 22:16
@andrew-polk andrew-polk reopened this Jul 16, 2026
@hatton
hatton merged commit 24e8547 into speedUpCSharpTests Jul 16, 2026
4 checks passed
@hatton
hatton deleted the fasterIntegrationTests branch July 16, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants