Skip to content

Commit

Permalink
Document new junit format flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dnephin committed Oct 13, 2019
1 parent 63d81f1 commit 1bfd481
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ This file can be used to integrate with CI systems.
gotestsum --junitfile unit-tests.xml
```

If the package names in the `testsuite.name` or `testcase.classname` fields do not
work with your CI system these values can be customized using the
`--junitfile-testsuite-name`, or `--junitfile-testcase-classname` flags. These flags
accept the following values:

* `short` - the base name of the package (the single term specified by the
package statement).
* `relative` - a package path relative to the root of the repository
* `full` - the full package path (default)


### JSON file output

When the `--jsonfile` flag or `GOTESTSUM_JSONFILE` environment variable are set
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ Formats:
flags.BoolVar(&opts.noColor, "no-color", false, "disable color output")
flags.Var(opts.noSummary, "no-summary",
"do not print summary of: "+testjson.SummarizeAll.String())
flags.Var(opts.junitTestSuiteNameFormat, "junitfile-testsuite-name-format",
flags.Var(opts.junitTestSuiteNameFormat, "junitfile-testsuite-name",
"format the testsuite name field as: "+junitFieldFormatValues)
flags.Var(opts.junitTestCaseClassnameFormat, "junitfile-testcase-classname-format",
flags.Var(opts.junitTestCaseClassnameFormat, "junitfile-testcase-classname",
"format the testcase classname field as: "+junitFieldFormatValues)
flags.BoolVar(&opts.version, "version", false, "show version and exit")
return flags, opts
Expand Down

0 comments on commit 1bfd481

Please sign in to comment.