[Avocado-devel] Multiplexer design recent discussions summary

Paolo Bonzini pbonzini at redhat.com
Wed Nov 25 16:42:50 UTC 2015



On 25/11/2015 17:34, Lukáš Doktor wrote:
> Dne 25.11.2015 v 17:15 Paolo Bonzini napsal(a):
>>
>>
>> On 25/11/2015 16:39, Lukáš Doktor wrote:
>>>
>>>      --mux-mux $path[:true|false] -- to set the node as mux/nomux
>>>      --mux-inject [$path:]key:value -- to set value (and create the
>>> node)
>>>      --mux-cut $path -- remove any node (opposite of --mux-inject)
>>
>> --mux-remove?
> that's better :D

>>>      --mux-keep $path -- mux-cut siblings
>>
>> What's the usecase?
> The same as filter-out vs. filter-only. Just convenience method to say
> this is the only node that should stay in the tree (eg. when you combine
> multiple yaml files and you don't know what other sibblings are there)

But what is it used for?  For mux nodes there are clear usecases.  I
would like to see a real world example for keep and remove.

However, remove is the fundamental primitive for all of
remove/keep/out/only, so I'm good with having it.  keep, not so much.

>>>      --mux-skip $path -- remove variants containing this path
>>>      --mux-only $path -- mux-out siblings
>>>
>>> yaml:
>>>
>>>      !mux -- set the node as multiplexed
>>>      !skip : $path -- ignore variants with this $path
>>>      !only : $path -- !skip siblings

!skip is more consistent with the command line.

> I really don't. Would you please show me an example where you have
> multiplex file and on a local scale (only for certain variant) you want
> to remove some nodes, which are not direct children of mux node? So
> something like:
> 
> ```
>     !mux
>     machine: !mux
>         x86_64:
>         aarch64:
>             !remove : /os/fedora/variants
>     os: !mux
>         fedora:
>             variants: !mux
>                 workstation:
>                 server:
>             releases: !mux
>                 21:
>                 22:
>         gentoo:
> ```
> 
> The difference is that in this case you'll get values of
> `/os/fedora/releases`, but you won't get values from
> `/os/fedora/variants`. This just does not make sense to me, instead I'd
> use `!skip` which would result in no fedora variants on `aarch64`, or
> `!only : fedora/variants/server` to have only one variant of the fedora.
> But having fedora, without values from `variants` would be confusing to me.

I think if it makes sense to use it on the command line, it makes sense
to have it in the config file.  I'd rarely use patching on the command
line for example.  If tests can take a long time, but I occasionally
want to change some details, I prefer to modify an on-disk file so that
I know exactly what was the last thing I've run.

Paolo

> As I said before, in most cases there is no difference between `!skip`
> and `!remove`. But so far I haven't found any example where `!remove`
> would produce better results, than `!skip` (I'm not talking about global
> scale and --mux-remove, it's useful for on-cmdline-patching) so I don't
> think we need to implement this tag for internal filters.




More information about the Avocado-devel mailing list