mirror of https://github.com/fluxcd/cli-utils.git
Add ExpErrorEvent for better e2e test failures
This commit is contained in:
parent
2a6b353b46
commit
8b1ad5067c
|
|
@ -17,6 +17,7 @@ type ExpEvent struct {
|
||||||
EventType event.Type
|
EventType event.Type
|
||||||
|
|
||||||
InitEvent *ExpInitEvent
|
InitEvent *ExpInitEvent
|
||||||
|
ErrorEvent *ExpErrorEvent
|
||||||
ActionGroupEvent *ExpActionGroupEvent
|
ActionGroupEvent *ExpActionGroupEvent
|
||||||
ApplyEvent *ExpApplyEvent
|
ApplyEvent *ExpApplyEvent
|
||||||
StatusEvent *ExpStatusEvent
|
StatusEvent *ExpStatusEvent
|
||||||
|
|
@ -29,6 +30,10 @@ type ExpInitEvent struct {
|
||||||
// ActionGroups []event.ActionGroup
|
// ActionGroups []event.ActionGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ExpErrorEvent struct {
|
||||||
|
Err error
|
||||||
|
}
|
||||||
|
|
||||||
type ExpActionGroupEvent struct {
|
type ExpActionGroupEvent struct {
|
||||||
GroupName string
|
GroupName string
|
||||||
Action event.ResourceAction
|
Action event.ResourceAction
|
||||||
|
|
@ -91,6 +96,20 @@ func isMatch(ee ExpEvent, e event.Event) bool {
|
||||||
|
|
||||||
// nolint:gocritic
|
// nolint:gocritic
|
||||||
switch e.Type {
|
switch e.Type {
|
||||||
|
case event.ErrorType:
|
||||||
|
a := ee.ErrorEvent
|
||||||
|
|
||||||
|
if a == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
b := e.ErrorEvent
|
||||||
|
|
||||||
|
if a.Err != nil {
|
||||||
|
if !cmp.Equal(a.Err, b.Err, cmpopts.EquateErrors()) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
case event.ActionGroupType:
|
case event.ActionGroupType:
|
||||||
agee := ee.ActionGroupEvent
|
agee := ee.ActionGroupEvent
|
||||||
|
|
||||||
|
|
@ -238,6 +257,14 @@ func EventToExpEvent(e event.Event) ExpEvent {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case event.ErrorType:
|
||||||
|
return ExpEvent{
|
||||||
|
EventType: event.ErrorType,
|
||||||
|
ErrorEvent: &ExpErrorEvent{
|
||||||
|
Err: e.ErrorEvent.Err,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
case event.ActionGroupType:
|
case event.ActionGroupType:
|
||||||
return ExpEvent{
|
return ExpEvent{
|
||||||
EventType: event.ActionGroupType,
|
EventType: event.ActionGroupType,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue