def METHOD_NAME(
    mock_mkdtemp: mock.MagicMock,
    mock_fetch: mock.MagicMock,
    tmp_path: Path,
    cli_runner: RunnerFunc,
    config: Config,
    pp_filter: bool,
    package_ns: Optional[str],
    local: bool,
    keep_dir: bool,
    tmp_dir: str,
):
    mock_fetch.side_effect = _mock_fetch_components
    tmp_dir_arg = tmp_dir
    if not tmp_dir:
        tmp_dir = "build"
        tmp_dir_arg = ""
    compile_dir = tmp_path / tmp_dir
    def _mock_mkdtemp(prefix="tmp-"):
        compile_dir.mkdir(parents=True, exist_ok=True)
        return compile_dir
    mock_mkdtemp.side_effect = _mock_mkdtemp
    config.local = local
    pkg_path = _setup_package(tmp_path, package_ns)
    _prepare_component(compile_dir, cli_runner)
    if pp_filter:
        _add_postprocessing_filter(compile_dir)
    compile.compile_package(
        config,
        pkg_path,
        "tests/defaults.yml",
        [],
        keep_dir=keep_dir,
        tmp_dir=tmp_dir_arg,
    )
    output = pkg_path / "compiled" / "test-component"
    assert output.is_dir()
    assert (output / "test-component").is_dir()
    assert (output / "apps").is_dir()
    assert (output / "apps" / "test-component.yaml").is_file()
    assert (output / "test-component" / "test_service_account.yaml").is_file()
    # Define expected final namespace for SA based on test matrix
    expected_ns = "syn-test-component"
    if package_ns:
        expected_ns = package_ns
    if pp_filter:
        expected_ns = "test-component-ns"
    fcontents = yaml_load(output / "test-component" / "test_service_account.yaml")
    assert fcontents["metadata"]["namespace"] == expected_ns