- edited description
Issue with UTF-8 characters in test names
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)
-
reporter -
reporter - edited description
-
repo owner Cannot repro - please post a defect project
-
reporter - attached TestInsight.zip
The attached project produces the following output. The second test is not run. Using GitHub DUnitX 032d46bc (25.6.2020)
-
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)
-
repo owner Let’s say that seems to be an issue in 10.4 because I cannot repro
-
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). -
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
-
reporter Hi Stefan,
I put a breakpoint on obj.free, so I could see the result.
The following tests were made:
- “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. - “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;
infunction 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 testscontent 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?
- “clear results” and “run all tests” with F9:
-
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
-
reporter Where the emphasis is on “might” .
Thanks for your analysis
-
repo owner I’d have to “blitzdings” you if I told you more
-
reporter - changed status to resolved
This has indeed been fixed in RAD Studio 10.4.1.
Thank you!
- Log in to comment