Optimize test runs with SeaLights

If you integrate Tosca with Tricentis SeaLights, Tosca skips tests that cover unchanged code, based on the recommendation from SeaLights. This speeds up your test cycles and gives you more time to focus on the code that needs your attention.

In this topic, you'll learn how to turn on optimization and understand results.

Before you start

Before you start optimizing your test runs with SeaLights, make sure the following things are true:

  • You have an environment that's set up for integration.

  • You know the path to the build session ID file. If you don't, check in with your administrator who set up the integration.

  • You have access to the test artifacts you want to optimize. That means that the test artifacts aren't currently checked out by someone else. It also means that you're in the Owning Group, if any of the test artifacts have restricted user rights.

Enable optimization

To enable SeaLights optimization for your tests, use the SeaLights configuration. You can find it in the Configurations folder in the Standard subset.

The SeaLights configuration contains the following test configuration parameters (TCPs):

TCP name

TCP value

Description

SeaLightsOptimization

True

Turns on the optimization in Tosca.

SeaLightsBuildSessionIdFilePath

<Path to the file with the build session ID>

Defines which build of your application you're testing. SeaLights needs this information to detect code changes.

Enter the file path into the TCP SeaLightsBuildSessionIdFilePath and then assign the configuration to the tests you want to optimize.

Choose where to assign the configuration

We recommend that you assign the configuration to higher-level objects such as ComponentFolders, Execution folders, or ExecutionLists folders. That way, all child objects inherit the configuration, and you don't need to assign it over and over.

You can still fine-tune. Let's say you have a parent Execution folder with three child ExecutionLists folders, and you only want to optimize the tests in two of the ExecutionLists folders.

In this case, perform the following actions: 

  • Assign the configuration to the Execution folder. This means all child objects inherit them.

  • For the one ExecutionLists folder whose tests you don't want to optimize, change the value of the TCP SeaLightsOptimization to False.

Note that the SeaLights configuration only has an effect on ExecutionLists. It doesn't impact other objects you might have in a folder, such as TestCases or Modules.

Find optimized tests

If you assigned the configuration, but can't remember where, check out our topic on how to find SeaLights-optimized tests.

Understand test results

After you enable optimization, SeaLights uses the first test run to learn the application code. Since SeaLights is learning, Tosca runs all tests during this first test run. Including those that cover unchanged code.

Beginning with the second test run after turning on optimization, SeaLights performs its Test Impact Analysis and tells Tosca to skip tests, if applicable.

Tosca logs all skipped tests.

In your test results, you can recognize skipped tests by the following indicators:

Test results for Example ExecutionListTosca skipped ExecutionEntry 1 

What's next

Now that you've turned on optimization, run your tests. SeaLights uses this first test run to learn your application's code.