Skip to content

ThreadlessXunitTestRunner: Escape newlines in test result lines#817

Merged
radical merged 1 commit intodotnet:mainfrom
radical:fix-msg-parsing
Feb 7, 2022
Merged

ThreadlessXunitTestRunner: Escape newlines in test result lines#817
radical merged 1 commit intodotnet:mainfrom
radical:fix-msg-parsing

Conversation

@radical
Copy link
Copy Markdown
Member

@radical radical commented Feb 7, 2022

ThreadlessXunitTestRunner writes lines like:

`[PASS] foo.testname(testargs)`

to the console, which gets parsed by WasmTestMessageProcessor. But if
the list of arguments contains a new line(eg. in data for
System.Text.RegularExpressions tests), then the output line gets written
as multiple lines to the console. And that results in the output looking
like:

[02:41:04] info: abc, beginning: 0, length: 5, expectedSuccess: True, expectedValue: "a\nabc")
[02:41:04] info: abc, beginning: 0, length: 5, expectedSuccess: True, expectedValue: "a\nabc")
...

Each of those lines being the last part of the [PASS] foo.testname(someargs, "\nabc, ..").

Instead, we escape the new line chars.

Partially fixes #816

`ThreadlessXunitTestRunner` writes lines like:

    `[PASS] foo.testname(testargs)`

to the console, which gets parsed by `WasmTestMessageProcessor`. But if
the list of arguments contains a new line(eg. in data for
`System.Text.RegularExpressions` tests), then the output line gets written
as multiple lines to the console. And that results in the output looking
like:

```
[02:41:04] info: abc, beginning: 0, length: 5, expectedSuccess: True, expectedValue: "a\nabc")
[02:41:04] info: abc, beginning: 0, length: 5, expectedSuccess: True, expectedValue: "a\nabc")
...
```

Each of those lines being the last part of the `[PASS] foo.testname(someargs, "\nabc, ..")`.

Instead, we escape the new line chars.

Partially fixes dotnet#816
@radical radical merged commit eb3fecb into dotnet:main Feb 7, 2022
@radical radical deleted the fix-msg-parsing branch February 7, 2022 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[wasm] Incorrect parsing of xunit output

2 participants