Add ability to create includes in pxu files

Bug #1569540 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PlainBox (Toolkit)
Fix Released
Medium
Sylvain Pineau

Bug Description

Use case:

I have 15 test lists in a provider. Everyone has some identical sections, such as mandatory_include and bootstrap_include.

I need to add a new test case to mandatory_include.

Currently, this means I need to edit 15 different files just to add a single line of text to call the new job I created.

It would be MUCH nicer if I could do the following:

Have a test list that has a mandatory_include section that lists all the items that should fall under there.
It is HERE I would add my new job name.

Have every other test list with something like:
include: mandatory_includes.pxu

and then they would contain OTHER jobs that are different between lists.

THEN at run time, checkbox-ng would read the my_test_list.pxu file, see the "include:" directive and then aggregate the two lists so that now I have a test list that includes the mandatory_include section from my mandatory_include.pxu file and the other items from my my_test_list.pxu file.

There are issues to be resolved here...
The biggest one initially is precedence: what if I have mandatory_include in testlist.pxu AND in mandatory_include.pxu.
Also duplicate filtering, and probably others I'm overlooking right now.

BUT at least initially, this could be implemented with the caveat that it's on the test developer to not have two mandatory_include sections.

Also, it could be further broken down, perhaps like this:

mandatory_include:
include: attachment_list
info/job1
info/job2
include:
include: arm_test_list
generic/test1
generic/test2

Note that is a pie in the sky thing.

Related branches

Jeff Lane  (bladernr)
affects: plainbox-provider-checkbox → checkbox-ng
Revision history for this message
Jeff Lane  (bladernr) wrote :

Also, I only used mandatory include as an arbitrary example. it could also be something lke this:

network_tests.pxu = network tests.
mandatory.pxu = mandatory tests.
storage.pxu = storage tests.

Then I could have something like this:

functional.pxu
include: mandatory.pxu, storage.pxu, network_tests.pxu
include:
info/a
info/b
miscellanea/c

and full.pxu
include: mandatory.pxu, storage.pxu, network_tests.pxu, stress.pxu

Revision history for this message
Jeff Lane  (bladernr) wrote :

Also, yes, I realized I just inadvertantly overloaded include:

So maybe a better option would be to call it a file: directive like this:

mandatory_include:
file:mandatory-jobs.pxu

include:
file:network.pxu
file:storage.pxu
file:stress.pxu

Changed in checkbox-ng:
status: New → In Progress
assignee: nobody → Sylvain Pineau (sylvain-pineau)
importance: Undecided → Medium
affects: checkbox-ng → plainbox
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

We have a VERY similar need for certification and snappy where reusability of testplan sections becomes critical and we also would like to reduce maintenance costs and error prone copy/pastes.

I'm working on a new feature for nested testplans, example:

unit: test plan
id: foo
_name: bar
_description:
 baz
estimated_duration: 10m
include:
    foo/.*
nested_part:
    2013.com.canonical.certification::toto
    2016.com.canonical.certification::bibi
bootstrap_include:
    titi
certification_status_overrides:
    apply blocker to 2013.com.canonical.certification::zozo/false

Loading nested parts will load the include, mandatory_include and bootstrap_include sections and all overrides (category, certification status).

The testplan order will then be testplan "include" + all nested testplan "include" in the same order they are defined in "nested_part"

Changed in plainbox:
milestone: none → 0.29
status: In Progress → Fix Committed
Pierre Equoy (pieq)
Changed in plainbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.