Skip to content

Commit

Permalink
Added service to expected types
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 committed Jan 31, 2025
1 parent 2bfee57 commit 90f65b8
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions tests/src/operator/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,33 @@ pub async fn mirrord_ls(#[future] service_for_mirrord_ls: KubeService) {
assert!(res.success());
let stdout = process.get_stdout().await;
let targets: Vec<String> = serde_json::from_str(&stdout).unwrap();
let re =
Regex::new(r"^(pod|deployment|statefulset|cronjob|job|replicaset)/.+(/container/.+)?$")
.unwrap();
targets.iter().for_each(|output| {
assert!(
re.is_match(output),
"output line {output} does not match regex {re}"
);
});

for target_type in [
let expected_target_types = [
"pod",
"deployment",
"statefulset",
"cronjob",
"job",
"replicaset",
] {
"service",
];

let re = Regex::new(&format!(
r"^({})/.+(/container/.+)?$",
expected_target_types
.into_iter()
.collect::<Vec<_>>()
.join("|")
))
.unwrap();
targets.iter().for_each(|output| {
assert!(
re.is_match(output),
"output line {output} does not match regex {re}"
);
});

for target_type in expected_target_types {
assert!(
targets
.iter()
Expand Down

0 comments on commit 90f65b8

Please sign in to comment.