Skip to content

Commit

Permalink
rework alerting integration test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandreLamarre committed Sep 14, 2023
1 parent 298f0d6 commit 0dce2f0
Show file tree
Hide file tree
Showing 4 changed files with 927 additions and 959 deletions.
26 changes: 12 additions & 14 deletions test/plugins/alerting/alerting_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import (
. "github.com/onsi/gomega"
"github.com/prometheus/common/model"
"github.com/rancher/opni/pkg/alerting/drivers/routing"
"github.com/rancher/opni/pkg/test"
_ "github.com/rancher/opni/pkg/test/setup"
"github.com/rancher/opni/pkg/test/testruntime"
_ "github.com/rancher/opni/plugins/alerting/test"
_ "github.com/rancher/opni/plugins/metrics/test"
"github.com/samber/lo"
Expand Down Expand Up @@ -40,16 +38,16 @@ func TestAlerting(t *testing.T) {
RunSpecs(t, "Alerting Suite")
}

var env *test.Environment
var tmpConfigDir string
// var env *test.Environment
// var tmpConfigDir string

var _ = BeforeSuite(func() {
testruntime.IfIntegration(func() {
env = &test.Environment{}
Expect(env).NotTo(BeNil())
Expect(env.Start()).To(Succeed())
DeferCleanup(env.Stop)
tmpConfigDir = env.GenerateNewTempDirectory("alertmanager-config")
Expect(tmpConfigDir).NotTo(Equal(""))
})
})
// var _ = BeforeSuite(func() {
// testruntime.IfIntegration(func() {
// env = &test.Environment{}
// Expect(env).NotTo(BeNil())
// Expect(env.Start()).To(Succeed())
// DeferCleanup(env.Stop)
// tmpConfigDir = env.GenerateNewTempDirectory("alertmanager-config")
// Expect(tmpConfigDir).NotTo(Equal(""))
// })
// })
Loading

0 comments on commit 0dce2f0

Please sign in to comment.