There is project which contains only functional test cases folders and files which contain .ts files and code written in Javascript. We are trying to analyze the those test cases using Azure Devops pipeline and want to see the analysis report on Sonarqube 9.9.7. But we are not able to see any kind of bugs , line of code, code smells after successful analysis of the project. Sonarqube dashboard showing 0 lines of code for every file. Can we analyze the functional test cases on Sonarqube 9.9.7?
You’re definitely not alone in facing this issue—SonarQube, by default, tends to ignore test files when analysing a project, which is likely why your functional test cases aren’t appearing on the dashboard. Since you’re using Azure DevOps, you might need to adjust your sonar.sources and sonar.tests properties in the analysis configuration to ensure test files are included. Also, check if exclusions are set in sonar.exclusions that might be filtering out .ts files. Another factor could be SonarQube’s exclusions for test files, which you can check under Administration > Analysis Scope. If you’re working with front-end development in Angular and need structured, optimised code that aligns with best practices, angular development services can help ensure SEO-friendly development. Hope this helps!
Hi @beredis ,
we do not have any source folder to mention in the sonar.sources property. I have mentioned the test folder which includes only test files which is having .ts extension in sonar.tests property, still it is in not showing any metrices over the SonarQube like lines of code, bugs etc. even after the successful execution of the pipeline.
Can we see the metrices related to only test project in Sonarqube?
Hi @ganncamp , Can you please help over this issue?
Hey @Asawari
Please don’t tag individuals not already involved in a thread
I suggest you share your complete analysis configuration, as well as logs from the analysis (the output of the SonarQubeAnalyze
task to understand why your files are being indexed as test files and what can be done to prevent that.