Skip to content

Commit

Permalink
Fix broken build (#1308)
Browse files Browse the repository at this point in the history
Co-authored-by: trunk bot <bot@trunk.io>
  • Loading branch information
EliSchleifer and trunk bot authored Mar 28, 2024
1 parent 5993c28 commit 4a96e98
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,6 @@ fn test_with_flakes(config: &Conf) -> bool {
random_float > config.flake_rate
}

fn test_with_flakes(config: &Conf) -> bool {
let is_merge_str = env::var("IS_MERGE").unwrap_or_else(|_| String::from("false"));
let is_merge = is_merge_str.to_lowercase() == "true";

if !is_merge {
println!("no flake or sleep when running on pr branch");
return true;
}

println!("sleeping for {} seconds", config.sleep_duration().as_secs());
thread::sleep(config.sleep_duration());

let mut rng = rand::thread_rng();
let random_float = rng.gen_range(0.0..1.0);

println!("Random float: {}", random_float);
println!("Flake rate: {}", config.flake_rate);

random_float > config.flake_rate
}

fn create_pull_request(words: &[String]) -> String {
let branch_name = format!("change/{}", words.join("-"));
git(&["checkout", "-t", "-b", &branch_name]);
Expand Down

0 comments on commit 4a96e98

Please sign in to comment.