Skip to content

Test cases are not listing in Code Build report group

0

I have added a report group associated with my CodeBuild, but I am only able to see the pie chart related to the results and unable to see the test cases listed below.

I have added all the below permissions to codebuild:

  • "codebuild:CreateReportGroup",
  • "codebuild:CreateReport",
  • "codebuild:UpdateReport",
  • "codebuild:BatchPutTestCases",
  • "codebuild:BatchPutCodeCoverages"
  • "codebuild:DescribeTestCases"
  • codebuild:BatchGetReportGroups
  • codebuild:BatchGetReports

Enter image description here

asked 2 years ago243 views

2 Answers
0

The issue you're experiencing with not seeing the test cases listed in your CodeBuild report group could be related to a few factors:

  1. Test report file format: Ensure that your test reports are in one of the supported formats. AWS CodeBuild supports specific test report file formats, including Cucumber JSON, JUnit XML, NUnit XML, NUnit3 XML, TestNG XML, Visual Studio TRX, and Visual Studio TRX XML. If your test framework is not generating reports in one of these formats, the individual test cases may not be visible.

  2. Buildspec configuration: Check your buildspec file to make sure it's correctly configured to run the test cases and generate the reports. The buildspec should include the necessary commands to execute the tests and specify the location of the test result files.

  3. Report group configuration: Verify that your report group is properly set up in the buildspec file. You need to specify the report group name and provide information about your test cases in the buildspec.

  4. Test case execution: Ensure that your test cases are actually running during the build process. If the tests aren't executed, there won't be any individual test case results to display.

  5. Permissions: While you've added several relevant permissions, make sure the CodeBuild service role has all necessary permissions to create and update reports, as well as to put test cases into the reports.

  6. Console view: In the AWS CodeBuild console, when viewing a test report, make sure you're on the correct tab or section that displays individual test cases. Sometimes, you may need to navigate to a specific part of the report to see the detailed test case list.

If you've verified all these points and are still unable to see the individual test cases, you may want to review the CodeBuild logs for any error messages or unexpected behavior during the test execution and reporting phase. Additionally, consider exporting the raw test result files to an Amazon S3 bucket for further investigation if the issue persists.
Sources
Test reports in AWS CodeBuild - AWS CodeBuild
Report groups - AWS CodeBuild
Create a report group - AWS CodeBuild

answered 2 years ago

AWS
SUPPORT ENGINEER

reviewed 2 years ago

0

Hello,

I see that your query has already been answered. Were you able to confirm all the points listed in the above answer. If yes, and still facing the issue, I would recommend you to please reach out to AWS Support with your project/build details for further investigation.

Below is the sample permission for allowing a user to get a list of test cases for a report in the us-east-2 Region for account 123456789012:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "codebuild:DescribeTestCases",
      "Resource": "arn:aws:codebuild:us-east-2:123456789012:report-group/*"
    }
  ]
}

[] Using identity-based policies for AWS CodeBuild - Allow a user to get a list of test cases for a report - https://docs.aws.amazon.com/codebuild/latest/userguide/auth-and-access-control-iam-identity-based-access-control.html#customer-managed-policies-example-get-list-of-test-cases-for-report

Thank you.

AWS
SUPPORT ENGINEER

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.