Upgrade to SonarQube 8.9.1 broke the ability to detect the tests within a TypeScript file

Version information:

  • SonarQube 8.9.1, sonar-maven-plugin:3.9.0.2155

Description:

A TypeScript test spec file (a *Spec.ts file listed within an execution report) previously had its test cases accurately reported in SonarQube version 8.3.1.

With a recent upgrade to 8.9.1, the test cases within the file are no longer reported.

When running mvn sonar:sonar I get the following when processing the Test Execution report:

[INFO] Parsing /builds/report.xml
[INFO] Imported test execution data for 96 files
[INFO] Test execution data ignored for 1 unknown files, including:
./ui/test/spec/myTestsSpec.ts

This problem with myTestsSpec.ts did not occur with SonarQube 8.3.1.

The file is quite large containing big samples of Json-formatted code.
e.g. the following function is present that it called from several of the test cases within the spec file:

  function getJsonMessages(){
    return JSON.stringify({"response":{"status":200,"message":"OK","totalSize":1,"links":[{"rel":"self","href":"/rtt-search/tickets/NCC_2013111536/messages?&searchString="},{"rel":"tickets","href":"/rtt-search/tickets?&searchString="}], 
 ...  and so on ...

Note: the code within the stringify call above is more than 1 million characters on a single line in the typescript file.

Workaround

I moved the function call above into a separate helper typescript file named jsonResources.ts.
I now call the following import within myTestsSpec.ts:

import { getJsonMessages } from "./jsonResources"

Following this, the test cases within the file myTestsSpec.ts are now properly included in the report.

Can someone suggest a memory setting that needs to made somewhere?
Is it possible that something changed on the SonarQube side that caused the analysis above to break?

Hello Daniel,

Thank you for your message, and welcome back!

It seems that the scanner failed to find your myTestsSpec.ts file when importing test execution data from your report. Would you mind sharing with us the full logs of the scanner with the debug details? There may be some clues there as why that file was not processed.

Ideally, you might want to provide us a test execution report as well as a source file which together reproduce the problem you are encountering so that we can better investigate why this is not working.

Regards,
Yassin