Skip to content

Broken output when non-json lines occur #25

@Davincible

Description

@Davincible

The go test -json package has a tendency to include non-json output in some cases. For example when one (distant) sub-package doesn't compile. As a result of this, if I have one not-compiling file in my whole project, non of my tests will report as passing, even though they pass, and the log output will not be parsed.

The problematic code is here;

local ok, parsed = pcall(vim.json.decode, line, { luanil = { object = true } })
if not ok then
log = vim.tbl_map(function(l)
return highlight_output(l)
end, lines)
return tests, log
end

It happens because it now returns prematurely when one line has no valid json. We can either ignore the line here, or try to include it as is.

How do you want to handle this scenario? I can implement a fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions