Skip to content

Latest commit

 

History

History
139 lines (109 loc) · 9.28 KB

EiffelTestExecutionRecipeCollectionCreatedEvent.md

File metadata and controls

139 lines (109 loc) · 9.28 KB

EiffelTestExecutionRecipeCollectionCreatedEvent (TERCC)

The EiffelTestExecutionRecipeCollectionCreatedEvent declares that a collection of test execution recipes has been created. In order to clarify what that means, several concepts need to be explained.

Just as Eiffel is an opinionated protocol, EiffelTestExecutionRecipeCollectionCreatedEvent is an opinionated event, and to a certain extent that opinion goes against the grain of traditional test management. This event assumes that activity configurations and test scope definitions are two separate things. To exemplify, when one's CI server triggers the Acceptance Test activity in the pipeline, there is nothing in that activity that says which tests to execute where or with what parameters: that is a separate concern. Instead, it will query a test selection service for that information. This information is encapsulated by the EiffelTestExecutionRecipeCollectionCreatedEvent, which contains all the information needed to configure and execute the tests.

How the test selection service generates the recipe collection is, from the point of view of the Eiffel protocol, irrelevant. It may very well be from a statically defined list of test cases, or from an elaborate test selection algorithm weighing together a host of factors to determine the optimal set of test cases to execute at any particular time, or a combination of the two.

The data object consists of two main parts. data.selectionStrategy identifies the strategy used to select the test cases and generate the recipe collection, while data.batches or data.batchesUri contain or reference, respectively, the recipes. The recipes are grouped in batches, which are used to control the order of execution of test cases. Every batch has a priority to let the test executor order them in sequence, but within each batch no assumptions are made as to the execution order the test cases. This way the recipe collection can either allow the executor a high degree of freedom in scheduling the test executions, and/or prescribe the exact sequential order in which they must be executed. Each event SHALL include one and only one of data.batches and data.batchesUri.

Finally, each recipe (data.batches.recipes) consists of two parts: the test case to execute, and the constraints of that execution. The EiffelTestExecutionRecipeCollectionCreatedEvent does not control the syntax of these constraints, as the nature of such constraints are highly dependent on technology domain and test execution framework. That being said, there are three questions that typically need to be answered: what is the item under test, in what kind of environment is it to be tested, and what are the test parameters? Note the distinction between test case and test execution: it is perfectly legal for a single test case to appear multiple times within the same EiffelTestExecutionRecipeCollectionCreatedEvent, but (presumably) with different constraints.

Data Members

data.selectionStrategy

Type: Object
Required: Yes
Description: The strategy used to select the test cases and generate the recipe collection.

data.selectionStrategy.tracker

Type: String
Required: No
Description: The name of the selection strategy that generated the test execution recipe collection.

data.selectionStrategy.id

Type: String
Required: Yes
Description: The unique identity of the selection strategy that generated the test execution recipe collection.

data.selectionStrategy.uri

Type: String
Required: No
Description: The URI at which the the selection strategy that generated the test execution recipe collection can be retrieved.

data.batchesUri

Type: String
Required: No
Description: A URI at which at which the array of test execution batches can be fetched. The format of the document at this URI SHALL be on the format prescribed by data.batches (i.e. [ { "name": "Batch 1", ...}, {...}]). Each event SHALL include one and only one of data.batches and data.batchesUri.

data.batches

Type: Object[]
Required: No
Description: A list of batches of recipes. Each event SHALL include one and only one of data.batches and data.batchesUri. In the interest of keeping message sizes small, it is recommended to use data.batches only for limited numbers of test cases (on the order of ten executions). For larger numbers of executions, data.batchesUri SHOULD be used instead.

data.batches.name

Type: String
Required: No
Description: The name of the recipe batch.

data.batches.priority

Type: Integer
Required: Yes
Description: The execution priority of the batch, as compared to other batches in the collection. A lower value SHALL be interpreted as a higher priority.

data.batches.recipes

Type: Object[]
Required: Yes
Description: The collection of test execution recipes within the batch.

data.batches.recipes.id

Type: String
Required: Yes
Description: A UUID identifying the unique execution. Note that this is different from the id of a test case, in two ways. First, a test case is a (presumably) persistnent entity, whereas an execution is transient in nature. Second, a test case may be executed any number of times in any given recipe collection.

data.batches.recipes.testCase

Type: Object
Required: Yes
Description: The test case to be executed in this execution recipe.

data.batches.recipes.testCase.tracker

Type: String
Required: No
Description: The name of the test case tracker - typically a test management system.

data.batches.recipes.testCase.id

Type: String
Required: Yes
Description: The unique identity of the test case.

data.batches.recipes.testCase.uri

Type: String
Required: No
Description: A location where a description of the test case can be retrieved.

data.batches.recipes.constraints

Type: Object[]
Required: No
Description: Any constraints of the execution. The nature of such constraints is highly dependent on technology domain and test execution framework. Consequently, there are no pre-defined or required constraints. Instead, this property is a list of key-value pairs on the same format as data.customData. That being said, there are three questions that typically need to be answered: what is the item under test, in what kind of environment is it to be tested, and what are the test parameters?

data.batches.recipes.constraints.key

Type: String
Required: Yes
Description: The key name of constraint.

data.batches.recipes.constraints.value

Type: Any
Required: Yes
Description: The value of the constraint.

data.batches.dependencies

Type: Object[]
Required: No
Description: A list of test case execution dependencies. Ideally, test cases are atomic and can be executed in isolation. In cases where a test case assumes that another test case has been executed previously in the same environment, however, this property can be used to specify that. It serves as an instruction to the test executor to place two executions subsequent to one another in the same environment.

data.batches.dependencies.dependency

Type: String
Required: Yes
Description: The UUID of the dependency execution (data.batches.recipes.id), i.e. the execution that shall be performed prior to that of the dependent.

data.batches.dependencies.dependent

Type: String
Required: Yes
Description: The UUID of the dependent execution (data.batches.recipes.id), i.e. the execution that shall be performed only after that of the dependency.

Version History

Version Introduced in Changes
2.0.0 Current version. Changed syntax of data.batches.recipes.constraints from an uncontrolled object to a list of key-value pairs to comply with design guidelines.
1.0.0 edition-bordeaux Initial version.

Examples