Issue with UTF-8 characters in test names

Issue #138 resolved
Lübbe Onken created an issue

Testinsight 1.1.8 running in RAD Studio 10.4 (Patch 3) seems to have an issue with testcases that have UTF-8 characters in their names. The following three tests are always skipped, even though they are selected for execution.

This is the definition of the last test:

[TestCase('... Ungültiger Container ohne EMC', ...)]

Tests are written using DUnitX. Running DUnitX console app locally or on our Jenkins server, no tests are skipped. All test results are recorded and displayed fine on Jenkins.

Comments (13)

  1. Lübbe Onken reporter

    It doesn’t make a difference if I save TestUtf8TestCases as UTF-8 or ANSI. The 'ü' is always garbled. DUnitX Console and XML Output is ok in both cases. The problem only occurred recently (Since 10.4/TestInsight 1.1.8)

  2. Lübbe Onken reporter

    That’s bad 😉

    I can confirm that it works ok with 10.3.3. Just dug up my laptop with the older delphi version and installed TestInsight 1.1.8 on it. You might want to update the installer or point the link in the wiki to the correct installer. It’s still the one from May which has the “division by zero” bug in autodiscovery (#135).

  3. Stefan Glienke repo owner

    To verify that I am on the right track - please put a breakpoint at the end of TTestInsightResult.ToJson in TestInsight.Client.pas and tell me what the testname field contains for the “Grüne Buchstaben” test in your 10.4.

    My guess is that we suffer from RSP-29121 here which might get fixed soon 😉

  4. Lübbe Onken reporter

    Hi Stefan,

    I put a breakpoint on obj.free, so I could see the result.

    The following tests were made:

    1. “clear results” and “run all tests” with F9:
      ResultToJson is entered four times, twice for each test.
      The result for “Grüne Buchstaben” is ok:
      '{"resulttype":"Running","testname":"TTestCaseTest.TestUtf8.Grüne Buchstaben","duration":0,"exceptionmessage":"","unitname":"TestUtf8TestCases","classname":"TTestCaseTest","methodname":"TestUtf8","linenumber":0,"status":""}'
      '{"resulttype":"Passed","testname":"TTestCaseTest.TestUtf8.Grüne Buchstaben","duration":12,"exceptionmessage":"","unitname":"TestUtf8TestCases","classname":"TTestCaseTest","methodname":"TestUtf8","linenumber":0,"status":""}'
      After running the tests, the test is called “Gr?ne Buchstaben” in the explorer. and the test is skipped from now on.
    2. “clear results” and “run discover tests”:
      the test is already called “Gr?ne Buchstaben” in the explorer.
      Select all tests in explorer and run Tests with F9.
      ResultToJson is entered three times, twice for for “Normal” and once for “Grüne Buchstaben”.
      The result for “Grüne Buchstaben” is not ok:
      '{"resulttype":"Skipped","testname":"TTestCaseTest.TestUtf8.Grüne Buchstaben","duration":0,"exceptionmessage":"","unitname":"TestUtf8TestCases","classname":"TTestCaseTest","methodname":"TestUtf8","linenumber":0,"status":""}'

    When I set a breakpoint on: obj := TJSONObject.ParseJSONValue(response) as TJSONObject; in function TTestInsightClientBase.ParseTests(const response: string): TArray<string>;,
    the response contains the wrong value: '{"SelectedTests":["TestUtf8TestCases.TTestCaseTest.TestUtf8.Normal","TestUtf8TestCases.TTestCaseTest.TestUtf8.Gr?ne Buchstaben"]}'

    “Clear results” and a breakpoint in PostResults Post('tests/results', [], content); F9 to run all tests

    content is ok '[{"resulttype":"Running","testname":"TTestCaseTest.TestUtf8.Grüne Buchstaben","duration":0,"exceptionmessage":"","unitname":"TestUtf8TestCases","classname":"TTestCaseTest","methodname":"TestUtf8","linenumber":0,"status":""}]'

    Does that help you?

  5. Stefan Glienke repo owner

    Result is not ok, ü needs (and was before) to be encoded with \uxxxx

    Wait for 10.4.1 where it might be fixed

  6. Log in to comment