Skip to content

test(picture-snapshot): stop depending on S3 in the create-with-file test - #1708

Merged
renemadsen merged 1 commit into
stablefrom
fix/picture-snapshot-test-no-s3
Sep 13, 2026
Merged

renemadsen merged 1 commit into
stablefrom
fix/picture-snapshot-test-no-s3

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Why

PictureSnapshotServiceTests.Create_CreatesPictureSnapshot_WithFile fails in CI with Expected: True, But was: False. This happens both in the plugin's own CI and in work-items-planning-container, for example run 34765800287.

  • What actually happens: the seeded SDK settings (SQL/420_SDK.sql) turn S3 on with placeholder keys (asdasd) pointed at real AWS. Every run has therefore failed the upload, and AWS answers 403 InvalidAccessKeyId.
  • Why it passed before: the test only passed while the SDK swallowed that failure.
  • What changed: Microting.eForm 10.0.39 stopped swallowing failed uploads (SDK commit 0a13ec22, "preserve the original AmazonS3Exception and stop swallowing failed uploads"). This shard has been red since 9e2ae84f bumped the plugin to 10.0.39.

What

S3 is the SDK's to test, not this plugin's.

  • SQL/420_SDK.sql: s3Enabled is now False. The SDK builds no S3 client, so the upload fails immediately with no network call. No other test in TimePlanning.Pn.Test uses S3 or this setting.
  • The test: it's renamed to Create_ReturnsFailureAndSavesNoSnapshot_WhenFileUploadFails and now checks the plugin's own behaviour when an upload fails:
    • Create returns failure.
    • No PictureSnapshot row is saved pointing at a file that was never stored.
    • The service logs the SDK's InvalidOperationException. That proves the upload step caused the failure, not an earlier lookup, and that no real S3 call was made.

Tests

  • PictureSnapshotServiceTests passes 6 of 6 locally, using Testcontainers MariaDB.
  • The run log has no S3 or AWS calls.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HfLyiGF7BQTRixiUfSuXxD

…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
Copilot AI lite review requested due to automatic review settings September 13, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@renemadsen
renemadsen merged commit 1ef699b into stable Sep 13, 2026
40 checks passed
@renemadsen
renemadsen deleted the fix/picture-snapshot-test-no-s3 branch September 13, 2026 17:10
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.

2 participants