Skip to content

Commit

Permalink
feat: fuzz test support read from .env by different services (#2824)
Browse files Browse the repository at this point in the history
* chore: maintain oss-fuzz build script

Signed-off-by: dqhl76 <dqhl76@gmail.com>

* fix: remove debug print

Signed-off-by: dqhl76 <dqhl76@gmail.com>

* fix: remove build script

Signed-off-by: dqhl76 <dqhl76@gmail.com>

* refact: use .schema.env

fix: make clippy happy

Signed-off-by: dqhl76 <dqhl76@gmail.com>

rustfmt

Signed-off-by: dqhl76 <dqhl76@gmail.com>

refact: use .schema.env

Signed-off-by: dqhl76 <dqhl76@gmail.com>

---------

Signed-off-by: dqhl76 <dqhl76@gmail.com>
  • Loading branch information
dqhl76 committed Aug 9, 2023
1 parent 24e52b2 commit ee34c9e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/fuzz/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ee34c9e

Please sign in to comment.