Skip to content

Commit

Permalink
Export object_store integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed May 2, 2024
1 parent eb2d00b commit cf45dd0
Show file tree
Hide file tree
Showing 13 changed files with 1,128 additions and 1,090 deletions.
1 change: 1 addition & 0 deletions object_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ gcp = ["cloud", "rustls-pemfile"]
aws = ["cloud", "md-5"]
http = ["cloud"]
tls-webpki-roots = ["reqwest?/rustls-tls-webpki-roots"]
integration = []

[dev-dependencies] # In alphabetical order
futures-test = "0.3"
Expand Down
18 changes: 10 additions & 8 deletions object_store/src/aws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,16 @@ impl MultipartStore for AmazonS3 {
#[cfg(test)]
mod tests {
use super::*;
use crate::{client::get::GetClient, tests::*};
use crate::client::get::GetClient;
use crate::integration::*;
use crate::tests::*;
use hyper::HeaderMap;

const NON_EXISTENT_NAME: &str = "nonexistentname";

#[tokio::test]
async fn s3_test() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let config = AmazonS3Builder::from_env();

let integration = config.build().unwrap();
Expand Down Expand Up @@ -475,7 +477,7 @@ mod tests {

#[tokio::test]
async fn s3_test_get_nonexistent_location() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let integration = AmazonS3Builder::from_env().build().unwrap();

let location = Path::from_iter([NON_EXISTENT_NAME]);
Expand All @@ -488,7 +490,7 @@ mod tests {

#[tokio::test]
async fn s3_test_get_nonexistent_bucket() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let config = AmazonS3Builder::from_env().with_bucket_name(NON_EXISTENT_NAME);
let integration = config.build().unwrap();

Expand All @@ -500,7 +502,7 @@ mod tests {

#[tokio::test]
async fn s3_test_put_nonexistent_bucket() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let config = AmazonS3Builder::from_env().with_bucket_name(NON_EXISTENT_NAME);
let integration = config.build().unwrap();

Expand All @@ -513,7 +515,7 @@ mod tests {

#[tokio::test]
async fn s3_test_delete_nonexistent_location() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let integration = AmazonS3Builder::from_env().build().unwrap();

let location = Path::from_iter([NON_EXISTENT_NAME]);
Expand All @@ -523,7 +525,7 @@ mod tests {

#[tokio::test]
async fn s3_test_delete_nonexistent_bucket() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let config = AmazonS3Builder::from_env().with_bucket_name(NON_EXISTENT_NAME);
let integration = config.build().unwrap();

Expand Down Expand Up @@ -560,7 +562,7 @@ mod tests {
}

async fn s3_encryption(store: &AmazonS3) {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();

let data = PutPayload::from(vec![3u8; 1024]);

Expand Down
3 changes: 2 additions & 1 deletion object_store/src/azure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,13 @@ impl MultipartStore for MicrosoftAzure {
#[cfg(test)]
mod tests {
use super::*;
use crate::integration::*;
use crate::tests::*;
use bytes::Bytes;

#[tokio::test]
async fn azure_blob_test() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let integration = MicrosoftAzureBuilder::from_env().build().unwrap();

put_get_delete_list(&integration).await;
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/chunked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ mod tests {
use crate::local::LocalFileSystem;
use crate::memory::InMemory;
use crate::path::Path;
use crate::tests::*;
use crate::integration::*;

use super::*;

Expand Down
15 changes: 8 additions & 7 deletions object_store/src/gcp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ mod test {

use credential::DEFAULT_GCS_BASE_URL;

use crate::integration::*;
use crate::tests::*;

use super::*;
Expand All @@ -281,7 +282,7 @@ mod test {

#[tokio::test]
async fn gcs_test() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let integration = GoogleCloudStorageBuilder::from_env().build().unwrap();

put_get_delete_list(&integration).await;
Expand All @@ -307,7 +308,7 @@ mod test {
#[tokio::test]
#[ignore]
async fn gcs_test_sign() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let integration = GoogleCloudStorageBuilder::from_env().build().unwrap();

let client = reqwest::Client::new();
Expand Down Expand Up @@ -336,7 +337,7 @@ mod test {

#[tokio::test]
async fn gcs_test_get_nonexistent_location() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let integration = GoogleCloudStorageBuilder::from_env().build().unwrap();

let location = Path::from_iter([NON_EXISTENT_NAME]);
Expand All @@ -351,7 +352,7 @@ mod test {

#[tokio::test]
async fn gcs_test_get_nonexistent_bucket() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let config = GoogleCloudStorageBuilder::from_env();
let integration = config.with_bucket_name(NON_EXISTENT_NAME).build().unwrap();

Expand All @@ -369,7 +370,7 @@ mod test {

#[tokio::test]
async fn gcs_test_delete_nonexistent_location() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let integration = GoogleCloudStorageBuilder::from_env().build().unwrap();

let location = Path::from_iter([NON_EXISTENT_NAME]);
Expand All @@ -383,7 +384,7 @@ mod test {

#[tokio::test]
async fn gcs_test_delete_nonexistent_bucket() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let config = GoogleCloudStorageBuilder::from_env();
let integration = config.with_bucket_name(NON_EXISTENT_NAME).build().unwrap();

Expand All @@ -398,7 +399,7 @@ mod test {

#[tokio::test]
async fn gcs_test_put_nonexistent_bucket() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let config = GoogleCloudStorageBuilder::from_env();
let integration = config.with_bucket_name(NON_EXISTENT_NAME).build().unwrap();

Expand Down
3 changes: 2 additions & 1 deletion object_store/src/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,14 @@ impl HttpBuilder {

#[cfg(test)]
mod tests {
use crate::integration::*;
use crate::tests::*;

use super::*;

#[tokio::test]
async fn http_test() {
crate::test_util::maybe_skip_integration!();
maybe_skip_integration!();
let url = std::env::var("HTTP_URL").expect("HTTP_URL must be set");
let options = ClientOptions::new().with_allow_http(true);
let integration = HttpBuilder::new()
Expand Down

0 comments on commit cf45dd0

Please sign in to comment.