Skip to content

Switch from sources to high_cost/target_sources

Switch from using "sources" conditions in patterns, describing what test cases are covering, to using two new properties: "high_cost" and "target_sources". Allow specifying, but ignore the former.

If the "high_cost" property is true, the test case is considered to have a high cost of running/interpretation vs. its impact, relative to other test cases. The default is false. A test receives the closest value of "high_cost" property from the case or its parents.

Both "kpet run" and "kpet test list" receive a new option called "--high-cost", specifying the condition for selecting "high-cost" tests: never, only when "targeted" (default), and "always".

This way, by default, specifying "high_cost: true" is equivalent to specifying "enabled: sources: not: null".

The "target_sources" property can contain either a regular expression, or a list thereof, matching the source files the test case is supposed to be covering, or "targeting".

Specifying a particular "<VALUE>" to "target_sources" is basically equivalent to specifying "enabled: sources: <VALUE>". However, a test receives the sum of "target_sources" properties from the case and its parents. If none are present, the test is considered to be covering something outside the source tree, and is included regardless of whether or not (or which) source files were specified to a kpet command.

This also removes support for so-called "baseline-only" tests, which would only execute if no changed source files were specified to kpet. This was considered unnecessary, and the removal allowed to simplify both the kpet code and kpet-db.

Now all tests are included regardless of which source files they cover, when no changed files are specified to kpet. When source files are specified, then only tests with matching "target_sources", or no "target_sources" property present are included.

Edited by Nikolai Kondrashov

Merge request reports