-
Notifications
You must be signed in to change notification settings - Fork 859
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
Make ring optional and cleanup tests #2344
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1009,34 +1009,6 @@ where | |
} | ||
} | ||
|
||
impl Error { | ||
#[cfg(test)] | ||
fn s3_error_due_to_credentials(&self) -> bool { | ||
use rusoto_core::RusotoError; | ||
use Error::*; | ||
|
||
matches!( | ||
self, | ||
UnableToPutData { | ||
source: RusotoError::Credentials(_), | ||
bucket: _, | ||
path: _, | ||
} | UnableToGetData { | ||
source: RusotoError::Credentials(_), | ||
bucket: _, | ||
path: _, | ||
} | UnableToDeleteData { | ||
source: RusotoError::Credentials(_), | ||
bucket: _, | ||
path: _, | ||
} | UnableToListData { | ||
source: RusotoError::Credentials(_), | ||
bucket: _, | ||
} | ||
) | ||
} | ||
} | ||
|
||
struct S3MultiPartUpload { | ||
bucket: String, | ||
key: String, | ||
|
@@ -1168,9 +1140,6 @@ mod tests { | |
use bytes::Bytes; | ||
use std::env; | ||
|
||
type TestError = Box<dyn std::error::Error + Send + Sync + 'static>; | ||
type Result<T, E = TestError> = std::result::Result<T, E>; | ||
|
||
const NON_EXISTENT_NAME: &str = "nonexistentname"; | ||
|
||
// Helper macro to skip tests if TEST_INTEGRATION and the AWS | ||
|
@@ -1250,32 +1219,16 @@ mod tests { | |
}}; | ||
} | ||
|
||
fn check_credentials<T>(r: Result<T>) -> Result<T> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has been broken since the move to an object-safe ObjectStore, and isn't really providing meaningful value - lets just remove it |
||
if let Err(e) = &r { | ||
let e = &**e; | ||
if let Some(e) = e.downcast_ref::<Error>() { | ||
if e.s3_error_due_to_credentials() { | ||
eprintln!( | ||
"Try setting the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY \ | ||
environment variables" | ||
); | ||
} | ||
} | ||
} | ||
|
||
r | ||
} | ||
|
||
#[tokio::test] | ||
async fn s3_test() { | ||
let config = maybe_skip_integration!(); | ||
let integration = config.build().unwrap(); | ||
|
||
check_credentials(put_get_delete_list(&integration).await).unwrap(); | ||
check_credentials(list_uses_directories_correctly(&integration).await).unwrap(); | ||
check_credentials(list_with_delimiter(&integration).await).unwrap(); | ||
check_credentials(rename_and_copy(&integration).await).unwrap(); | ||
check_credentials(stream_get(&integration).await).unwrap(); | ||
put_get_delete_list(&integration).await; | ||
list_uses_directories_correctly(&integration).await; | ||
list_with_delimiter(&integration).await; | ||
rename_and_copy(&integration).await; | ||
stream_get(&integration).await; | ||
} | ||
|
||
#[tokio::test] | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was purely an oversight in influxdata/object_store_rs#42