prashant-ramcharan / courgette-jvm

Multiprocess | Parallel Cucumber-JVM | Parallelize your Java Cucumber tests on a feature level or on a scenario level.
MIT License
131 stars 38 forks source link

Incorrect JSON Output (decimal and scientific) #2

Closed jk563 closed 7 years ago

jk563 commented 7 years ago

I'm seeing line values with decimal points and durations with decimal points and scientific notation when using this runner. This contrasts with the numbers in the example documentation (https://relishapp.com/cucumber/cucumber/docs/formatters/json-output-formatter).

For example, I believe that this:

       "line": 11.0,
       ......
          {
            "result": {
              "duration": 1.0702718E7,
              "status": "passed"
            },
           .......
          }
        ],

Should look like this:

       "line": 11,
       ......
          {
            "result": {
              "duration": 10702718,
              "status": "passed"
            },
           .......
          }
        ],
prashant-ramcharan commented 7 years ago

@jk563 good spot.

Will provide a fix.

jk563 commented 7 years ago

It's to do with GSON, the line that incorrectly maps it is https://github.com/prashant-ramcharan/courgette-jvm/blob/master/src/main/java/courgette/runtime/CourgetteRunner.java#L165

final Object jsonObject = new Gson().fromJson(json, Object.class);
prashant-ramcharan commented 7 years ago

Thanks - this is now fixed in version 1.3.1.

jk563 commented 7 years ago

Cheers for the rapid fix, working as expected now!