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

Runnable identifier #5992

Merged
merged 2 commits into from
Aug 12, 2024
Merged

Conversation

richtja
Copy link
Contributor

@richtja richtja commented Aug 1, 2024

This commit introduces a way how to explicitly specify runnable identifier through Job API or runnable recipe. This change shouldn't affect current behaviour and if the identifier is not specified it will be generated based on the runner.identifier_format config variable.

Reference: #5964

@richtja richtja added enhancement customer:Passt Requirements/issues raised by the Passt project labels Aug 1, 2024
@richtja richtja added this to the 107 - Codename TBD milestone Aug 1, 2024
@richtja richtja self-assigned this Aug 1, 2024
Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

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

Hi @richtja,

This LGTM, but I will ask you to consider:

  • Adding one example of the identifier to the recipes documentation section
  • Adding identifier example to examples/nrunner/recipes/runnable or examples/nrunner/recipes/runnables

One other issue that this opens is what to present on an avocado list command. What I mean is that, until now, it was presenting the "only" information available, that is, the URI. Example:

avocado list examples/nrunner/recipes/runnable/exec_test_sleep_3.json 
exec-test /bin/sleep

Now, with a change such as:

diff --git a/examples/nrunner/recipes/runnable/exec_test_sleep_3.json b/examples/nrunner/recipes/runnable/exec_test_sleep_3.json
index 23113758b..8e4284eb0 100644
--- a/examples/nrunner/recipes/runnable/exec_test_sleep_3.json
+++ b/examples/nrunner/recipes/runnable/exec_test_sleep_3.json
@@ -1 +1 @@
-{"kind": "exec-test", "uri": "/bin/sleep", "args": ["3"]}
+{"kind": "exec-test", "uri": "/bin/sleep", "args": ["3"], "identifier": "sleep-3-seconds"}

It may make sense to show, instead:

avocado list examples/nrunner/recipes/runnable/exec_test_sleep_3.json 
exec-test sleep-3-seconds

@richtja
Copy link
Contributor Author

richtja commented Aug 2, 2024

Hi @clebergnu, thanks for your review. I agree with you, and I will update the examples. Also, it reminded to me that I should update our documentation as well.

@richtja
Copy link
Contributor Author

richtja commented Aug 5, 2024

Hi @clebergnu, I have added the examples and update the avocado list. Please have a look.

@richtja richtja requested a review from clebergnu August 5, 2024 12:23
Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

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

Hi @richtja,

I've spotted two things for you to address. Thanks for this version!

avocado/schemas/runnable-recipe.schema.json Outdated Show resolved Hide resolved
examples/nrunner/recipes/runnable/identifier.json Outdated Show resolved Hide resolved
@richtja
Copy link
Contributor Author

richtja commented Aug 12, 2024

Hi @clebergnu, thanks for your review. I have addressed your comments via force-push. Please have a look.

@richtja richtja requested a review from clebergnu August 12, 2024 11:54
This commit introduces a way how to explicitly specify runnable
identifier through Job API or runnable recipe. This change shouldn't
affect current behaviour and if the identifier is not specified it will
be generated based on the `runner.identifier_format` config variable.

Reference: avocado-framework#5964
Signed-off-by: Jan Richter <[email protected]>
After this commit the `avocado list` command will print runnable
identifier instead of url and `avocado -V list` will add the identifier
as another column in the list matrix. It will be helpful when users will
define their own identifiers after change in e7228af.

Signed-off-by: Jan Richter <[email protected]>
@richtja
Copy link
Contributor Author

richtja commented Aug 12, 2024

Hi @clebergnu, I have just updated the examples/jobs/custom_exec_test.py. Please have a look.

Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@clebergnu clebergnu merged commit 4c590e2 into avocado-framework:master Aug 12, 2024
56 of 57 checks passed
@richtja richtja deleted the runnable_identifier branch August 20, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer:Passt Requirements/issues raised by the Passt project enhancement
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Runnable (and thus Task) identifiers explicitly set (instead of through identifier formats)
2 participants