Skip to main content
added 137 characters in body
Source Link
Mohit K
  • 768
  • 1
  • 9
  • 28

If someone asks, there are n Apex classes with varying code coverage, some less than 75 & some greater than. And m Triggers having less than 75 coverage.

What will happen while deployment?

So the answer would be -

(For Apex) all lines covered / all lines present = must be greater than 75%

(For Trigger) Example - Just needIf while deploying to have 1% coverageProd, if there 3 classes :

  1. 80% ( Lines covered 80 / 100)
  2. 90% (Lined covered 900 / 1000)
  3. 0% (Lines covered 0 / 150)

Or Triggers lines too haveSo here on calculation it is : 980 / 1250 = 78.4% So this will get deployed to be added in Apex calculations?PROD correct ??

I just want to confirm is thing understanding of mine is correct for tackling such scenarios.

If someone asks, there are n Apex classes with varying code coverage, some less than 75 & some greater than. And m Triggers having less than 75 coverage.

What will happen while deployment?

So answer would be -

(For Apex) all lines covered / all lines present = must be greater than 75%

(For Trigger) Just need to have 1% coverage

Or Triggers lines too have to be added in Apex calculations???

I just want to confirm is thing understanding of mine is correct for tackling such scenarios.

If someone asks, there are n Apex classes with varying code coverage, some less than 75 & some greater than.

What will happen while deployment?

So the answer would be -

(For Apex) all lines covered / all lines present = must be greater than 75%

Example - If while deploying to Prod, if there 3 classes :

  1. 80% ( Lines covered 80 / 100)
  2. 90% (Lined covered 900 / 1000)
  3. 0% (Lines covered 0 / 150)

So here on calculation it is : 980 / 1250 = 78.4% So this will get deployed to PROD correct ??

I just want to confirm is thing understanding of mine is correct for tackling such scenarios.

Source Link
Mohit K
  • 768
  • 1
  • 9
  • 28

Is this correct way of tackling Code Coverage scenarios?

If someone asks, there are n Apex classes with varying code coverage, some less than 75 & some greater than. And m Triggers having less than 75 coverage.

What will happen while deployment?

So answer would be -

(For Apex) all lines covered / all lines present = must be greater than 75%

(For Trigger) Just need to have 1% coverage

Or Triggers lines too have to be added in Apex calculations???

I just want to confirm is thing understanding of mine is correct for tackling such scenarios.