-
Notifications
You must be signed in to change notification settings - Fork 8
Add canary_cdash_subproject_label hook for adding cdash subproject labels #39
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this supersede #20?
|
||
class CDashHooks: | ||
@hookspec(firstresult=True) | ||
def canary_cdash_subproject_label(self, case: "TestCase") -> str | None: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return list[str] | None
and be plural, i.e., ..._labels
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had intended to return a single subproject label for each test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but if that is not idiomatic or expected (ie, a test belongs to several subprojects) it can be changed
This change seems like it would be either Subprojects enabled if your plugin declares the hooks or specifies a list of labels on the command line but no way to enable/disable from the command line. It also implies not to support Subprojects without plugin implementation which I think would be beneficial. Is there an opposition to combining a bit of both the CLI changes form #20 and this change? I think Canary should be able to generate Subproject labels from the default implementation of a Testcase or from a given build file as well. |
src/_canary/main.py
Outdated
@@ -131,6 +132,7 @@ def __call__(self, *args_in: str, fail_on_error: bool = True) -> int: | |||
config.plugin_manager.hook.canary_addoption(parser=parser) | |||
args = parser.parse_args(argv) | |||
config.set_main_options(args) | |||
config.plugin_manager.hook.canary_addhooks(pluginmanager=config.plugin_manager) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I follow?
@mdmosby said:
I'd say augments, since we may still want to adopt the idea of a test case's labels all being subprojects (per #39 (comment)) |
@davi0011 said in #39 (comment)
When I think of subproject labels, I imagine a test belonging to a single subproject. If all the test keywords become CDash subproject labels, then that test would belong to many subprojects. If that is idiomatic CDash, then I like the option of a command line flag to enable that. |
My understanding is that CTest uses the test labels to generate the list of Subprojects labels. Hence, I think it would be fine to leave that as a default way of getting the labels with the plugin method if you wish for a more specific method. |
My understanding is that you must set the variable |
@mdmosby and @davi0011 - this is an alternative method of specifying CDash subproject labels. It adds two plugin hooks:
canary_cdash_labels_for_subproject() -> list[str]
canary_cdash_subproject_label(case: TestCase) -> str
For Sierra to use the plugin hook, simply add the following: