mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-27 00:19:58 +00:00
test: ignore empty s3 bucket (#529)
This commit is contained in:
@@ -104,18 +104,20 @@ async fn test_fs_backend() -> Result<()> {
|
||||
#[tokio::test]
|
||||
async fn test_s3_backend() -> Result<()> {
|
||||
logging::init_default_ut_logging();
|
||||
if env::var("GT_S3_BUCKET").is_ok() {
|
||||
logging::info!("Running s3 test.");
|
||||
if let Ok(bucket) = env::var("GT_S3_BUCKET") {
|
||||
if !bucket.is_empty() {
|
||||
logging::info!("Running s3 test.");
|
||||
|
||||
let accessor = s3::Builder::default()
|
||||
.access_key_id(&env::var("GT_S3_ACCESS_KEY_ID")?)
|
||||
.secret_access_key(&env::var("GT_S3_ACCESS_KEY")?)
|
||||
.bucket(&env::var("GT_S3_BUCKET")?)
|
||||
.build()?;
|
||||
let accessor = s3::Builder::default()
|
||||
.access_key_id(&env::var("GT_S3_ACCESS_KEY_ID")?)
|
||||
.secret_access_key(&env::var("GT_S3_ACCESS_KEY")?)
|
||||
.bucket(&bucket)
|
||||
.build()?;
|
||||
|
||||
let store = ObjectStore::new(accessor);
|
||||
test_object_crud(&store).await?;
|
||||
test_object_list(&store).await?;
|
||||
let store = ObjectStore::new(accessor);
|
||||
test_object_crud(&store).await?;
|
||||
test_object_list(&store).await?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -11,5 +11,3 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user