Skip to content

feat: render common steps into every test case#39

Open
soenkeliebau wants to merge 1 commit into
mainfrom
feat/common-files
Open

feat: render common steps into every test case#39
soenkeliebau wants to merge 1 commit into
mainfrom
feat/common-files

Conversation

@soenkeliebau

@soenkeliebau soenkeliebau commented Jul 8, 2026

Copy link
Copy Markdown
Member

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

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.
@razvan

razvan commented Jul 9, 2026

Copy link
Copy Markdown
Member

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.

@sbernauer sbernauer moved this to Development: Waiting for Review in Stackable Engineering Jul 9, 2026
@razvan

razvan commented Jul 9, 2026

Copy link
Copy Markdown
Member

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 ?

@NickLarsenNZ

NickLarsenNZ commented Jul 9, 2026

Copy link
Copy Markdown
Member

I'd suggest this wait until we're done with release testing and branching.
Is that ok @soenkeliebau?

It is fine to merge, just not bump jenkins yet

@soenkeliebau

soenkeliebau commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

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.

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..

@soenkeliebau

Copy link
Copy Markdown
Member Author

I'd suggest this wait until we're done with release testing and branching. Is that ok @soenkeliebau?

It is fine to merge, just not bump jenkins yet

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.

@soenkeliebau

soenkeliebau commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

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 ?

My intention was to do a blanket delete of everything in *.stackable.tech which should kill all our CRDs, and then do a waitForDeletion on the statefulsets with label 'vendor: stackable`

That should keep it fairly generic and remove 98% of the hang potential.

I'll open a PR with the actual script in operator-templating and link here, so we can discuss on the actual code.

@soenkeliebau

Copy link
Copy Markdown
Member Author

PR with teardown script up: stackabletech/operator-templating#607

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: Waiting for Review

Development

Successfully merging this pull request may close these issues.

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

4 participants