Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

godog returns wrong options(tags) values #492

Open
waytocypress opened this issue Aug 9, 2022 · 2 comments
Open

godog returns wrong options(tags) values #492

waytocypress opened this issue Aug 9, 2022 · 2 comments

Comments

@waytocypress
Copy link

👓 What did you see?

When I want to read tag value at runtime using opts.tags the code returns values as "imeout" from last parameter -timeout
when I remove -timout parameter(go test provides this parameter) tag values are returning correctly.

✅ What did you expect to see?

The values should be returned as @abc && ~@pqr && ~@uvw && ~@xyz"

📦 Which tool/library version are you using?

godog v0.12.5
go version 1.17.3

🔬 How could we reproduce it?

Steps to reproduce the behavior:

  1. Install versions given above
  2. Create a file called multiple feature files with a single common tag and tags specifying the scenarios e.g.(say @regression and @Addition, @regression and @subtraction)
  3. Run command go test --godog.tags="@abc,@bcd && ~xyz" -v -timeout 60m
  4. see the value of tags printed

📚 Any additional context?

image


@waytocypress waytocypress changed the title godog returns wrong options values godog returns wrong options(tags) values Aug 9, 2022
@vearutop
Copy link
Member

Could you share more details about your test setup (code that configures and runs test suite)?

Please also check this discussion for an example of instrumentation: #495 (comment).

@waytocypress
Copy link
Author

I checked #495 (comment).
But mine is not related to that. My scripts are getting executed but not filtered based on tags I am passing.
Got go tests the filters are identified on -t or -tag, in my command line the arguments I am passing for -timeout. So go test consider imeout as tag value.
This is how init function is written
func init() {
opts := godog.Options{
Format: formatToCompare,
Output: bytes.NewBuffer(nil),
Paths: []string{},
}
godog.BindCommandLineFlags("tests.", &opts)
flag.Parse()
testReporter = createReport(&opts)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants