idf_ci.build_collect package

Submodules

class idf_ci.build_collect.models.AppInfo(*, target: str, config: str, build_status: BuildStatus, build_comment: str = '', test_comment: str = '', test_cases: List[CaseInfo] = [], has_temp_rule: bool = False, matched_rules: Dict[str, List[str]] = {})

Bases: BaseModel

Information about a buildable app.

build_comment: str
build_status: BuildStatus
config: str
has_temp_rule: bool
matched_rules: Dict[str, List[str]]
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

serialize_build_status(status: BuildStatus) str
target: str
test_cases: List[CaseInfo]
test_comment: str
class idf_ci.build_collect.models.AppKey(path: str, target: str, config: str)

Bases: NamedTuple

Unique identifier for an app.

config: str

Alias for field number 2

path: str

Alias for field number 0

target: str

Alias for field number 1

class idf_ci.build_collect.models.AppStatus(*values)

Bases: str, Enum

App status for HTML format.

DISABLED = 'D'
DISABLED_AND_TESTS_ENABLED = 'DT'
DISABLED_AND_TESTS_MIXED = 'DTS'
DISABLED_AND_TESTS_SKIPPED = 'DS'
SHOULD_BE_BUILT = 'B'
SHOULD_BE_BUILT_AND_TESTS_ENABLED = 'BT'
SHOULD_BE_BUILT_AND_TESTS_MIXED = 'BTS'
SHOULD_BE_BUILT_AND_TESTS_SKIPPED = 'BS'
UNKNOWN = 'U'
property description: str
class idf_ci.build_collect.models.CaseInfo(*, name: str, caseid: str, disabled: bool = False, disabled_by_manifest: bool = False, disabled_by_marker: bool = False, skip_reason: str = '', test_comment: str = '')

Bases: BaseModel

Information about a test case attached to an app.

caseid: str
disabled: bool
disabled_by_manifest: bool
disabled_by_marker: bool
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
serialize(handler: SerializerFunctionWrapHandler) Dict[str, Any]
skip_reason: str
test_comment: str
class idf_ci.build_collect.models.CollectResult(*, summary: Summary = Summary(total_projects=0, total_apps=0, total_test_cases=0, total_test_cases_used=0, total_test_cases_disabled=0, total_test_cases_missing_app=0), projects: Dict[str, ProjectInfo] = {})

Bases: BaseModel

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

projects: Dict[str, ProjectInfo]
summary: Summary
class idf_ci.build_collect.models.MissingAppInfo(*, target: str, config: str, test_cases: List[CaseInfo] = [])

Bases: BaseModel

Information about a missing app referenced by test cases.

config: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

target: str
test_cases: List[CaseInfo]
class idf_ci.build_collect.models.ProjectInfo(*, apps: List[AppInfo] = [], missing_apps: List[MissingAppInfo] = [])

Bases: BaseModel

Collection of apps and missing apps for a one path (project).

apps: List[AppInfo]
missing_apps: List[MissingAppInfo]
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class idf_ci.build_collect.models.Summary(*, total_projects: int = 0, total_apps: int = 0, total_test_cases: int = 0, total_test_cases_used: int = 0, total_test_cases_disabled: int = 0, total_test_cases_missing_app: int = 0)

Bases: BaseModel

Statistics of the collected apps and test cases.

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

total_apps: int
total_projects: int
total_test_cases: int
total_test_cases_disabled: int
total_test_cases_missing_app: int
total_test_cases_used: int
idf_ci.build_collect.scripts.collect_apps(*, paths: List[str] | None = None, include_only_enabled: bool = False) CollectResult

Collect all apps and their corresponding test cases.

Parameters:
  • paths – Paths to search.

  • include_only_enabled – If True, only include enabled apps.

Returns:

CollectResult instance.

idf_ci.build_collect.scripts.collect_build_apps(*, paths: List[str] | None = None, include_only_enabled: bool = False) Tuple[Dict[AppKey, App], Dict[str, str]]

Collect all buildable apps from given paths.

Parameters:
  • paths – Paths to search for apps.

  • include_only_enabled – If True, include only enabled apps.

Returns:

Tuple of dictionary with apps and mapping of normalized paths to original paths.

idf_ci.build_collect.scripts.collect_test_apps(*, paths: List[str] | None = None) Dict[AppKey, List[PytestCase]]

Collect all apps referenced by pytest test cases from given paths.

Parameters:

paths – Paths to search for test cases.

Returns:

Dictionary with apps containing list of test cases.

idf_ci.build_collect.scripts.create_target_info(target: str, app: AppInfo | None) Dict[str, Any]

Create information about target for HTML format.

Parameters:
  • target – Target name.

  • app – AppInfo instance or None if app is missing.

Returns:

Dictionary with target information.

idf_ci.build_collect.scripts.create_test_case_info(test_case: PytestCase, app: App)

Create information about test case for given app.

Parameters:
  • test_case – PytestCase instance.

  • app – App instance.

Returns:

CaseInfo instance.

idf_ci.build_collect.scripts.create_test_case_missing_app_info(test_case: PytestCase, target: str)

Create information about test case with missing app.

Parameters:
  • test_case – PytestCase instance.

  • target – Target name.

Returns:

CaseInfo instance.

idf_ci.build_collect.scripts.enabled_test_targets(app: App) List[str]

List of enabled test targets for the app.

Parameters:

app – App instance.

Returns:

List of enabled test targets.

idf_ci.build_collect.scripts.format_as_html(result: CollectResult) str

Format result as HTML.

Parameters:

result – CollectResult instance.

idf_ci.build_collect.scripts.format_as_json(result: CollectResult) str

Format result as JSON.

Parameters:

result – CollectResult instance.

idf_ci.build_collect.scripts.group_by_path(apps: Dict[AppKey, AppValue]) Dict[str, Dict[AppKey, AppValue]]

Group apps by path.

Parameters:

apps – Dictionary with apps.

Returns:

Dictionary grouped by path.

idf_ci.build_collect.scripts.has_temporary_rule(app: App) bool
idf_ci.build_collect.scripts.matched_rules(app: App) Dict[str, List[str]]
idf_ci.build_collect.scripts.normalize_path(path: str) str
idf_ci.build_collect.scripts.process_apps(build_apps: Dict[AppKey, App], test_apps: Dict[AppKey, List[PytestCase]]) Tuple[List[AppInfo], Set[str], Set[str]]

Process buildable apps and attach test cases.

Parameters:
  • build_apps – Dictionary with buildable apps.

  • test_apps – Dictionary with apps referenced by test cases.

Returns:

Tuple of info about apps, used test cases, and disabled test cases.

idf_ci.build_collect.scripts.process_missing_apps(build_apps: Dict[AppKey, App], test_apps: Dict[AppKey, List[PytestCase]]) Tuple[List[MissingAppInfo], Set[str]]

Find and process missing apps referenced by test cases.

Parameters:
  • build_apps – Dictionary with buildable apps.

  • test_apps – Dictionary with apps referenced by test cases.

Returns:

Tuple of info about missing apps and their test cases.

Module contents