Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[th/skip-deprecated-aliases-for-test-cases] handle aliases for test cases by skipping #186

Conversation

thom311
Copy link
Collaborator

@thom311 thom311 commented Jan 7, 2025

Some TestCaseType are identical to others. If we select a range (test_cases: "*" or test_cases: "1-26"), we will effectively run the same test twice. That is undesirable because it wastes time.

Skip those aliases.

An alternative would be to just delete them. But that might break existing configurations. So it's not done (for now).

@thom311 thom311 force-pushed the th/skip-deprecated-aliases-for-test-cases branch from 6a1e854 to f6c2639 Compare January 12, 2025 08:58
@wizhaoredhat
Copy link
Collaborator

I think it would be cleaner to just remove those that don't work or doesn't make sense

@thom311 thom311 force-pushed the th/skip-deprecated-aliases-for-test-cases branch from f6c2639 to 45e3237 Compare January 16, 2025 21:22
A few TestCaseType exhibit the identical behavior as some others. We can
see that, because their TestCaseTypInfo contains the identical settings.
We also have a unit test that uncovers this ("identical_cases") and
which guards against adding such duplicate tests in the future.

Add a flag TestCaseTypInfo.deprecated_alias_for to those duplicated.
Later, we will treat them special.

Signed-off-by: Thomas Haller <[email protected]>
Some TestCaseType are identical to others. It makes no sense to run
them. However, we get them easily when specifying a range or "*".

If we have such a deprecated alias, then skip it if-and-only-if the
original value is also present.

Note that this skipping does not cover any further check for duplicates. With
ranges, we can easily specify the same test multiple times, and we will
run them. We only skip the aliases if the orignal is already selected.

Signed-off-by: Thomas Haller <[email protected]>
Those values are basically the same as another one, respectively. They
are redundant.

Drop them.

This obviously changes behavior. It also will break existing
configurations, if they refer to one of those removed types (either by
enum name or number). However, note that ranges ("1-20") or the whole
range ("*") will still work (excluding the deleted types).

Signed-off-by: Thomas Haller <[email protected]>
@thom311 thom311 force-pushed the th/skip-deprecated-aliases-for-test-cases branch from 45e3237 to 51f6243 Compare January 16, 2025 21:23
@thom311
Copy link
Collaborator Author

thom311 commented Jan 16, 2025

I think it would be cleaner to just remove those that don't work or doesn't make sense

ok, how about this?

the two earlier commits are still there, they don't hurt and show how this could have been handled alternatively. I don't mind squashing the branch, if we agree on dropping the values.

@wizhaoredhat
Copy link
Collaborator

LGTM! Thanks for cleaning this up

@wizhaoredhat wizhaoredhat merged commit a1508c1 into ovn-kubernetes:main Jan 17, 2025
5 checks passed
@thom311 thom311 deleted the th/skip-deprecated-aliases-for-test-cases branch January 17, 2025 17:21
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