aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJill <kokakiwi@deuxfleurs.fr>2022-02-07 17:00:03 +0100
committerJill <kokakiwi@deuxfleurs.fr>2022-02-11 10:50:55 +0100
commit84613e66a286536dff9828d8aca2625d2c6c6bf2 (patch)
treeec5fbca0adcc19fa05f3e6431335508ce135ad1e
parentc8b30ebc79364707526e2ae935b6e408924eef16 (diff)
downloadgarage-84613e66a286536dff9828d8aca2625d2c6c6bf2.tar.gz
garage-84613e66a286536dff9828d8aca2625d2c6c6bf2.zip
garage(tests): Remove RNG stuff
-rw-r--r--Cargo.nix1
-rw-r--r--src/garage/Cargo.toml1
-rw-r--r--src/garage/tests/common/mod.rs3
-rw-r--r--src/garage/tests/common/util.rs13
4 files changed, 1 insertions, 17 deletions
diff --git a/Cargo.nix b/Cargo.nix
index 43968d1d..c01222fe 100644
--- a/Cargo.nix
+++ b/Cargo.nix
@@ -985,7 +985,6 @@ in
devDependencies = {
aws_sdk_s3 = rustPackages."registry+https://github.com/rust-lang/crates.io-index".aws-sdk-s3."0.6.0" { inherit profileName; };
http = rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."0.2.5" { inherit profileName; };
- rand = rustPackages."registry+https://github.com/rust-lang/crates.io-index".rand."0.8.4" { inherit profileName; };
static_init = rustPackages."registry+https://github.com/rust-lang/crates.io-index".static_init."1.0.2" { inherit profileName; };
};
});
diff --git a/src/garage/Cargo.toml b/src/garage/Cargo.toml
index eaf35358..d6034bbd 100644
--- a/src/garage/Cargo.toml
+++ b/src/garage/Cargo.toml
@@ -56,5 +56,4 @@ netapp = "0.3.0"
aws-sdk-s3 = "0.6"
http = "0.2"
-rand = "0.8"
static_init = "1.0"
diff --git a/src/garage/tests/common/mod.rs b/src/garage/tests/common/mod.rs
index c40fde0f..32fa3848 100644
--- a/src/garage/tests/common/mod.rs
+++ b/src/garage/tests/common/mod.rs
@@ -7,7 +7,6 @@ pub mod macros;
pub mod client;
pub mod ext;
pub mod garage;
-pub mod util;
const REGION: Region = Region::from_static("garage-integ-test");
@@ -28,7 +27,7 @@ impl Context {
///
/// Return the created bucket full name.
pub fn create_bucket(&self, name: &str) -> String {
- let bucket_name = format!("{}-{}", name, util::random_id(6));
+ let bucket_name = name.to_owned();
self.garage
.command()
diff --git a/src/garage/tests/common/util.rs b/src/garage/tests/common/util.rs
deleted file mode 100644
index 49c72879..00000000
--- a/src/garage/tests/common/util.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-pub fn random_id(len: usize) -> String {
- use rand::distributions::Slice;
- use rand::Rng;
-
- static ALPHABET: &[u8] = b"abcdefghijklmnopqrstuvwxyz0123456789.";
-
- let rng = rand::thread_rng();
- rng.sample_iter(Slice::new(ALPHABET).unwrap())
- .map(|b| char::from(*b))
- .filter(|c| c.is_ascii_lowercase() || c.is_ascii_digit())
- .take(len)
- .collect()
-}