test(picture-snapshot): stop depending on S3 in the create-with-file test - #1708
Merged
Merged
Conversation
…test Create_CreatesPictureSnapshot_WithFile only passed while the eForm SDK swallowed failed S3 uploads. The seeded SDK settings enable S3 with placeholder keys against real AWS, so every run actually failed the upload (403 InvalidAccessKeyId) and Create still returned success. Microting.eForm 10.0.39 stopped swallowing the failure (SDK 0a13ec22), and the test has failed since the plugin's bump to 10.0.39. S3 is the SDK's to test, not this plugin's: - SQL/420_SDK.sql seeds s3Enabled = False, so the SDK has no S3 client and the upload fails at once with no network call. No other test in the project uses S3 or this setting. - The test becomes Create_ReturnsFailureAndSavesNoSnapshot_WhenFileUploadFails: Create reports failure, saves no PictureSnapshot row pointing at a file that was never stored, and logs the SDK's InvalidOperationException, which proves the upload step was the cause. Verified locally: PictureSnapshotServiceTests 6/6 pass, no S3/AWS calls. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HfLyiGF7BQTRixiUfSuXxD
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes are deterministic and all approval-readiness assessments indicate no blocking issues.
Pull request overview
This PR removes the picture snapshot test’s dependency on real S3 and verifies upload-failure handling.
Changes:
- Disables S3 in the SDK test seed.
- Verifies failed uploads return failure, log the error, and persist no snapshot.
File summaries
| File | Description |
|---|---|
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/SQL/420_SDK.sql |
Disables S3 for isolated tests. |
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/PictureSnapshotServiceTests.cs |
Tests upload failure behavior, logging, and database consistency. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PictureSnapshotServiceTests.Create_CreatesPictureSnapshot_WithFilefails in CI withExpected: True, But was: False. This happens both in the plugin's own CI and inwork-items-planning-container, for example run 34765800287.SQL/420_SDK.sql) turn S3 on with placeholder keys (asdasd) pointed at real AWS. Every run has therefore failed the upload, and AWS answers403 InvalidAccessKeyId.Microting.eForm10.0.39 stopped swallowing failed uploads (SDK commit0a13ec22, "preserve the original AmazonS3Exception and stop swallowing failed uploads"). This shard has been red since9e2ae84fbumped the plugin to 10.0.39.What
S3 is the SDK's to test, not this plugin's.
SQL/420_SDK.sql:s3Enabledis nowFalse. The SDK builds no S3 client, so the upload fails immediately with no network call. No other test inTimePlanning.Pn.Testuses S3 or this setting.Create_ReturnsFailureAndSavesNoSnapshot_WhenFileUploadFailsand now checks the plugin's own behaviour when an upload fails:Createreturns failure.PictureSnapshotrow is saved pointing at a file that was never stored.InvalidOperationException. That proves the upload step caused the failure, not an earlier lookup, and that no real S3 call was made.Tests
PictureSnapshotServiceTestspasses 6 of 6 locally, using Testcontainers MariaDB.🤖 Generated with Claude Code
https://claude.ai/code/session_01HfLyiGF7BQTRixiUfSuXxD