Giter Site home page Giter Site logo

Comments (6)

Victor-Chirinian-Vimeo avatar Victor-Chirinian-Vimeo commented on May 30, 2024 1

@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.

afbjorklund avatar afbjorklund commented on May 30, 2024 1

You can do something like sh -c "go-test-report <$GOTESTSUM_JSONFILE" (or just hardcode the file), until it is...

https://github.com/vakenbolt/go-test-report/pull/62/files#diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261R248

The only missing features are the testExecutionDate and the Duration, as mentioned.

from go-test-report.

afbjorklund avatar afbjorklund commented on May 30, 2024

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.

Victor-Chirinian-Vimeo avatar Victor-Chirinian-Vimeo commented on May 30, 2024

@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.

afbjorklund avatar afbjorklund commented on May 30, 2024

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">&boxbox;</span> Total: <strong>18</strong>Duration: <strong>208ms</strong>

from go-test-report.

afbjorklund avatar afbjorklund commented on May 30, 2024

I think we want to the name the file something other than "test_report.json"

from go-test-report.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.