-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
154 additions
and
120 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod service_account_missing_test; | ||
mod status_field_populated_test; | ||
|
||
use rstest::*; | ||
|
36 changes: 36 additions & 0 deletions
36
sk-cli/src/validation/rules/tests/service_account_missing_test.rs
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,36 @@ | ||
|
||
use assertables::*; | ||
use serde_json::json; | ||
use sk_store::TraceEvent; | ||
|
||
use super::*; | ||
|
||
#[rstest] | ||
fn test_status_field_populated(test_deployment: DynamicObject) { | ||
let v = status_field_populated::validator(); | ||
let mut evt = AnnotatedTraceEvent { | ||
data: TraceEvent { | ||
ts: 1, | ||
applied_objs: vec![test_deployment.data(json!({"status": {"availableReplicas": 3}}))], | ||
deleted_objs: vec![], | ||
}, | ||
..Default::default() | ||
}; | ||
let indices = v.check_next_event(&mut evt); | ||
assert_bag_eq!(indices, &[0]); | ||
} | ||
|
||
#[rstest] | ||
fn test_status_field_not_populated(test_deployment: DynamicObject) { | ||
let v = status_field_populated::validator(); | ||
let mut evt = AnnotatedTraceEvent { | ||
data: TraceEvent { | ||
ts: 1, | ||
applied_objs: vec![test_deployment.data(json!({}))], | ||
deleted_objs: vec![], | ||
}, | ||
..Default::default() | ||
}; | ||
let indices = v.check_next_event(&mut evt); | ||
assert_is_empty!(indices); | ||
} |
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
Oops, something went wrong.