-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change to use operator for listing targets when possible (#2437)
* change to use operator for listing targets when possible * add tests * wip * this works * ?
- Loading branch information
Showing
11 changed files
with
440 additions
and
276 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Use operator to list targets to avoid inconsistencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
mod concurrent_steal; | ||
mod policies; | ||
mod sanity; | ||
mod setup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#![cfg(test)] | ||
#![cfg(feature = "operator")] | ||
use std::time::Duration; | ||
|
||
use regex::Regex; | ||
use rstest::rstest; | ||
|
||
use crate::utils::{config_dir, run_ls, run_verify_config, service, KubeService}; | ||
|
||
/// Tests for the `mirrord ls` command with operator | ||
#[rstest] | ||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
pub async fn mirrord_ls(#[future] service: KubeService) { | ||
let service = service.await; | ||
let mut process = run_ls::<true>(None, None).await; | ||
let res = process.wait().await; | ||
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)/.+(/container/.+)?$").unwrap(); | ||
targets | ||
.iter() | ||
.for_each(|output| assert!(re.is_match(output))); | ||
assert!(targets | ||
.iter() | ||
.any(|output| output.starts_with(&format!("pod/{}", service.name)))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters