Skip to content

build tags? #154

Open
Open

Description

@johnknl

I separate different kinds of tests using build tags, eg:

// +build functional

package main

import (
	"fmt"
	"github.com/DATA-DOG/godog"
)
...
func FeatureContext(s *godog.Suite) {
	s.Step(`^there are (\d+) godogs$`, thereAreGodogs)
	s.Step(`^I eat (\d+)$`, iEat)
	s.Step(`^there should be (\d+) remaining$`, thereShouldBeRemaining)

	s.BeforeScenario(func(interface{}) {
		Godogs = 0 // clean the state before every scenario
	})
}
...

when I run godog without args, it cannot find the context initializer. Is there any way to make this work with godog?

Activity

  1. l3pp4rd commented on Jan 16, 2019

    @l3pp4rd
    Contributor

    Hi, yes at the moment godog command line tool does not accept build tags. For now you can run it in TestMain function using go test -tags tag.

    I'll need to think about such an option for godog command for relaying build tags or in general build arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址