Skip to content

[OMEGA-332] test(config): add configuration loader unit coverage - #290

Open
eliasakalu wants to merge 3 commits into
singnet:mainfrom
eliasakalu:test-config-loader
Open

[OMEGA-332] test(config): add configuration loader unit coverage#290
eliasakalu wants to merge 3 commits into
singnet:mainfrom
eliasakalu:test-config-loader

Conversation

@eliasakalu

Copy link
Copy Markdown

Summary

Add focused unit coverage for OmegaClaw's Python configuration loader and register the suite as a mandatory CI check.

Coverage

The new test suite verifies:

Command-line parsing

  • Standard key=value arguments.
  • Bare arguments converted to boolean flags.
  • Empty values.
  • Empty argument lists.
  • Values containing additional = characters.

Configuration sources

  • Command-line arguments.
  • OMEGACLAW_<key> environment variables.
  • YAML configuration files.
  • Supplied defaults.

Resolution precedence

The expected priority order is verified explicitly:

  1. Command-line argument
  2. Environment variable
  3. Configuration file
  4. Default value

Cache behavior

  • Resolved values remain stable after being cached.
  • init_config() clears values from the previous initialization.

Public API

The suite confirms the availability of:

  • init_config
  • config_get_by_key
  • command_line_to_dict

CI integration

Added the suite to:

Autotests/run_mandatory

@alyona-snet alyona-snet changed the title test(config): add configuration loader unit coverage [OMEGA-332] test(config): add configuration loader unit coverage Aug 10, 2026
timur-ashkenov
timur-ashkenov previously approved these changes Aug 11, 2026
@TossSky

TossSky commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Checked this for OMEGA-332.

What I checked:

  • the suite is registered in run_mandatory and collects with the mandatory set
  • argument parsing: key=value, bare flags, empty values, empty list, values with an extra =
  • all four sources: command line, OMEGACLAW_ environment, YAML file, defaults
  • priority order: command line, environment, file, default
  • cached values stay stable and init_config drops the previous ones
  • in-process only: no container, no dependency beyond what CI installs

I merged current main into the branch and resolved the conflict in Autotests/run_mandatory, keeping every registered entry.

I also pushed one change to the tests: the YAML file was written but never actually read, because both file-related tests resolved their value from somewhere else. Added test_init_config_reads_yaml_file and a second assertion on a key that only exists in the file, so a broken read now fails the suite.

Verdict: PASS

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants