What do you need help with?

Running Apex Test Classes

Follow

Index.png

1.png2.png3.png4.png5.png6.png7.png8.png9.png10.png<11.png12.png

One of the major challenges in deployment is that the test cases take too long to run. This greatly increases the deployment time.

The other challenge is that the test cases are NOT run in the System Integration Sandbox or Stage Sandbox. Hence, a lot of errors are seen for the first time in the production organization. When an error is seen in production, the development team has to rewrite the test cases at the time of deployment.

The third challenge during deployment is that a lot of test cases are run rather than running the optimal set of test cases.

Flosum solves the above challenges:

  • By providing granular controls on the test cases you want to execute
  • Running the test cases with every deployment

 

There are 4 test levels supported by Flosum

NoTestRun: No tests are run. This test level applies only to deployments in development environments, such as in sandboxes, developer edition orgs, or trial orgs. This test level is the default for development environments.

Default test run option: Selecting this option will start the deployment without specifying any test level. The test execution will depend on the contents of the deployment package. If only declarative components are being deployed, then the apex tests will not be run. If the apex classes are being deployed, then your local apex tests (apex tests not from managed packages) will run for production orgs and will be skipped in sandboxes.

RunSpecifiedTests: Only the tests that you specify in the runTests option are run.

Code coverage requirements differ from the default coverage requirements when using this test level. Each class and trigger in the deployment package must be covered by the executed tests for a minimum of 75% code coverage. This coverage is computed for each class and trigger individually and is different than the overall coverage percentage.

RunLocalTests: All tests in your organization are run, except the ones that originate from installed managed packages. This test level is the default for production deployments that include Apex classes or triggers.

RunAllTestsInOrg: All tests are run. The tests include all the tests in your organization, including tests of managed packages.

Run tests during deployment

During deployment, you can choose different test options such as:

  • Do not run any tests
  • Run local tests, ignore test from managed packages
  • Run all tests

Result: Review the test logs to see the output of those test logs.

Print Friendly and PDF
Was this article helpful?
0 out of 0 found this helpful

Comments