spread icon indicating copy to clipboard operation
spread copied to clipboard

Feature Request: add common snippet to task.yaml that is run before the prepare, execute, and restore sections

Open anonymouse64 opened this issue 5 years ago • 0 comments

Oftentimes we have code like this in our task.yamls:

prepare: |
    #shellcheck source=tests/lib/nested.sh
    . "$TESTSLIB/nested.sh"
    prepare_something_from_nested.sh

restore: |
    #shellcheck source=tests/lib/nested.sh
    . "$TESTSLIB/nested.sh"
    restore_something_from_nested.sh

execute: |
    #shellcheck source=tests/lib/nested.sh
    . "$TESTSLIB/nested.sh"
    execute_something_from_nested.sh

it would be nice if we could somehow simplify this with just

common: |
    #shellcheck source=tests/lib/nested.sh
    . "$TESTSLIB/nested.sh"

prepare: |
    prepare_something_from_nested.sh

restore: |
    restore_something_from_nested.sh

execute: |
    execute_something_from_nested.sh

this would reduce a lot of duplication we have in our spread task.yaml's in snapd.

anonymouse64 avatar Jul 28 '20 10:07 anonymouse64