karma-runner / karma-teamcity-reporter

A Karma plugin. Report results for Teamcity CI.
MIT License
34 stars 47 forks source link

Test suits encoding problems #32

Closed scalder27 closed 8 years ago

scalder27 commented 9 years ago

Hello, I`ve encountered a teamcity reporter output issue with russian symbols in the test suits. This issue can be reproduced by adding next test (karma-teamcity-reporter\examples\simple\index.spec.js):

it('это тоже должно работать', function () {
    1 + 1 === 2
})

And there is a screenshot from the teamcity: image

thojo commented 8 years ago

+1

I have the same problem with german umlauts. When not using the teamcity reporter umlauts are correctly displayed in build logs.

dizel3d commented 8 years ago

The bug is produced by fix d8d9e70630031de66036d81b396561fb6de20f70 (issue #5): Windows OS console use ANSI and fs.writeSync cannot print language-specific symbols correctly.

Issue #5 occurred because process.stdout.write was non-blocking in node up to v0.11.11. But since node v0.11.12 (2014.03.11) it is blocking. See nodejs v0.11.12 (2014.03.11) changelog: windows: make stdout/sterr pipes blocking (Alexis Campailla). I checked this, and you can check this too.

Also AppVeyor notifies about issue #5 in old Node.js versions: Garbled or missing output.

I think we can revert d8d9e70630031de66036d81b396561fb6de20f70 to fix the bug and reopen issue #5 with "it is known issue with nodejs < v0.11.12 on Windows ...".

dizel3d commented 8 years ago

I am sorry, I was wrong in previous comment. It does not fix the bug, it just fixes encoding in console. I thought that TeamCity emulates TTY.

dizel3d commented 8 years ago

Ok, guys, take the solution! You should add configuration parameter teamcity.runner.commandline.stdstreams.encoding with value UTF8. image Thanks to the topics: http://stackoverflow.com/questions/9213241/teamcity-build-log/29716411#29716411 https://youtrack.jetbrains.com/issue/TW-4177#comment=27-1038539

scalder27 commented 8 years ago

@dizel3d, it's unbelievable! You did an amazing investigation! Thank you very much!