This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/main by this push:
new ee34c9e49 feat: fuzz test support read from .env by different services
(#2824)
ee34c9e49 is described below
commit ee34c9e49248e284a84e4117818f5b894696e01c
Author: Liuqing Yue <[email protected]>
AuthorDate: Wed Aug 9 13:54:25 2023 +0800
feat: fuzz test support read from .env by different services (#2824)
* chore: maintain oss-fuzz build script
Signed-off-by: dqhl76 <[email protected]>
* fix: remove debug print
Signed-off-by: dqhl76 <[email protected]>
* fix: remove build script
Signed-off-by: dqhl76 <[email protected]>
* refact: use .schema.env
fix: make clippy happy
Signed-off-by: dqhl76 <[email protected]>
rustfmt
Signed-off-by: dqhl76 <[email protected]>
refact: use .schema.env
Signed-off-by: dqhl76 <[email protected]>
---------
Signed-off-by: dqhl76 <[email protected]>
---
core/fuzz/utils.rs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/core/fuzz/utils.rs b/core/fuzz/utils.rs
index adc301557..8a6501843 100644
--- a/core/fuzz/utils.rs
+++ b/core/fuzz/utils.rs
@@ -22,6 +22,13 @@ use opendal::Scheme;
fn service(scheme: Scheme) -> Option<Operator> {
let test_key = format!("opendal_{}_test", scheme).to_uppercase();
+
+ let args: Vec<String> = env::args().collect();
+ if args[0].ends_with(&scheme.to_string()) {
+ // if not exist, fallback to .env
+ let _ = dotenvy::from_filename_override(format!(".{scheme}.env"));
+ }
+
if env::var(test_key).unwrap_or_default() != "on" {
return None;
}