Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendesce committed Jan 6, 2024
1 parent c0cb4e9 commit 6340b04
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,13 @@ public void creationTest() {
await().atMost(5, MINUTES).untilAsserted(() ->
assertNotNull(operator.get(Scenario.class, "scenario-test")));
}

@Test
public void creationTestFromFile() {
var resource = operator.resources(Scenario.class).load(getClass().getResourceAsStream("/scenario-sample.yaml"));
var created = resource.create();

await().atMost(5, MINUTES).untilAsserted(() ->
assertNotNull(operator.get(Scenario.class, "example-scenario")));
}
}
21 changes: 21 additions & 0 deletions src/test/resources/scenario-sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: resiliencebench.io/v1
kind: Scenario
metadata:
name: example-scenario
spec:
targetServiceName: service-1
sourceServiceName: service-2
workload:
workloadName: example-workload
users: 10
patternConfig:
intValue: 1
stringValue: "value"
floatValue: 1.0
boolValue: true
fault:
percentage: 10
delay:
duration: 100


0 comments on commit 6340b04

Please sign in to comment.