Skip to content

Treat empty Controllers and TestParams sections in the config as empty dicts - #1085

Closed
aad1tyaaaaa wants to merge 1 commit into
google:masterfrom
aad1tyaaaaa:fix-empty-testbed-sections
Closed

aad1tyaaaaa wants to merge 1 commit into
google:masterfrom
aad1tyaaaaa:fix-empty-testbed-sections

Conversation

@aad1tyaaaaa

Copy link
Copy Markdown

A testbed config with an empty TestParams: or Controllers: section, for example after commenting out every param, crashes the test class:

TestBeds:
  - Name: SampleTestBed
    Controllers:
    TestParams:

With a test whose setup_class calls self.unpack_userparams(greeting="hi"):

TypeError: argument of type 'NoneType' is not a container or iterable

at base_test.py:255, and the class is recorded as Error 1, Executed 0.

YAML loads an empty section as None, and original_bed_config.get(key, {}) in config_parser.py returns that None instead of the default. An empty Controllers: reaches the same None in controller_manager.py (module_config_name not in self.controller_configs).

Both lookups are now original_bed_config.get(key) or {}, so an empty section behaves like a missing one. test_load_test_config_file_with_empty_sections covers it; it fails without the fix, and the full suite passes with it.

(Written with help from Claude Code.)

@xpconanfan

xpconanfan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for spotting and reporting this! While reviewing, we noticed a few closely related YAML None and validation gaps in config_parser.py (empty MoblyParams:, empty LogPath:, empty/missing TestBeds: before tb_filters, and non-dict values like []/false being silently coerced by or {}).

Opened #1086 with a broader fix that handles all of these consistently with explicit None checks and MoblyConfigError validation. Closing this PR in favor of #1086 — thanks again for flagging the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants