Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

sfp orchestrator:validate with Code Coverage Validation  #1359

@Schuchie

Description

@Schuchie

Describe the bug
If the tests are not run completely in parallel mode and then retested in a retry run and run successfully, sfp ignores the Second Coverage Report. This leads to an error in the validation process.

To Reproduce

  1. Not sure how a class could not run in parallel mode, but somehow it occurs in standard controllers
  2. run the sfp orchestrator:validate command
  3. Two Junit Report files are generated.
  4. SFP reads only one and throws an error, that the needed code coverage is not reached.

Expected behavior
SFP reads all unit reports and merges the results.

Screenshots
As shown in the attached screenshot, the retried test class is not listed in the Test-Coverage classes.
image

Platform Details (please complete the following information):

  • OS: ghcr.io/dxatscale/sfpowerscripts:latest
  • Version: sfpowerscripts -- The DX@Scale CI/CD Orchestrator -Version:22.6.1 -Release:June 23
  • Salesforce CLI(sfdx cli) Version: Same as in the latest sfpowerscripts container
  • CI Platform: GitHub

Additional context
Log:

-------------------------------------------------------------------------------------------
  Triggering Apex tests for src-core
  -------------------------------------------------------------------------------------------
  Test Mode: parallel
  Successfully updated apex testing setting
  Tests to be executed: VdmcCustomCodesSelectDTOTest,vdmcCustomCodesSelectTest,VdmcEmailAttachmentTest,vdmcLVPremixPDFControllerTest,VdmcPerformancePackageOverviewDTOTest,VdmcPerformancePackageOverviewTest,VdmcRefundConfirmationControllerTest
  Test Status: Completed:5/7 Queued(0) Failed(0)  
  Test Status: Completed:6/7 Queued(0) Failed(0)  
  Test Status: Completed:6/7 Queued(0) Failed(0)  
  Test Status: Completed:6/7 Queued(0) Failed(0)  
  Test Status: Completed:6/7 Queued(0) Failed(0)  
  Test Status: Completed:6/7 Queued(0) Failed(0)  
  Failed Tests while triggered in parallel: VdmcRefundConfirmationControllerTest
  Triggering tests synchronously: VdmcRefundConfirmationControllerTest
  Successfully updated apex testing setting
  Test Status: Completed:0/1 Queued(0) Failed(0)  
  Test Status: Completed:1/1 Queued(0) Failed(0)  
  Junit Report file available at .testresults/test-result-7075t00001Y0z3A-junit.xml
  Junit Report file available at .testresults/test-result-7075t00001Y0yXa_7075t00001Y0z3A-junit.xml
  === Test Results
                                                                                                  
   Test Name                                                   Outcome   Message   Runtime (ms) 
   VdmcCustomCodesSelectDTOTest.testCodeCoverageDTO            Pass                24           
   vdmcCustomCodesSelectTest.testCustomCodesSelectbackend      Pass                270          
   VdmcEmailAttachmentTest.executeTestWithDoc                  Pass                8478         
   VdmcRefundConfirmationControllerTest.setupTestData          Pass                6362         
   VdmcPerformancePackageOverviewDTOTest.testCodeCoverageDTO   Pass                31           
   VdmcPerformancePackageOverviewTest.testPerfPackageBackend   Pass                4475         
   VdmcRefundConfirmationControllerTest.setupTestData          Pass                6362         
                                                                                                  
  Package type is Source. Validating individual class coverage
  Validating individual classes for code coverage greater than 75 percent
  
  
  === Test Coverage
                                                                 
   Class                                      Coverage Percent 
   VdmcCustomCodesSelectRepository            82               
   VdmcPerformancePackageOverviewRepository   100              
   VdmcCustomCodesSelectController            100              
   VdmcCustomCodesSelectBusiness              88               
   VdmcLVPremixPDFBusiness                    100              
   VdmcLVPremixPDFFacade                      100              
   VdmcLVPremixPDFController                  100              
   VdmcPerformancePackageOverviewDTO          100              
   VdmcCustomCodesSelectFacade                100              
   VdmcPerformancePackageOverviewController   100              
   VdmcLVPremixPDFPersistence                 100              
   VdmcPerformancePackageOverviewBusiness     91               
   VdmcCustomCodesSelectDTO                   100              
   VdmcPerformancePackageOverviewFacade       100              
   VdmcEmailAttachmentVisualforcePage         80               
   VdmcEmailAttachmentRepository              80               
   VdmcEmailAttachmentFacade                  100              
   VdmcEmailAttachmentAction                  100              
   VdmcEmailAttachmentBusiness                88               
   VdmcRefundConfirmationBusiness             0                
   VdmcRefundConfirmationController           0                
   VdmcRefundConfirmationFacade               0                
   VdmcRefundConfirmationPersistence          0                
                                                                 
  The following classes do not satisfy the 75% code coverage requirement:
                                                          
   Class                               Coverage Percent 
   VdmcRefundConfirmationBusiness      0                
   VdmcRefundConfirmationController    0                
   VdmcRefundConfirmationFacade        0                
   VdmcRefundConfirmationPersistence   0                
                                                          
  
  
  
  === Test Summary
                                                                            
   Name                Value                                              
   outcome             Passed                                             
   testsRan            7                                                  
   passing             7                                                  
   failing                                                                
   skipped                                                                
   passRate            100%                                               
   failRate            0%                                                 
   testStartTime       Mon Jul 17 2023 1:43:40 PM                         
   testExecutionTime   37656 ms                                           
   testTotalTime       37656 ms                                           
   commandTime         1173 ms                                            
   hostname            https://.scratch.my.salesforce.com/ 
   orgId               00D5t000000CytJEAS                                 
   username            test@example.com                      
   testRunId           7075t00001Y0yXa_7075t00001Y0z3A                    
   userId              0055t000003cPBAAA2                                 
   packageCoverage     90                                                 
                                                                            
  Error: There are classes that do not satisfy the minimum code coverage of 75%

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions