Skip to content

Conversation

Nambrok
Copy link
Contributor

@Nambrok Nambrok commented Mar 10, 2025

Remove tests/storage/{lvm,ext} that were duplicated tests.
Add tests/storage/generic to replace them.
Add a parameter --sr-type to select which SR types to run generic tests on.
If the parameter is set to all, it will run on all members of the list defined in tests/storage/generic/conftest.py:SR_TYPES (containing lvm and ext SR types for the moment).
Also adapt jobs definition with the new parameter.

@Nambrok Nambrok requested review from stormi and Wescoeur March 10, 2025 14:43
@Nambrok Nambrok force-pushed the dtt-generic-storage branch from 7a50d8a to 1157685 Compare March 10, 2025 14:45
@Nambrok Nambrok force-pushed the dtt-generic-storage branch from 1157685 to c3a5fd4 Compare March 10, 2025 14:46
Signed-off-by: Damien Thenot <[email protected]>
@ydirson ydirson self-requested a review March 14, 2025 15:54
@@ -75,6 +75,13 @@ def pytest_addoption(parser):
"4KiB blocksize to be formatted and used in storage tests. "
"Set it to 'auto' to let the fixtures auto-detect available disks."
)
parser.addoption(
"--sr-type",
Copy link
Member

Choose a reason for hiding this comment

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

This is another added parameter to control which tests should be executed or not, which adds a layer between test definitions themselves and job definitions (jobs.py). I see a lot of PRs adding parameters, and this looks like added complexity for the ones running the tests.

How do you express "all storage types except largeblock and linstor" with this? (see job definitions in jobs.py that rely on this)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This only include ext and lvm since those were identical. I agree it's not optimal, I'm looking into a way that will involve giving a path to pytest.

Copy link
Member

Choose a reason for hiding this comment

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

Couldn't we use test class inheritance and still keep individual test files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm gonna try new things for this PR, gonna see if we can do something better with inheritance or other mechanisms.

@Nambrok Nambrok marked this pull request as draft April 4, 2025 13:06
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