OAK-10367: update org.apache.sling.testing.osgi-mock dependency#1044
OAK-10367: update org.apache.sling.testing.osgi-mock dependency#1044reschke merged 3 commits intoapache:trunkfrom
Conversation
oak-auth-external/pom.xml
Outdated
| <artifactId>org.osgi.service.component</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> |
There was a problem hiding this comment.
which code changes requires this new compile classpath change?
There was a problem hiding this comment.
No code changes, these were listed as used undeclared dependencies by the dependency plugin.
oak-auth-external/pom.xml
Outdated
| <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> |
There was a problem hiding this comment.
junit4 depends on core, therefore you only reference the former in the dependency usually in this case (https://sling.apache.org/documentation/development/osgi-mock.html#maven-dependency)
There was a problem hiding this comment.
Again a used undeclared dependency, which I usually declare explicitly as generally recommended. In this particular case, it's admittedly unnecessary.
| <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> |
There was a problem hiding this comment.
Why all the additional dependencies? Isn't the transitive dependencies from osgi-mock enough?
It is unusual to reference OSGi Spec chapter dependencies only in test classpath. In tests those are only used usually if the to-be tested code relies on those spec chapters as well.
There was a problem hiding this comment.
The integration tests will fail without them.
There was a problem hiding this comment.
but all those are transitive ones of https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/blob/45fb63cb61615663e10ed3c9e612a3a3f6161c3e/core/pom.xml#L42 and the ITs don't leverage those APIs/spec chapter directly (only the Sling Testing Mock uses them).
There was a problem hiding this comment.
Yeah. But the tests will fail anyway. Do you have a suggestion?
Maven dependency analysis does not see reflective use.
|
I am not convinced, that we should make all those dependencies direct ones. Please only make those direct dependencies which are really used in Oak code and also please do that dependency cleanup in a separate commit to ease to distinguish it from the actual update of the testing dependency. |
If the dependency plugin lists them as used and undeclared, they are (in most cases) used in the project code, no?
Agreed. |
| properties.put(SegmentNodeStoreService.REPOSITORY_HOME_DIRECTORY, repoHome); | ||
| service = context.registerInjectActivateService(new SegmentNodeStoreService(), properties); | ||
| SegmentNodeStoreService service = new SegmentNodeStoreService(); | ||
|
|
There was a problem hiding this comment.
@kwin Would you take a look at the following lines? I wonder if MockBundleContext introduced a bug in the new version or if I'm missing something.
Reverted changes that are not related to o.a.sling.testing.osgi-mock. Removed redundant explicit declaration of transitive dependencies of o.a.sling.testing.osgi-mock.junit4.
|
I'm getting test failures: |
|
Yes, my Docker isn't working properly, which leads to test cases silently being skipped (obviously an issue of it's own). I'm working on it. |
Added missing test dependencies.
|
Integration test now succeed for me. |
* OAK-10367: update org.apache.sling.testing.osgi-mock dependency * OAK-10367: update org.apache.sling.testing.osgi-mock dependency Reverted changes that are not related to o.a.sling.testing.osgi-mock. Removed redundant explicit declaration of transitive dependencies of o.a.sling.testing.osgi-mock.junit4. * OAK-10367: update org.apache.sling.testing.osgi-mock dependency Added missing test dependencies. --------- Co-authored-by: Manfred Baedke <gre55877@adobe.com>
No description provided.