feat: render common steps into every test case#39
Conversation
Add a common-steps directory whose files are rendered into every generated test case, in addition to the test's own steps. This lets shared steps - such as a teardown that removes the product CRs before the namespace is deleted - live in a single place instead of being copied into each test. The directory defaults to '<template_dir>/shared' (overridable via --common_dir) and is skipped if absent, so this is a no-op for repositories that do not opt in. 'commons' is intentionally avoided since some operators already keep unrelated helper scripts there. 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.
I think it should just fail with an informative error message. |
|
Just wanted to point out that in this design, the common cleanup template needs to know about all test cases in order to know what to clean up. Is there an HDFS cluster? An OPA cluster ? |
|
I'd suggest this wait until we're done with release testing and branching. It is fine to merge, just not bump jenkins yet |
That would effectively remove our ability to override any shared files for a single test case, which I think is very possible we'll want to do.. |
This is not time critical. Any integration test fixes I'd say wait until after the release so we have a full cycle to observe. |
My intention was to do a blanket delete of everything in That should keep it fairly generic and remove 98% of the hang potential. I'll open a PR with the actual script in |
|
PR with teardown script up: stackabletech/operator-templating#607 |
Add a common-steps directory whose files are rendered into every generated test case, in addition to the test's own steps. This lets shared steps - such as a teardown that removes the product CRs before the namespace is deleted - live in a single place instead of being copied into each test.
The directory defaults to '<template_dir>/shared' (overridable via --common_dir) and is skipped if absent, so this is a no-op for repositories that do not opt in. 'commons' is intentionally avoided since some operators already keep unrelated helper scripts there.
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.
fixes #40