Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/godog/internal/cmd_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ The test runner can be executed with the same flags as when using godog run.`,
Run: buildCmdRunFunc,
}

buildCmd.Flags().StringVarP(&buildOutput, "output", "o", buildOutputDefault, "compiles the test runner to the named file")
buildCmd.Flags().StringVarP(&buildOutput, "output", "o", buildOutputDefault, `compiles the test runner to the named file
`)

return buildCmd
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/godog/internal/cmd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ buildable go source.`,
godog run <feature> <feature>

Optional feature(s) to run:
- dir (features/)
- feature (*.feature)
- scenario at specific line (*.feature:10)
dir (features/)
feature (*.feature)
scenario at specific line (*.feature:10)
If no feature arguments are supplied, godog will use "features/" by default.`,
Run: runCmdRunFunc,
}
Expand Down
35 changes: 21 additions & 14 deletions internal/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,33 @@ func BindRunCmdFlags(prefix string, flagSet *pflag.FlagSet, opts *Options) {
flagSet.BoolVar(&opts.NoColors, prefix+"no-colors", opts.NoColors, "disable ansi colors")
flagSet.IntVarP(&opts.Concurrency, prefix+"concurrency", "c", opts.Concurrency, "run the test suite with concurrency")
flagSet.StringVarP(&opts.Tags, prefix+"tags", "t", opts.Tags, `filter scenarios by tags, expression can be:
- "@wip": run all scenarios with wip tag
- "~@wip": exclude all scenarios with wip tag
- "@wip && ~@new": run wip scenarios, but exclude new
- "@wip,@undone": run wip or undone scenarios`)
flagSet.StringVarP(&opts.Format, prefix+"format", "f", opts.Format, `writes the formatted output to stdout
built-in formatters:
- progress: prints a character per step
- cucumber: produces cucumber JSON format output
- events: produces JSON event stream, based on spec: 0.1.0
- junit: prints junit compatible xml to stdout
- pretty: prints every feature with runtime statuses
`)
"@wip" run all scenarios with wip tag
"~@wip" exclude all scenarios with wip tag
"@wip && ~@new" run wip scenarios, but exclude new
"@wip,@undone" run wip or undone scenarios`)
flagSet.StringVarP(&opts.Format, prefix+"format", "f", opts.Format, `will write a report according to the selected formatter

usage:
-f <formatter>
will use the formatter and write the report on stdout
-f <formatter>:<file_path>
will use the formatter and write the report to the file path

built-in formatters are:
progress prints a character per step
cucumber produces a Cucumber JSON report
events produces JSON event stream, based on spec: 0.1.0
junit produces JUnit compatible XML report
pretty prints every feature with runtime statuses
`)

flagSet.BoolVarP(&opts.ShowStepDefinitions, prefix+"definitions", "d", opts.ShowStepDefinitions, "print all available step definitions")
flagSet.BoolVar(&opts.StopOnFailure, prefix+"stop-on-failure", opts.StopOnFailure, "stop processing on first failed scenario")
flagSet.BoolVar(&opts.Strict, prefix+"strict", opts.Strict, "fail suite when there are pending or undefined steps")

flagSet.Int64Var(&opts.Randomize, prefix+"random", opts.Randomize, `randomly shuffle the scenario execution order
--random
--random
specify SEED to reproduce the shuffling from a previous run
--random=5738`)
--random=5738`)
flagSet.Lookup(prefix + "random").NoOptDefVal = "-1"
}