User Stories - Apex Test Results

Updated 7 months ago by Iván Minaya

The User Story selections shows a read-only grid of your selected metadata for that User Story. This can be modified by committing files to the user story, or pressing the “Add Metadata” button for org to org deployments.

  • When Apex code is added to a User Story the checkbox “Has Apex Code” will be automatically checked.
  • If Apex code is added to a User Story, the “Run Apex Tests” button can be pressed. This will run the Apex Tests for that User Story and will calculate the Apex code coverage for that User Story. You can set the "Minimum Apex Code Coverage" for the user story. If the value is lower than the value set in the Environment of the user story, the Environment's value will be applied automatically.
  • The updated User Story coverage will be shown when the page layout is refreshed.
  • As of Copado v9, three new Apex Test fields will be available to provide more information about the results:
    • Number of failing methods.
    • Number of classes without the minimum coverage required.
    • Number of triggers without the minimum coverage require.

With these Apex Test fields better quality gates can be set in order to prevent failing Promotions and they will help you create validations on these fields so that you can increase the success rate of your User Story Promotions. You will need to follow these steps to activate the fields:

  • Calibrate FLS for the following fields:
    • User_Story__c.Failing_Methods__c
    • User_Story__c.Triggers_Without_Coverage__c
    • User_Story__c.Classes_Without_Coverage__c

(we have updated the Copado Managed Permission Sets for this fields)

  • Include this field in the following layout:
    • User_Story__c-User Story Layout

When updating from Copado 8.8 & under you will need to follow the upgrade instructions in our release notes.

Adding test-only classes

As of v11, adding test only classes to your User Story is possible. Thanks to a new button labeled "Add Test Classes", a new popup page will be open to allow users select apex classes through a grid containing only test classes. Those classes will have the "Test Only" column checked and will help you improve your User Story's apex code coverage.

How did we do?