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.
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
bekurenders only each test's own template directory, so a common step has to be copied intoevery
tests/templates/kuttl/<test>/directory and kept in sync by hand.Proposal
Teach
bekuto render a shared directory into every generated test case, in addition to thattest's own steps.
shared/directory next to the test templates (i.e.tests/templates/kuttl/shared) arerendered into every generated test case.
.j2/.jinja2files are rendered (withNAMESPACEandlookupavailable), others are copied verbatim.-c/--common_dirCLI flag.overwrite a file the test already provides is skipped (with a warning), so a shared step can never
silently clobber a test-specific one.