[ODLPARENT-13] Increase SingleFeatureTest coverage to insure all dependencies in pom.xml file Created: 12/Mar/15  Updated: 24/Jan/18  Resolved: 03/Sep/15

Status: Resolved
Project: odlparent
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Ed Warnicke Assignee: Robert Varga
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
blocks ODLPARENT-14 SingleFeatureTest#installFeature hang... Resolved
External issue ID: 2826

 Description   

SingleFeatureTests currently can give false positives if:

a) Your feature depends on a bundle that is built in your local repo
b) Your features/pom.xml does not contain a dependency for that bundle.

Example:

example/foo/pom.xml
example/features/pom.xml
example/features/src/main/features/features.xml

If your features.xml contains a feature:

<feature bar>
<bundle>foo</bundle>
</features>

and you don't have a dependency for foo in features/pom.xml, then if you build
example/ (as happens on merge and verify) then SingleFeatureTests will succeed, because karaf will be able to find the foo bundle in ~/.m2 because you built it, but downstream projects (like integration) will not get foo pulled into their ~/.m2 and will fail.

We need to think up a way to also catch this case.



 Comments   
Comment by Robert Varga [ 31/Aug/15 ]

This actually should not be tested by the test, but rather be part of the feature's build time – and it actually is. How it works is the following:

That bundle declaration needs to contain a version declaration. While you can hard-code one, that really is not the right way to do it, you should use a VERSION placeholder.

features-parent will notice that placeholder and will reference to the project's dependencies, checking that the specified bundle/feature/configfile is declared, erroring out if it isn't – see how https://git.opendaylight.org/gerrit/#/c/23524/4 failed to build due to features-bmp not having a dependency on features-bgp.

So the correct way to fix this is to convert features to use features-parent and VERSION placeholders.

Comment by Vratko Polak [ 03/Sep/15 ]

>> We need to think up a way to also catch this case.

> So the correct way to fix this is to convert features to use features-parent and VERSION placeholders.

So, is there a new bug opened (instead of this wontfix one) requesting to automatically catch a case where a project fails to use features-parent and VERSION everywhere?

Generated at Wed Feb 07 20:27:22 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.