Skip to content

Commit adf5100

Browse files
committed
added tests
1 parent de20501 commit adf5100

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

charts/gitops-runtime/tests/event-reporters-sensors_test.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,19 @@ tests:
263263
allow:
264264
- 200
265265

266+
- it: HTTP trigger contains atLeastOnce if unset - rollout reporter
267+
template: 'event-reporters/rollout-reporter/sensor.yaml'
268+
values:
269+
- './values/mandatory-values.yaml'
270+
set:
271+
event-reporters.workflow.sensor:
272+
atLeastOnce: false
273+
asserts:
274+
- equal:
275+
path: spec.triggers[0].atLeastOnce
276+
value: false
277+
278+
266279
- it: HTTP trigger contains atLeastOnce if unset - workflow reporter
267280
template: 'event-reporters/workflow-reporter/sensor.yaml'
268281
values:
@@ -274,3 +287,25 @@ tests:
274287
- equal:
275288
path: spec.triggers[0].atLeastOnce
276289
value: false
290+
291+
- it: uses the correct eventBusName if type is jetstream - rollout reporter
292+
template: 'event-reporters/rollout-reporter/sensor.yaml'
293+
values:
294+
- './values/mandatory-values.yaml'
295+
set:
296+
global.runtime.eventBus.type: jetstream
297+
asserts:
298+
- equal:
299+
path: spec.eventBusName
300+
value: codefresh-eventbus-jetstream
301+
302+
- it: uses the correct eventBusName if type is jetstream - workflow reporter
303+
template: 'event-reporters/workflow-reporter/sensor.yaml'
304+
values:
305+
- './values/mandatory-values.yaml'
306+
set:
307+
global.runtime.eventBus.type: jetstream
308+
asserts:
309+
- equal:
310+
path: spec.eventBusName
311+
value: codefresh-eventbus-jetstream

charts/gitops-runtime/tests/eventbus_test.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,40 @@ tests:
2929
path: spec.jetstream
3030
- notExists:
3131
path: spec.nats
32+
33+
- it: Should create an EventBus with the correct default name (nats)
34+
template: eventbus/codefresh-eventbus.yaml
35+
values:
36+
- ./values/mandatory-values.yaml
37+
set:
38+
global.runtime.eventBus.type: nats
39+
asserts:
40+
- equal:
41+
path: metadata.name
42+
value: codefresh-eventbus
43+
44+
- it: Should create an EventBus with the correct override name (nats)
45+
template: eventbus/codefresh-eventbus.yaml
46+
values:
47+
- ./values/mandatory-values.yaml
48+
set:
49+
global.runtime.eventBus:
50+
name: manual-override
51+
type: nats
52+
asserts:
53+
- equal:
54+
path: metadata.name
55+
value: manual-override
56+
57+
- it: Should create an EventBus with the correct override name (jetstream)
58+
template: eventbus/codefresh-eventbus.yaml
59+
values:
60+
- ./values/mandatory-values.yaml
61+
set:
62+
global.runtime.eventBus:
63+
name: manual-override
64+
type: jetstream
65+
asserts:
3266
- equal:
3367
path: metadata.name
34-
value: codefresh-eventbus-jetstream
68+
value: manual-override

0 commit comments

Comments
 (0)