mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
Signed-off-by: Alexandre Gaudreault <[email protected]> Signed-off-by: Kanika Rana <[email protected]> Signed-off-by: Kanika Rana <[email protected]> Signed-off-by: Oliver Gondža <[email protected]> Co-authored-by: Alexandre Gaudreault <[email protected]> Co-authored-by: Oliver Gondža <[email protected]>
41 lines
921 B
Go
41 lines
921 B
Go
package notification
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
|
|
)
|
|
|
|
// this implements the "when" part of given/when/then
|
|
//
|
|
// none of the func implement error checks, and that is complete intended, you should check for errors
|
|
// using the Then()
|
|
type Actions struct {
|
|
context *Context
|
|
|
|
healthy bool
|
|
}
|
|
|
|
func (a *Actions) SetParamInNotificationConfigMap(key, value string) *Actions {
|
|
a.context.T().Helper()
|
|
require.NoError(a.context.T(), fixture.SetParamInNotificationsConfigMap(key, value))
|
|
return a
|
|
}
|
|
|
|
func (a *Actions) Then() *Consequences {
|
|
a.context.T().Helper()
|
|
time.Sleep(fixture.WhenThenSleepInterval)
|
|
return &Consequences{a.context, a}
|
|
}
|
|
|
|
func (a *Actions) Healthcheck() *Actions {
|
|
a.context.T().Helper()
|
|
_, err := fixture.DoHttpRequest("GET",
|
|
"/metrics",
|
|
fixture.GetNotificationServerAddress())
|
|
a.healthy = err == nil
|
|
return a
|
|
}
|