Skip to content

Feature: Add common test steps that are rendered into all generated tests #40

Description

@soenkeliebau

Problem

Some kuttl test steps are identical across every test in an operator — the clearest example is a
teardown step that deletes the product custom resources before the namespace is removed (see #2).
Today beku renders only each test's own template directory, so a common step has to be copied into
every tests/templates/kuttl/<test>/ directory and kept in sync by hand.

Proposal

Teach beku to render a shared directory into every generated test case, in addition to that
test's own steps.

  • Files in a shared/ directory next to the test templates (i.e. tests/templates/kuttl/shared) are
    rendered into every generated test case.
  • The directory is templated exactly like regular steps: .j2/.jinja2 files are rendered (with
    NAMESPACE and lookup available), others are copied verbatim.
  • Location overridable with a new -c/--common_dir CLI flag.
  • No-op unless the directory exists — repositories that don't opt in are completely unaffected.
  • Collision safety: on a name collision the test's own file wins. A shared file that would
    overwrite a file the test already provides is skipped (with a warning), so a shared step can never
    silently clobber a test-specific one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions