Skip to content

Test Plan Configuration

The configuration of a test plan is defined within a config.yml file. This file is optional, but it enables easy configuration of test limits, test runner settings, and fixture instrumentation. The config.yml file is a YAML file that contains a dictionary of configuration values. The following configuration values are supported:

  • test_name: The name of the test plan. This value is used to identify the test plan in the test runner's user interface. If this value is not specified, the name of the test plan directory is used instead.
  • test_cases: A dictionary of test cases, containing test case limits. The keys of the dictionary are the names of the test cases, and the values are the test limit values. Test limits are used to define the pass/fail criteria for a test case. For example, if a test case measures the voltage of a power supply, the test limit could be used to define the minimum and maximum voltage values that are considered passing. Test limits can be referenced in test cases using the test_config fixture.

config.yml Test Script Configuration

The way we recommend setting test plan configuration variables is within your config.yml file. This configuration file is used to set test limits and test runner settings used by the Test Runner Application at runtime. To set test plan configuration variables, simply add them to test_cases under the appropriate test function name. These will automatically be populated by the log files and displayed by the Test Runner.

yaml
test_name: "main-test-plan"

test_cases:
  test_5v0_voltage_rail:
    test_id: "1.1"
    error_code: 101
    min_limit: 4.9
    max_limit: 5.1
    description: "5V0 Rail Test (Low Power Mode)"
    error_msg: "Voltage out of range."

To use these limits or configuration in your test script, you can simply call the test_config fixture. This should grab all of the data in the configuration file for you.

python
# Import the `log_vars` utility function
from pytest_f3ts.utils import log_vars


# Add the `record_property` fixture to the test case
def test_5v0_voltage_rail(test_config, record_property):

    # Measure the voltage and add it to the test log
    meas = get_5v0_voltage()

    # Call log_vars prior to any assertions
    log_vars(record_property)

    # Check against a low and high limit
    assert meas > test_config.min_limit
    assert meas < test_config.max_limit

Make sure the function name matches between your test_plan.py and config.yml file, or else you may get parsing errors at runtime.

Note that meas is still called within the test case, as this is a variable set and logged at runtime.

Runtime options

Beyond the config.yml file, the plugin's runtime behavior is set through pytest command-line options (for example --f3ts_config, --slot_id, and --skip-summary), not environment variables. See the CLI reference for the full list.