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: fix job/suite config use and runnable identifier #5977

Conversation

clebergnu
Copy link
Contributor

@clebergnu clebergnu commented Jun 25, 2024

This addresses a few different issues that in the end, result in the failure to set and apply a Runnable's identifier.

More specifically this:

  • fixes a regression that was adding the entire Avocado configuration to every runnable
  • makes sure the suite configuration is applied to runnables at suite creation time
  • uses the actual configuration of a runnable to set build its identifier

This reverts commit 94584fc ("Runnable: do not ignore the
configuration passed from recipes").

That change, because of the fact that every runnable uses
"runner.identifier_format", erroneously assumed that every
configuration should be passed to the runnables.  In fact, it was
decided long ago, and implemented after that, that only the
configuration that is used by runnables should be set on them.

Now, because "runner.indentifier_format" is used by all, this needs to
be taken into account.  In the near future, we may revisit the idea of
"runner.indentifier_format" being handled by the runnable as a
configuration item, and be transformed into a primary parameter of the
runnables.

Reference: avocado-framework#5964
Signed-off-by: Cleber Rosa <[email protected]>
@clebergnu clebergnu self-assigned this Jun 25, 2024
The setting of configuration into runnables is currently being done at
the time where a runnable will be run (at the "nrunner" suite runner
plugin).

But, there are situations, such as when using the Job API, that this
is too late or not effective.

This change moves the setting of the configuration to the suite, which
is based on the job configuration, and thus already has all the
information needed to set the final version of the configuration.

Fixes: avocado-framework#5963
Signed-off-by: Cleber Rosa <[email protected]>
A runnable will have its configuration updated by the suite (and job)
configuration at suite creation time.  This configuration should be
used, and not the one at the time the Runnable was crated, to set the
runnable identifier.

Signed-off-by: Cleber Rosa <[email protected]>
@clebergnu clebergnu force-pushed the runnable_job_suite_config_identifier branch from c34cc91 to 5430018 Compare June 26, 2024 01:05
The most common scenario is the runnable having its identifier format
after its URI.  When that's the case, there's no need to build the
arguments to the formatting string and performing the string format
itself.

Signed-off-by: Cleber Rosa <[email protected]>
@clebergnu clebergnu force-pushed the runnable_job_suite_config_identifier branch from 5430018 to 3a73b30 Compare June 26, 2024 11:58
@clebergnu clebergnu marked this pull request as ready for review June 26, 2024 11:58
@clebergnu clebergnu added bug customer:Passt Requirements/issues raised by the Passt project labels Jun 26, 2024
@clebergnu clebergnu requested a review from richtja June 26, 2024 12:01
Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

Hi @clebergnu, it LGTM, thank you

@clebergnu clebergnu merged commit afc71b7 into avocado-framework:master Jun 27, 2024
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug customer:Passt Requirements/issues raised by the Passt project
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants