-
Notifications
You must be signed in to change notification settings - Fork 34
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
Advocate gotestsum for running go test #61
Comments
When
|
@afbjorklund I saw the following PR :#62, that will allow users to specify the path to the test2json file produced by gotestsum, which is great! Currently I am running the invocation you shared above, which is dependent on the env vars being set, but I am still getting:
GOTESTSUM_JSONFILE I am manually setting before execution GOTESTSUM_ELAPSED is set by gotestsum itself. |
You should not have to set GOTESTSUM_JSONFILE, it should be exported by $ gotestsum --jsonfile test_report.json --post-run-command env | grep GOTESTSUM
GOTESTSUM_JSONFILE=test_report.json
GOTESTSUM_JSONFILE_TIMING_EVENTS=
GOTESTSUM_JUNITFILE=
GOTESTSUM_ELAPSED=0.208s Then what I did is to add two new parameters to $ go-test-report -i test_report.json -e 0.208s
[go-test-report] finished in 81.253371ms
$ grep Duration: test_report.html
<span class="total"><span class="indicator">⧉</span> Total: <strong>18</strong>Duration: <strong>208ms</strong> |
@afbjorklund That is true, it is one or the other. I currently don't see any references to the GOTESTSUM_JSONFILE env var in master, which is likely why I am getting the stdin pipe error, unless I missed it while reviewing the code. Is that dependent on #62 getting merged ? |
You can do something like The only missing features are the testExecutionDate and the Duration, as mentioned. |
I think we want to the name the file something other than "test_report.json" |
Since it allows both progress and json, at the same time (not either / or).
It also has a default format that is more friendly on the eyes than
go test
.$ gotestsum --jsonfile test_report.json
https://github.com/gotestyourself/gotestsum
Main issue is recording the current date and execution time "somewhere"...
Duration
(should be the test execution time, not the report execution time)testExecutionDate
(should be the test executation date, not the current date)The text was updated successfully, but these errors were encountered: