Skip to content

Commit

Permalink
feat: add MustPassRepeatedly integration test for config override
Browse files Browse the repository at this point in the history
Signed-off-by: maxcleme <maxime.clement@docker.com>
  • Loading branch information
maxcleme committed Aug 23, 2023
1 parent 3e56e30 commit 81bf832
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package config_override_label_filter_fixture_test

import (
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

func TestConfigOverrideFixture(t *testing.T) {
RegisterFailHandler(Fail)
suiteConfig, reporterConfig := GinkgoConfiguration()
suiteConfig.MustPassRepeatedly = 10
RunSpecs(t, "ConfigOverrideFixture Suite", suiteConfig, reporterConfig)
}

var _ = Describe("tests", func() {
It("suite config overrides decorator", MustPassRepeatedly(2), func() {
Ω(CurrentSpecReport().MaxMustPassRepeatedly).Should(Equal(10))
})
})
11 changes: 11 additions & 0 deletions integration/repeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,15 @@ var _ = Describe("Repeat", func() {
Ω(session.Err).Should(gbytes.Say("--repeat and --until-it-fails are both set"))
})
})

Context("if MustPassRepeatedly is set at suite config level", func() {
BeforeEach(func() {
fm.MountFixture("config_override_must_pass_repeatedly")
})

It("it should override node decorator", func() {
session := startGinkgo(fm.PathTo("config_override_must_pass_repeatedly"))
Eventually(session).Should(gexec.Exit(0))
})
})
})

0 comments on commit 81bf832

Please sign in to comment.