-
Notifications
You must be signed in to change notification settings - Fork 340
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: support own configuration and suite configuration #5998
Labels
Milestone
Comments
clebergnu
added
bug
customer:Passt
Requirements/issues raised by the Passt project
labels
Aug 12, 2024
clebergnu
added a commit
to clebergnu/avocado
that referenced
this issue
Aug 22, 2024
This change allows for the a runnable configuration and the suite and default configuration to coexist with the correct behavior. In short, if the suite has a configuration, it will become the new default configuration for a runnable, while its own configuration will not be touched. Note: there's an opportunity here for changing the data structure used for the "config" attribute, one that looks up the value in the "default_config" if it doesn't exist in the actual "config". But, given that the size of the "default_config" will always be very small (given that it's filtered to contain only the used configuration by the runner) it seemed an unnecessary optimization at this time. Fixes: avocado-framework#5998 Signed-off-by: Cleber Rosa <[email protected]>
clebergnu
added a commit
to clebergnu/avocado
that referenced
this issue
Aug 22, 2024
This change allows for the a runnable configuration and the suite and default configuration to coexist with the correct behavior. In short, if the suite has a configuration, it will become the new default configuration for a runnable, while its own configuration will not be touched. Note: there's an opportunity here for changing the data structure used for the "config" attribute, one that looks up the value in the "default_config" if it doesn't exist in the actual "config". But, given that the size of the "default_config" will always be very small (given that it's filtered to contain only the used configuration by the runner) it seemed an unnecessary optimization at this time. Fixes: avocado-framework#5998 Signed-off-by: Cleber Rosa <[email protected]>
clebergnu
added a commit
to clebergnu/avocado
that referenced
this issue
Aug 22, 2024
This change allows for the a runnable configuration and the suite and default configuration to coexist with the correct behavior. In short, if the suite has a configuration, it will become the new default configuration for a runnable, while its own configuration will not be touched. Because the purpose of the default_config and config are different, the checks for the values they may contain are different. The default_config should contain the exact keys as in the used config. The config itself, on the other hand, may contain nothing, or some values, but it should never be more than a subset of the config. Note: there's an opportunity here for changing the data structure used for the "config" attribute, one that looks up the value in the "default_config" if it doesn't exist in the actual "config". But, given that the size of the "default_config" will always be very small (given that it's filtered to contain only the used configuration by the runner) it seemed an unnecessary optimization at this time. Fixes: avocado-framework#5998 Signed-off-by: Cleber Rosa <[email protected]>
clebergnu
added a commit
to clebergnu/avocado
that referenced
this issue
Aug 22, 2024
This change allows for the a runnable configuration and the suite and default configuration to coexist with the correct behavior. In short, if the suite has a configuration, it will become the new default configuration for a runnable, while its own configuration will not be touched. Because the purpose of the default_config and config are different, the checks for the values they may contain are different. The default_config should contain the exact keys as in the used config. The config itself, on the other hand, may contain nothing, or some values, but it should never be more than a subset of the config. Note: there's an opportunity here for changing the data structure used for the "config" attribute, one that looks up the value in the "default_config" if it doesn't exist in the actual "config". But, given that the size of the "default_config" will always be very small (given that it's filtered to contain only the used configuration by the runner) it seemed an unnecessary optimization at this time. Fixes: avocado-framework#5998 Signed-off-by: Cleber Rosa <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Currently, as a convenience, a
Runnable
instantiated without aconfig
, is given a configuration that matches its kind. Example:Also currently, the suite will overwrite a runnable's config with its own.
The problem with this approach is that when a
Runnable
is used in a Suite with its own configuration, it's not possible to distinguish what was originally an empty configuration (that was turned into the default one).Steps to reproduce
Create a
noop_config.json
file such as:Run:
avocado run noop_config.json
Expected behavior
The precedence of configuration should be:
For the command above:
Current behavior
Currently, the suite will overwrite a runnable's config with its own.
For the command above:
System information (please complete the following information):
LSB Version: :core-5.0-amd64:core-5.0-noarch:cxx-5.0-amd64:cxx-5.0-noarch:desktop-5.0-amd64:desktop-5.0-noarch:languages-5.0-amd64:languages-5.0-noarch:printing-5.0-amd64:printing-5.0-noarch Distributor ID: Fedora Description: Fedora release 40 (Forty) Release: 40 Codename: Forty
The text was updated successfully, but these errors were encountered: