Have integrated AWS Codepipeline with SonarCloud and every time i trigger build through AWS codepipeline for short-lived branches. Noticed it throw Quality Gate failed message in SonarCloud Dashboard for my project.
Can anyone please help me that what causing this issue and how i can passed this message.
I am generating one json file to check the status of quality gate and everytime build is ended up with following output… Is this culprit because of which am not seeing passed message for Quality gate in SonarCloud dasboard?
Also, why am seeing code converge 0.00% everytime ?
I’ve got the feeling that you don’t get the concept of Quality Gate provided by SonarCloud. It is expected to get a FAILED QG each time you run a scan if you do nothing to mitigate the problems found by SonarCloud.
The Quality Gate is there to tell you if you can deliver in PROD your software. If it’s GREEN/PASSED, it means the quality (reliability, maintainability, security, coverage, …) is at the expected level. If it’s RED/FAILED, it means you need to fix problems. These problems are highlighted when you click on the name of the project. Here is an example of what you should get:
Here SonarCloud is telling me that I have some Vulnerabilities to fix on the recently changed code and I should add some tests/coverage to reach 80% of coverage by Unit Tests of the recently changed code (aka New Code).
I believe you should share a screenshot of your project home page so all can see why you have a Failed Quality Gate and you should also share your Quality Gate definition (same as a screenshot).
Note: in your case I believe you have 0% of Code Coverage because you did nothing to provide coverage data to SonarCloud. SonarCloud doesn’t measure the code coverage, it imports coverage data generated by coverage tools. It only detects when no data for a given executable lines was provided.
Can anyone pleas help and let me know that why everytime am seeing 0% for code coverage.
Below is the snippet from logs.
/root/.nuget/packages/coverlet.msbuild/3.1.0/build/coverlet.msbuild.targets(39,5): warning : [coverlet] Unable to instrument module: /codebuild/output/src950/src/s3/00/aspnet-core/modules//test/bin/Release/net5.0/Volo.Abp.TextTemplateManagement.EntityFrameworkCore.dll because : No symbol found for file: /codebuild/output/src950/src/s3/00//aspnet-core/modules//test//bin/Release/net5.0/Volo.Abp.TextTemplateManagement.EntityFrameworkCore.dll [/codebuild/output/src950/src/s3/00//aspnet-core/modules//test/
Test run for /codebuild/output/src950/src/s3/00//modules//test//bin/Release/net5.0/ (.NETCoreApp,Version=v5.0)
Microsoft (R) Test Execution Command Line Tool Version 16.11.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait…
A total of 1 test files matched the specified pattern.
No test is available in /codebuild/output/src950/src/s3/00/aspnet-core/modules/test/bin/Release/net5.0/. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.