chore: Make com.microsoft.copilot.eclipse.ui.test a fragment bundle of com.microsoft.copilot.eclipse.ui bundle#361
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the com.microsoft.copilot.eclipse.ui.test bundle to be an OSGi fragment of the com.microsoft.copilot.eclipse.ui host bundle, enabling UI tests to access package-private implementation without widening production API visibility and reducing redundant test-bundle dependencies.
Changes:
- Converted
com.microsoft.copilot.eclipse.ui.testinto a fragment bundle viaFragment-Hostand simplified its bundle dependencies. - Introduced
fragment.xmlto contribute test-specific Eclipse extensions (marker + editor registration). - Updated build packaging to include
fragment.xmlinstead ofplugin.xml.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| com.microsoft.copilot.eclipse.ui.test/META-INF/MANIFEST.MF | Declares the test bundle as a fragment of com.microsoft.copilot.eclipse.ui and trims redundant dependencies. |
| com.microsoft.copilot.eclipse.ui.test/fragment.xml | Adds fragment-level extension contributions needed by integration tests (marker + editor). |
| com.microsoft.copilot.eclipse.ui.test/build.properties | Packages fragment.xml in the built test fragment. |
e77f558 to
b741ed2
Compare
|
Potential regression in Equinox qualifies a simple However, That old marker ID is no longer registered. Could we either update the test constant to the host-qualified ID, or fully qualify the extension ID to preserve the old namespace? It would also be useful for the test to assert that the intended marker contribution is registered before checking its annotation mapping. I checked the other fragment contributions and ID references in this repository. This is the only analogous occurrence: |
|
Thank you for this hint @jdneo, ...
// assert our marker type is properly registered
assertTrue(isMarkerTypeDeclared(FOREIGN_TEXT_MARKER));
...
private boolean isMarkerTypeDeclared(String markerTypeId) {
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(ResourcesPlugin.PI_RESOURCES, "markers");
for (IExtension ext : point.getExtensions()) {
if (markerTypeId.equals(ext.getUniqueIdentifier())) {
return true;
}
}
return false;
}This way, the test would fail with the ID |
This way, tests in com.microsoft.copilot.eclipse.ui.test can access package-private methods and we don't need to make them public. In addition, we no longer need to maintain redundant plug-in dependencies in the test bundle.
Incorporate feedback from review commit microsoft#361 (comment)
b741ed2 to
d6f3dfd
Compare
Make
com.microsoft.copilot.eclipse.ui.testa fragment bundle ofcom.microsoft.copilot.eclipse.uibundle. This way, tests incom.microsoft.copilot.eclipse.ui.testcan access package-private methods incom.microsoft.copilot.eclipse.uibundle and we don't need to make them public. In addition, we no longer need to maintain redundant plug-in dependencies in the test bundle.This is similar to the
com.microsoft.copilot.eclipse.core.testbundle being a fragment bundle withcom.microsoft.copilot.eclipse.coreas the host bundle.The PR #330 would benefit from changes in this PR, we could make some methods package-private that are public today in order to be accessible from tests n the test bundles. Improvement suggestion from PR #330: