Darkyenus / wemi

Nimble build system, with batteries included and replaceable
Mozilla Public License 2.0
18 stars 2 forks source link

Cannot run tests with machine readable output #34

Closed JakubVanek closed 3 years ago

JakubVanek commented 3 years ago

Hi,

it seems I have hit a bug in Wemi when testing is combined with machine readable output.

Reproducer project: https://github.com/JakubVanek/wemi-bug

Test OK:

kuba@oggy-kuba:~/tmp/wemi-bug$ ./wemi --machine-readable-output=false HelloWorld/test
Project: HelloWorld
Done test: 
═ JUnit Jupiter ✔ 76 ms
  ╘ HelloWorldTest ✔ 48 ms
    ╘ answerCorrect() ✔ 34 ms

           - Summary -           
[      2 containers found       ]
[      0 containers skipped     ]
[      0 containers aborted     ]
[      2 containers successful  ]
[      0 containers failed      ]
[      1 test found             ]
[      0 tests skipped          ]
[      0 tests aborted          ]
[      1 test successful        ]
[      0 tests failed           ]
    in 1 second 368 ms

Test KO:

kuba@oggy-kuba:~/tmp/wemi-bug$ ./wemi --machine-readable-output=true HelloWorld/test
[14:45:59 INFO ] MachineReadableOutput: > HelloWorld/test
[14:46:00 ERROR] MachineReadableOutput: Can't evaluate HelloWorld/test - fatal exception
com.esotericsoftware.jsonbeans.JsonException: Type class wemi.test.TestIdentifier has no serializer
    at wemi.util.JsonKt.writeValue(Json.kt:461)
    at wemi.util.JsonKt.writeMap(Json.kt:501)
    at wemi.util.JsonKt.writeValue(Json.kt:457)
    at wemi.boot.MachineReadableOutputKt.machineReadablePrint(MachineReadableOutput.kt:206)
    at wemi.boot.MachineReadableOutputKt.machineReadableEvaluateAndPrint(MachineReadableOutput.kt:93)
    at wemi.boot.Launch.main(Launch.kt:405)

The same bug occurs when using shell and json arguments.

Could you please take a look at this?

With regards,

Jakub

Darkyenus commented 3 years ago

Thanks for the report, it has been fixed and will be included in the next release. Note that only json format is supported for these objects, as it is too complex to be meaningfully processed by shell languages.

For the time being before next release, you can use 0.16-SNAPSHOT version, launcher is available here.