Skip to content

Commit

Permalink
godog fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
suryagupta4 committed Jan 3, 2025
1 parent 670fc5e commit c3fc959
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
9 changes: 5 additions & 4 deletions test/bdd-test/bdd_main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ func TestMain(m *testing.M) {
flag.Parse()
opt.Format = "pretty"
opt.Paths = []string{"features"}

exitVal := godog.RunWithOptions("godog", func(s *godog.Suite) {
FeatureContext(s)
}, opt)
exitVal := godog.TestSuite{
Name: "godog",
ScenarioInitializer: FeatureContext,
Options: &opt,
}.Run()
if st := m.Run(); st > exitVal {
exitVal = st
}
Expand Down
2 changes: 1 addition & 1 deletion test/bdd-test/bdd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ func (f *feature) whenICallGetCapacity() error {
return nil
}

func FeatureContext(s *godog.Suite) {
func FeatureContext(s *godog.ScenarioContext) {
f := &feature{}
s.Step(`^a CSI service$`, f.aCSIService)
s.Step(`^a CSI service with node$`, f.aCSIServiceWithNode)
Expand Down
12 changes: 7 additions & 5 deletions test/integration-test/integration_main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ func TestMain(m *testing.M) {
grpcClient, stop = startServer(ctx)
fmt.Printf("back from startServer")
time.Sleep(5 * time.Second)

exitVal := godog.RunWithOptions("godog", func(s *godog.Suite) {
FeatureContext(s)
}, godog.Options{
opt := godog.Options{
Format: "pretty",
Paths: []string{"features"},
})
}
exitVal := godog.TestSuite{
Name: "godog",
ScenarioInitializer: FeatureContext,
Options: &opt,
}.Run()
if st := m.Run(); st > exitVal {
exitVal = st
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration-test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ func (f *feature) whenICallNodeGetCapabilities() error {
return nil
}

func FeatureContext(s *godog.Suite) {
func FeatureContext(s *godog.ScenarioContext) {
f := &feature{}
s.Step(`^a CSI service$`, f.aCSIService)
s.Step(`^a basic block volume request name "([^"]*)" arrayId "([^"]*)" protocol "([^"]*)" size "(\d+)"$`, f.aBasicBlockVolumeRequest)
Expand Down

0 comments on commit c3fc959

Please sign in to comment.