function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bailey RuddBailey Rudd 

Change Set Test Execution fails because of an unmanaged package that a previous developer installed. Help?

A previous developer installed an unmanaged package from the AppExchange called Custom Quote Sync (Unmanaged).
It is keeping any change sets we try and deploy to Production from being successful because the test triggers are at 0% and total code coverage is only at 64%.

I am completely unfamiliar with test classes and could really use some assistance. I can provide further details if needed.

Thank you in advance,
 

Here are the Errors:
Code Coverage Failure
Your organization's code coverage is 64%. You need at least 75% coverage to complete this deployment. Also, the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage.QuoteSyncTrigger
QuoteLineSyncTrigger

Component Errors

 

API Name
Type
Line
Column
Error Message
0 0 QuoteSyncTestSuite.testCreateDuplicateOppLine(); QuoteSyncTestSuite.testCreateDuplicateQuoteLine(); QuoteSyncTestSuite.testCreateQuote(); QuoteSyncTestSuite.testCreateQuoteWithQuoteLine(); QuoteSyncTestSuite.testInsertOppLineNoSync(); QuoteSyncTestSuite.testInsertOppLineNotSync(); QuoteSyncTestSuite.testInsertOppLineSync(); QuoteSyncTestSuite.testInsertQuoteLineNoSync(); QuoteSyncTestSuite.testInsertQuoteLineNotSync(); QuoteSyncTestSuite.testInsertQuoteLineSync(); QuoteSyncTestSuite.testStartSyncInsertOppLine(); QuoteSyncTestSuite.testStartSyncInsertOppLineSetNull(); QuoteSyncTestSuite.testStartSyncMatchOppLine_1(); QuoteSyncTestSuite.testStartSyncMatchOppLine_1a(); QuoteSyncTestSuite.testStartSyncMatchOppLine_2(); QuoteSyncTestSuite.testSt
0 0 QuoteLineSyncTrigger, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required
0 0 QuoteSyncTrigger, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required
0 0 , Details: Average test coverage across all Apex Classes and Triggers is 64%, at least 75% test coverage is required.
RajaMohanRajaMohan
Hi Bailey,

In order to deploy the new components to production, you have to improve the test coverage in sandbox and deploy the required classes. Also, all the triggers should be covered. Always salesforce advices all the Triggers and Classes to have 75% for deployment.

The following lines are from Apex Developer Guide,

At least 75% of your Apex code must be covered by unit tests, and all of those tests must complete successfully. Note the following:
  • When deploying to a production organization, every unit test in your organization namespace is executed.
  • Calls to System.debug are not counted as part of Apex code coverage.
  • Test methods and test classes are not counted as part of Apex code coverage.
  • While only 75% of your Apex code must be covered by tests, your focus shouldn't be on the percentage of code that is covered. Instead, you should make sure that every use case of your application is covered, including positive and negative cases, as well as bulk and single records. This should lead to 75% or more of your code being covered by unit tests.
  • Every trigger must have some test coverage.
  • All classes and triggers must compile successfully.

Please look into the following link for more information,

https://developer.salesforce.com/page/An_Introduction_to_Apex_Code_Test_Methods


Thanks,
Raja
Bailey RuddBailey Rudd
Hi Raja, 

Thanks for the information. 
The Managed Package does already have use cases for the application. Although I believe this is what is causing it to fail. 
I do not know how to write uses cases, or test bulk or single records. This is what I am asking for assistance with.
I can provide the class and triggers if someone can help me understand the code and why it is failing. 
 
RajaMohanRajaMohan
Hi Bailey,

As you said this is unmanaged package and used inside the application, we have to look into the usecase to write the code. There might be chances to write coverage for more classes. It is not possible somone in developer community to write the whole code. Please ask your manager to hire a developer for a week to complete the work. 

Thanks,
Raja
Bailey RuddBailey Rudd
Hi Raja,

Unfortunately, we do not have the budget to hire another developer at this time. So I suppose I will just have re-create every new change in production manually.