8000 Fix config 'extends' option processing by lxa · Pull Request #6873 · Codeception/Codeception · GitHub
[go: up one dir, main page]

Skip to content

Conversation

lxa
Copy link
@lxa lxa commented Aug 19, 2025

Fix: extends handling in config files (global + suite)

Fixes #6872

Problem

  • extends was expanded too late in the load process:
    • Defaults were merged into the “inherited” config before extends was resolved.
      → Result: scalar values from parent configs were lost (arrays still merged).
    • params from parent configs were ignored (see also #6799).
  • For suite configs, extends resolution was missing completely for .suite.dist.yml files.
    → Result: extends in suite dist configs was silently ignored.

Fix

  • Moved extends expansion into getConfFromContents(), which is used for both global and suite config resolution.
  • Now an entire chain of inheritance is expanded immediately when a config is loaded from file.
  • Only after expansion, the normal config merge order applies:
    codeception.dist.yml → codeception.yml → acceptance.suite.dist.yml → acceptance.suite.yml
  • Added check for circular extends references with a clear error message.

Result

  • Scalars and arrays from parent configs are inherited correctly.
  • params from base configs are preserved.
  • extends works in .suite.dist.yml files (not ignored anymore).
  • Behavior is now consistent across global and suite configs.

Notes

  • This matches what the docs currently say about extends.
  • If merged, docs might be updated to clarify that the full inheritance chain is expanded first, then the normal config precedence rules apply.

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.

extends option in config files not working as expected

1 participant

0