Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add config inheritance #538

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Re-add config inheritance #538

merged 1 commit into from
Sep 13, 2024

Conversation

niknetniko
Copy link
Member

#441 enabled re-using parts of a test suite by using YAML anchors, aliases and merge keys. It also removed our own inheritance support for config options, as using this inheritance means there is no way of specifying "ignore". For example, if a tab has a config option for stdout, it will be inherited by all testcases inside the tab, unless you explicitly override it.

While at the time, the idea was that this would be confusing sometimes, it does cover the most common case of "apply this config to everything". Therefore, this PR re-adds the support.

The means specifically that the following test suite will work as expected:

- tab: "echo"
  config:
    stdout:
      normalizeTrailingNewlines: False
  testcases:
    - expression: 'echo("Hello world!")'
      stdout: 'Hello world!'
    - expression: 'echo(42)'
      stdout: "42"
    - expression: 'echo("A\nstring\nwith\nnewlines")'
      stdout: "A\nstring\nwith\nnewlines"

Without this PR, you would need to apply the config to all testcases individually.

Copy link
Member

@bmesuere bmesuere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bmesuere bmesuere merged commit 2b61918 into master Sep 13, 2024
10 checks passed
@bmesuere bmesuere deleted the feature/config-inheritance branch September 13, 2024 06:44
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