2022-06-20 02:02:54 +00:00
# Enhanced Outcomes
2022-06-23 13:03:23 +00:00
Enhanced Outcomes refers to the addition of new control outcomes to the InSpec vocabulary.
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
## Test Outcomes vs. Control Outcomes
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
It is essential to understand that Enhanced Outcomes refers to new **control outcomes** , the results of running a control.
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
The results of running a test, a `describe block` are determined by RSpec and are limited to `Pass` , `Fail` , and `Skip` .
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
Test outcomes are much more difficult to extend than control outcomes.
2022-06-20 02:02:54 +00:00
## New Control Outcomes
2022-06-23 13:03:23 +00:00
Enhanced Outcomes adds three new control outcomes to the existing `Pass` , `Fail` , and `Skip` outcomes.
2022-06-20 02:02:54 +00:00
### Error
2022-06-23 13:03:23 +00:00
In the first iteration of Enhanced Outcomes, the Error outcome is detected:
2022-06-20 02:02:54 +00:00
2022-06-23 14:28:25 +00:00
* if the message of any test includes the text "Control source error" OR
* the result of any test includes a backtrace
2022-06-20 02:02:54 +00:00
2022-06-23 15:13:34 +00:00
Then the entire control should be marked `Error` .
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
Additional means of detecting error may be developed in the future.
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
Error's abbreviation is `ERR` . Error's UI color assignment is `Indigo` .
2022-06-20 02:02:54 +00:00
### Not Applicable
2022-06-23 15:13:34 +00:00
If the control is not in `Error` and the impact of the control is `0.0` , then the control's outcome is `Not Applicable` .
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
Not Applicable's abbreviation is `N/A` . Not Applicable's UI color assignment is `Sky Blue` .
2022-06-20 02:02:54 +00:00
### Not Reviewed
2022-06-23 13:03:23 +00:00
If the control is not in `Error` or `Not Applicable` , and all test results are `Skipped` , then the control outcome is `Not Reviewed` .
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
Not Reviewed replaces `Skipped` as a control outcome.
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
Not Reviewed's abbreviation is `N/R` . Not Reviewed's UI color assignment is `Amber` .
2022-06-20 02:02:54 +00:00
2022-06-23 13:03:23 +00:00
## The `--enhanced-outcomes` option
2022-06-20 02:02:54 +00:00
A new CLI option will be introduced for `inspec exec` , `inspec shell` , and `inspec schema` that controls the Enhanced Outcomes functionality.
### InSpec 5
2022-06-23 13:03:23 +00:00
In InSpec 5.x, a user must request the enhanced outcomes functionality explicitly by adding the `--enhanced-outcomes` option.
2022-06-20 02:02:54 +00:00
### InSpec 6
2022-06-23 13:03:23 +00:00
In InSpec 6.x, --enhanced-outcomes will default to `true` . A user may request disabling the enhanced outcomes functionality by adding the `--no-enhanced-outcomes` option.