def METHOD_NAME(
    cli_runner: RunnerFunc,
    tmp_path: Path,
    parameters: dict[str, Any],
    args: list[str],
):
    global_config = tmp_path / "global"
    global_config.mkdir()
    with open(global_config / "commodore.yml", "w") as f:
        yaml.safe_dump({"classes": ["global.test"]}, f)
    with open(global_config / "test.yml", "w") as f:
        yaml.safe_dump({"classes": ["foo.bar"], "parameters": parameters}, f)
    result = cli_runner(["inventory", "components", str(global_config)] + args)
    assert result.exit_code == 0
    if "json" in args:
        components = json.loads(result.stdout)
    else:
        components = yaml.safe_load(result.stdout)
    expected_components = parameters.get("components", {})
    assert components == expected_components