Skip to content

Handle empty YAML sections and validate config structure in config_parser - #1086

Merged
xpconanfan merged 1 commit into
google:masterfrom
xpconanfan:fix-config-parser-empty-sections
Dec 3, 2026
Merged

xpconanfan merged 1 commit into
google:masterfrom
xpconanfan:fix-config-parser-empty-sections

Conversation

@xpconanfan

Copy link
Copy Markdown
Collaborator

YAML parses bare/empty sections (e.g. MoblyParams:, LogPath:, Controllers:, TestParams:, TestBeds:) as None, which previously caused TypeError/AttributeError in load_test_config_file and downstream callers.

Changes

  • Treat missing or None MoblyParams, Controllers, and TestParams sections as {} via _get_dict_section(), while raising MoblyConfigError for non-dict values (e.g. lists or booleans).
  • Fall back to _DEFAULT_LOG_PATH when LogPath is empty/None.
  • Run _validate_test_config() before accessing TestBeds / tb_filters / MoblyParams, ensuring the top-level config is a dict and TestBeds is a non-empty list.
  • Add unit tests covering empty sections, empty LogPath, empty YAML files, empty TestBeds, and non-dict sections.

Supersedes #1085.

@xpconanfan
xpconanfan merged commit 2b2c2ca into google:master Dec 3, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants