Skip to content

Support for registration messaging backends other than SMTP (e.g., local file)#615

Merged
marcua merged 29 commits intomainfrom
smtp-cleanup
Jul 5, 2025
Merged

Support for registration messaging backends other than SMTP (e.g., local file)#615
marcua merged 29 commits intomainfrom
smtp-cleanup

Conversation

@marcua
Copy link
Copy Markdown
Owner

@marcua marcua commented Jun 25, 2025

Resolves #217 and generally makes integration testing easier.

As part of this, resolved two tangential issues that made tests fail:

  • LocalStack (but really the Colima/Docker stack on macOS) was causing by migrating to MinIO. The network setup was unstable on Colima/macOS. Seeing the fix (--network host), it might be unnecessary to have left LocalStack, but MinIO also seems like a more direct solution to the S3-compatible storage problem than the more general-purpose LocalStack.
  • Various race conditions between (asynchronous) snapshots and test assertions made tests fail relatively frequently. Added sleeps between inserts, updates, and snapshot restores to allow predictability of snapshot count/state between modifications.

Comment thread src/email/backend.rs Outdated
}
}

#[cfg(test)]
Copy link
Copy Markdown
Owner Author

@marcua marcua Jun 29, 2025

Choose a reason for hiding this comment

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

Remove, we test either/or logic farther down

Comment thread tests/e2e.rs Outdated
Comment thread tests/e2e_tests/registration_tests.rs Outdated
Comment thread tests/email_helpers.rs Outdated
marcua and others added 11 commits June 29, 2025 11:44
* Stabilize snapshot tests by migrating LocalStack -> Minio

* Remove localstack data

* Separate docker setup for macOS vs Linux/CI
This is Phase 1 of investigating CI snapshot test failures.
Adds extensive logging to identify timing and storage issues:

MinIO setup (tests/run_minio.sh):
- Timestamped container lifecycle logging
- Detailed S3 API connectivity testing
- Environment detection and networking diagnostics
- Comprehensive readiness verification

Snapshot storage (src/server/snapshots/storage.rs):
- S3 connection setup logging
- Upload/download operation timing
- Compression ratio and performance metrics
- Detailed error context for failures

Test progression (tests/e2e_tests/snapshot_tests.rs):
- Step-by-step test state logging
- Snapshot count and timing verification
- Sleep duration and timing tracking
- Database modification confirmation

This logging will help identify:
- MinIO container startup issues
- S3 operation failures
- Timing race conditions
- Snapshot creation/pruning problems

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Adds explicit log crate dependency to Cargo.toml to resolve
compilation error in snapshot storage logging code.

The log crate was being used transitively through env_logger
but needs to be explicitly declared for direct usage.

Fixes compilation error:
error[E0432]: unresolved import `log`

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Resolves formatting and linting issues identified by make lint:
- Remove trailing whitespace from snapshot storage logging
- Fix clippy::len_zero warning (use \!is_empty() instead of len() > 0)
- Auto-format code with cargo fmt for consistent style

All tests pass and linting is now clean.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Enhanced snapshot automation logging with timestamps and detailed pruning info
- Added pre-restore snapshot verification to detect race conditions
- Added restore endpoint logging to track snapshot availability
- Timestamps and snapshot IDs logged at every critical point

This will help identify if automated snapshots are triggering pruning between test listing and restoration attempts.
Comment thread tests/e2e_tests/snapshot_tests.rs Outdated
)?;
thread::sleep(time::Duration::from_secs(4));

// There are 3 max_snapshots, so let's
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Update comment

@marcua marcua merged commit cc78761 into main Jul 5, 2025
1 check passed
@marcua marcua deleted the smtp-cleanup branch July 5, 2025 14:15
@marcua marcua mentioned this pull request Jul 6, 2025
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.

Add a developer-friendly way to use registration without an SMTP server

1 participant