rage / tmc-langs-rust

A library and CLI for supporting different programming languages in the TestMyCode programming assignment evaluator.
https://tmc.mooc.fi/
Apache License 2.0
8 stars 9 forks source link

Serializing fails with non-struct output data #84

Closed jolampi closed 3 years ago

jolampi commented 3 years ago

Issue with version: 0.9.0

This occurs with all commands that serialize to a primitive or an array.

For example:

$ ./tmc-langs-cli-x86_64-unknown-linux-gnu-0.9.0 disk-space --path ~/.
{
  "output-kind": "output-data",
  "status": "finished",
  "message": "Failed to convert OutputData(OutputData { status: Finished, message: \"calculated free disk space for partition containing /home/anon/.\", result: ExecutedCommand, data: Some(FreeDiskSpace(431909)) }) to JSON",
  "result": "error",
  "data": {
    "output-data-kind": "error",
    "kind": "generic",
    "trace": [
      "Caused by: Failed to convert OutputData(OutputData { status: Finished, message: \"calculated free disk space for partition containing /home/anon/.\", result: ExecutedCommand, data: Some(FreeDiskSpace(431909)) }) to JSON",
      "Caused by: cannot serialize tagged newtype variant Data::FreeDiskSpace containing an integer"
    ]
  }
}