Skip to content

Commit

Permalink
test: ignore empty s3 bucket (GreptimeTeam#529)
Browse files Browse the repository at this point in the history
sunng87 authored Nov 16, 2022
1 parent e823cde commit 173a8f6
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 14 additions & 12 deletions src/object-store/tests/object_store_test.rs
Original file line number Diff line number Diff line change
@@ -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.");

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 store = ObjectStore::new(accessor);
test_object_crud(&store).await?;
test_object_list(&store).await?;
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(&bucket)
.build()?;

let store = ObjectStore::new(accessor);
test_object_crud(&store).await?;
test_object_list(&store).await?;
}
}

Ok(())
2 changes: 0 additions & 2 deletions src/query/src/expr.rs
Original file line number Diff line number Diff line change
@@ -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.


0 comments on commit 173a8f6

Please sign in to comment.