Skip to content

Commit

Permalink
Move unit tests out of verus! { ... } (#491)
Browse files Browse the repository at this point in the history
Signed-off-by: Xudong Sun <[email protected]>
  • Loading branch information
marshtompsxd authored Jun 4, 2024
1 parent d1c065b commit 70e8f38
Show file tree
Hide file tree
Showing 65 changed files with 1,704 additions and 1,867 deletions.
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ vstd = { path = "../verus/source/vstd" }
deps_hack = { path = "src/deps_hack" }
tungstenite = "0.20.1"
rand = "0.8"

[dev-dependencies]
proptest = "1.4.0"
8 changes: 5 additions & 3 deletions src/conformance_tests/api_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use deps_hack::kube::{
api::{Api, DeleteParams, ListParams, ObjectMeta, PostParams},
Client,
};
use deps_hack::proptest::prelude::*;
use deps_hack::tokio::runtime::Runtime;
use proptest::prelude::*;
use rand::Rng;
use std::process::Command;
use vstd::prelude::*;
Expand Down Expand Up @@ -98,12 +98,14 @@ fn create_new_testing_namespace(len: usize) -> Option<std::string::String> {
..Default::default()
};

namespace_api.create(&PostParams::default(), &namespace_obj).await
namespace_api
.create(&PostParams::default(), &namespace_obj)
.await
});

match resp {
Ok(_) => Some(namespace_name),
Err(_) => None
Err(_) => None,
}
}

Expand Down
133 changes: 133 additions & 0 deletions src/deps_hack/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/deps_hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ base64 = "0.13.0"
rand = "0.8"
zookeeper = "0.8"
chrono = "0.4.19"
proptest = "1.4.0"
1 change: 1 addition & 0 deletions src/deps_hack/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub use kube;
pub use kube_client;
pub use kube_core;
pub use kube_derive;
pub use proptest;
pub use rand;
pub use schemars;
pub use serde;
Expand Down
4 changes: 0 additions & 4 deletions src/unit_tests/kubernetes_api_objects/affinity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use deps_hack::k8s_openapi::apimachinery::pkg::apis::meta::v1::Time;
use vstd::prelude::*;
use vstd::string::*;

verus! {
// Tests for affinity
#[test]
#[verifier(external)]
pub fn test_kube() {
let kube_affinity = deps_hack::k8s_openapi::api::core::v1::Affinity {
node_affinity: Some(deps_hack::k8s_openapi::api::core::v1::NodeAffinity {
Expand All @@ -30,4 +27,3 @@ pub fn test_kube() {

assert_eq!(affinity.into_kube(), kube_affinity);
}
}
Loading

0 comments on commit 70e8f38

Please sign in to comment.