generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 35
feat: add integration test foundation with basic secret retrieval tests #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+992
−15
Conversation
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
=======================================
Coverage 91.72% 91.72%
=======================================
Files 14 14
Lines 2418 2418
Branches 2418 2418
=======================================
Hits 2218 2218
Misses 150 150
Partials 50 50 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
simonmarty
requested changes
Oct 1, 2025
- Replace std::thread::sleep with tokio::time::sleep and proper HTTP timeouts - Create structured AgentQuery with Display trait for extensible query building - Replace AWS CLI usage with AWS SDK for secret ARN retrieval - Move secret creation to test setup phase with proper lifecycle management - Create separate integration-tests crate to isolate dependencies - Add proper test structure with ignored integration tests for CI compatibility - Update test script to work with new crate structure - Maintain all existing functionality while improving code quality
simonmarty
requested changes
Oct 1, 2025
- Use url crate for proper URL construction instead of string formatting - Replace string paths with PathBuf for cross-platform path handling - Eliminate sleep in async code by reading agent stdout for ready signal - Use tokio::process::Command for proper async process management - Add process and io-util features to tokio dependency - Remove unused imports and constants - Maintain fail-fast behavior without polling loops All URL construction now uses proper parsing and query building. Agent startup detection waits for actual 'listening on' message. No more sleep() calls in async functions.
simonmarty
requested changes
Oct 1, 2025
simonmarty
previously approved these changes
Oct 2, 2025
- Add test_binary_secret_retrieval for SecretBinary field handling - Add test_version_stage_retrieval for AWSPENDING/AWSCURRENT stages - Add test_version_id_retrieval for specific version ID access - Add test_large_secret_retrieval for near 64KB limit handling - Enhance common.rs with improved setup and cleanup functions
…polling - Replace manual cleanup with TestSecrets struct using Drop trait for guaranteed cleanup - Add comprehensive integration tests for binary secrets, version stages, version IDs, and large secrets - Replace sleep antipattern with timeout-based polling using tokio::time::timeout - Implement proper error handling with Result types - Ensure automatic secret cleanup even if tests panic or fail - Remove redundant legacy functions to eliminate code duplication
simonmarty
requested changes
Oct 3, 2025
simonmarty
requested changes
Oct 3, 2025
crus-umich
reviewed
Oct 3, 2025
crus-umich
reviewed
Oct 3, 2025
- Convert standalone functions to AgentProcess methods (start_on_port, make_request) - Move AWSPENDING version waiting to specific tests that need it - Use kill_on_drop(true) for automatic process cleanup instead of Drop trait - Encapsulate polling logic in wait_for_pending_version method with timeout protection - Enable validate_credentials in test config for better test coverage
simonmarty
requested changes
Oct 6, 2025
Since kill_on_drop(true) is configured, manual kill() calls are unnecessary. The process will be automatically terminated when Child is dropped on panic.
simonmarty
requested changes
Oct 6, 2025
reyhankoyun
commented
Oct 6, 2025
crus-umich
reviewed
Oct 6, 2025
simonmarty
previously approved these changes
Oct 7, 2025
crus-umich
approved these changes
Oct 7, 2025
simonmarty
approved these changes
Oct 7, 2025
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.
Issue #, if available:
Description of changes: Added the foundation for AWS Secrets Manager integration tests with basic secret retrieval validation. This enables testing real AWS interactions that unit tests cannot cover, ensuring the agent works correctly with live AWS services.
Changes
tests/common/
) - Shared utilities for agent lifecycle management and AWS interactionstests/secret_retrieval.rs
) - 2 tests covering basic AWS Secrets Manager featurestest-local.sh
) - Automated setup, execution, and cleanup of integration testsreqwest
andserde_json
for HTTP client and JSON parsingTesting
Run locally with AWS credentials:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.