diff options
Diffstat (limited to 'development/tools/cargo-workspace2/tests')
8 files changed, 202 insertions, 0 deletions
diff --git a/development/tools/cargo-workspace2/tests/resources/Cargo.toml b/development/tools/cargo-workspace2/tests/resources/Cargo.toml new file mode 100644 index 000000000000..87cdac7cab85 --- /dev/null +++ b/development/tools/cargo-workspace2/tests/resources/Cargo.toml @@ -0,0 +1,11 @@ +[workspace] +members = [ + "lockchain-core", + "lockchain-files", + "lockchain-crypto", + + "lockchain-server", + "lockchain-client", + + "lockchain-http", +]
\ No newline at end of file diff --git a/development/tools/cargo-workspace2/tests/resources/lockchain-client/Cargo.toml b/development/tools/cargo-workspace2/tests/resources/lockchain-client/Cargo.toml new file mode 100644 index 000000000000..097319a81d20 --- /dev/null +++ b/development/tools/cargo-workspace2/tests/resources/lockchain-client/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "lockchain-client" +description = "Client side component of the lockchain stack. Decrypts records and provides a Rust API to use them." +version = "0.0.0" +authors = ["Katharina Fey <kookie@spacekookie.de>"] + +documentation = "https://docs.rs/lockchain-client" +homepage = "https://github.com/spacekookie/lockchain/tree/master/lockchain-client" +readme = "README.md" +license = "MIT/X11 OR Apache-2.0" + +[dependencies] +lockchain-core = { version = "0.9.0" } #, path = "../lockchain-core" } diff --git a/development/tools/cargo-workspace2/tests/resources/lockchain-core/Cargo.toml b/development/tools/cargo-workspace2/tests/resources/lockchain-core/Cargo.toml new file mode 100644 index 000000000000..4d6694c68a79 --- /dev/null +++ b/development/tools/cargo-workspace2/tests/resources/lockchain-core/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "lockchain-core" +description = "Provides common abstractions for the lockchain crate ecoystem" +documentation = "https://docs.rs/lockchain-core" +homepage = "https://github.com/spacekookie/lockchain/tree/master/lockchain-core" +readme = "README.md" +license = "MIT/X11 OR Apache-2.0" +version = "0.9.1-alpha.0" +authors = ["Katharina Fey <kookie@spacekookie.de>"] + +[dependencies] +chrono = { version = "0.4", features = ["serde"] } +serde_derive = "1.0" +serde_json = "1.0" +serde = "1.0" + +nix = "0.11" +pam-auth = "0.5" + +base64 = "0.8" +bcrypt = "0.2" +rand = "0.4" +blake2 = "0.7" + +keybob = "0.3" diff --git a/development/tools/cargo-workspace2/tests/resources/lockchain-crypto/Cargo.toml b/development/tools/cargo-workspace2/tests/resources/lockchain-crypto/Cargo.toml new file mode 100644 index 000000000000..10a69aeb39d0 --- /dev/null +++ b/development/tools/cargo-workspace2/tests/resources/lockchain-crypto/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "lockchain-crypto" +description = "Small shim layer crate for cryptographic operations on lockchain data records" +documentation = "https://docs.rs/lockchain-crypto" +homepage = "https://github.com/spacekookie/lockchain/tree/master/lockchain-crypto" +readme = "README.md" +license = "MIT/X11 OR Apache-2.0" +version = "0.8.1-alpha.0" +authors = ["Katharina Fey <kookie@spacekookie.de>"] + +[dependencies] +lockchain-core = { version = "0.9.1-alpha.0", path = "../lockchain-core" } +serde_derive = "1.0" +serde = "1.0" + +miscreant = "0.4.0-beta1"
\ No newline at end of file diff --git a/development/tools/cargo-workspace2/tests/resources/lockchain-files/Cargo.toml b/development/tools/cargo-workspace2/tests/resources/lockchain-files/Cargo.toml new file mode 100644 index 000000000000..e63455a40c6b --- /dev/null +++ b/development/tools/cargo-workspace2/tests/resources/lockchain-files/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "lockchain-files" +description = "Filesystem storage backend for lockchain vaults" +version = "0.9.1-alpha.0" +authors = ["Katharina Fey <kookie@spacekookie.de>"] + +documentation = "https://docs.rs/lockchain-files" +homepage = "https://github.com/spacekookie/lockchain/tree/master/lockchain-files" +readme = "README.md" +license = "MIT/X11 OR Apache-2.0" + +[dependencies] +lockchain-core = { version = "0.9.1-alpha.0", path = "../lockchain-core" } diff --git a/development/tools/cargo-workspace2/tests/resources/lockchain-http/Cargo.toml b/development/tools/cargo-workspace2/tests/resources/lockchain-http/Cargo.toml new file mode 100644 index 000000000000..91500336aafe --- /dev/null +++ b/development/tools/cargo-workspace2/tests/resources/lockchain-http/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "lockchain-http" +description = "Generic HTTP interface crate for the lockchain ecosystem. Can serve both encrypted and cleartext records" +version = "0.4.1-alpha.0" +authors = ["Katharina Fey <kookie@spacekookie.de>"] + +documentation = "https://docs.rs/lockchain-http" +homepage = "https://github.com/spacekookie/lockchain/tree/master/lockchain-http" +readme = "README.md" +license = "MIT/X11 OR Apache-2.0" + +[dependencies] +lockchain-core = { version = "0.9.1-alpha.0", path = "../lockchain-core" } +env_logger = "0.5" + +# Serialisation stack +serde = "1.0" +serde_derive = "1.0" + +# Web Stack +futures = "0.1" +actix = "0.5" +actix-web = "0.6"
\ No newline at end of file diff --git a/development/tools/cargo-workspace2/tests/resources/lockchain-server/Cargo.toml b/development/tools/cargo-workspace2/tests/resources/lockchain-server/Cargo.toml new file mode 100644 index 000000000000..1fa3a329bb78 --- /dev/null +++ b/development/tools/cargo-workspace2/tests/resources/lockchain-server/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "lockchain-server" +version = "0.1.0" +authors = ["Katharina Fey <kookie@spacekookie.de>"] + +[dependencies] +lockchain-core = { path = "../lockchain-core" } +lockchain-files = { path = "../lockchain-files" } +lockchain-http = { path = "../lockchain-http" } + +clap = "2.0" +insult = "2.0.3"
\ No newline at end of file diff --git a/development/tools/cargo-workspace2/tests/tests.rs b/development/tools/cargo-workspace2/tests/tests.rs new file mode 100644 index 000000000000..b417c4806220 --- /dev/null +++ b/development/tools/cargo-workspace2/tests/tests.rs @@ -0,0 +1,89 @@ +// extern crate cargo_ws_release; + +// use cargo_ws_release::data_models::level::Level; +// use cargo_ws_release::do_batch_release; +// use cargo_ws_release::utilities::cargo_utils::bump_version; +// use std::env::*; +// use std::fs::File; +// use std::path::Path; + +// #[test] +// fn do_batch_release_returns_dependency_graph() { +// let project_dir = current_dir().unwrap().to_str().unwrap().to_owned(); +// let test_resource_dir = format!("{}/tests/resources", project_dir); +// assert!(set_current_dir(Path::new(&test_resource_dir)).is_ok()); +// let test_cargo_file_path = format!("{}/Cargo.toml", test_resource_dir); +// let cargo_file = File::open(test_cargo_file_path).expect("Failed to open test Cargo.toml"); + +// let dep_graph = do_batch_release(cargo_file, &Level::Major); + +// assert!(dep_graph.nodes.contains_key("lockchain-server")); +// assert!( +// dep_graph +// .nodes +// .get("lockchain-http") +// .unwrap() +// .deps +// .first() +// .unwrap() +// .name +// == "lockchain-core" +// ) +// } + +// #[test] +// fn parse_level_from_str() { +// let levels = vec![ +// ("major", Some(Level::Major)), +// ("minor", Some(Level::Minor)), +// ("patch", Some(Level::Patch)), +// ("rc", Some(Level::RC)), +// ("beta", Some(Level::Beta)), +// ("alpha", Some(Level::Alpha)), +// ("invalid_level", None), +// ]; + +// levels +// .iter() +// .for_each(|(level_str, level)| assert_eq!(Level::from_str(level_str), *level)); +// } + +// #[test] +// fn bump_version_with_level() { +// let versions = vec![ +// ("0.9.9", Level::Major, "1.0.0"), +// ("0.9.9", Level::Minor, "0.10.0"), +// ("0.9.9", Level::Patch, "0.9.10"), +// ("1.9.9", Level::Alpha, "1.9.10-alpha.1"), +// ("1.9.9", Level::Beta, "1.9.10-beta.1"), +// ("1.9.9", Level::RC, "1.9.10-rc.1"), +// ("1.9.9-dev", Level::Alpha, "1.9.9-alpha.1"), +// ("1.9.9-test", Level::Beta, "1.9.9-beta.1"), +// ("1.9.9-stg", Level::RC, "1.9.9-rc.1"), +// ("1.9.9-dev.1", Level::Alpha, "1.9.9-alpha.1"), +// ("1.9.9-test.4", Level::Beta, "1.9.9-beta.1"), +// ("1.9.9-stg.2", Level::RC, "1.9.9-rc.1"), +// ("2.3.9-alpha.8", Level::Alpha, "2.3.9-alpha.9"), +// ("2.3.9-beta.7", Level::Beta, "2.3.9-beta.8"), +// ("2.3.9-rc.6", Level::RC, "2.3.9-rc.7"), +// ("2.3.9-alpha.8.5.6.7.4", Level::Alpha, "2.3.9-alpha.9"), +// ]; + +// versions +// .iter() +// .for_each(|(given_version, given_level, expected_version)| { +// assert_eq!( +// bump_version(given_version, given_level).unwrap(), +// expected_version.to_string() +// ) +// }); +// } + +// #[test] +// fn bump_version_invalid_version_error() { +// let invalid_versions = vec!["a.b.c", "1.x.0", "1.", ".0.1", "1.1", "", " 1. 2. 3"]; + +// invalid_versions +// .iter() +// .for_each(|v| assert!(bump_version(v, &Level::Major).is_err())); +// } |