Comments (6)
@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 ?
from go-test-report.
You can do something like sh -c "go-test-report <$GOTESTSUM_JSONFILE"
(or just hardcode the file), until it is...
The only missing features are the testExecutionDate and the Duration, as mentioned.
from go-test-report.
When GOTESTSUM_ELAPSED
and GOTESTSUM_JSONFILE
are picked up automatically, the invocation becomes just:
gotestsum --jsonfile test_report.json --post-run-command "go-test-report --output test_report.html"
from go-test-report.
@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:
Error: ERROR: missing ≪ stdin ≫ pipe
.
GOTESTSUM_JSONFILE I am manually setting before execution GOTESTSUM_ELAPSED is set by gotestsum itself.
from go-test-report.
You should not have to set GOTESTSUM_JSONFILE, it should be exported by gotestsum
when you use the --jsonfile
parameter. There was a small change needed to the GOTESTSUM_ELAPSED variable, to add the "s" (for seconds)
$ 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
, and have them default to these environment variables. You can also specify them explicitly, like go-test-report -i test_report.json -e 0.208s
, if not using post-run
$ 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>
from go-test-report.
I think we want to the name the file something other than "test_report.json"
from go-test-report.
Related Issues (20)
- Search and jump directly to a particular test
- Allow duplicated test names in different packages HOT 1
- Need (optional) parameter for test duration
- Possibility to add links to additional pages
- Speeding up execution time for large go projects HOT 1
- Better support for sub-tests and table-driven tests
- Kudos! I've integrated this project in my release-action
- Allow navigation of groups with keyboard arrow keys
- It did not catch an error:panic: fatal error config file: open /xxx/xxx/etc/configs/xxx.yaml: no such file or directory
- Suggestion: Export to Markdown HOT 9
- Suggestion: Report with coverage HOT 1
- Bug: Exit status 1 when generating Test Report for Subpackages
- Group tests by area in report HOT 3
- It would be nice if sort by tests is made as optional before generating the html report HOT 1
- Can't install the command on mac HOT 3
- Support for HTML report based on Ginkgo Test JSON output HOT 4
- Update go version and make release HOT 1
- Add support for testdox display names HOT 1
- Move project to add new features HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-test-report.