Skip to content

Only test implementations from the plugin's own jar when asked - #1

Merged
mbastian merged 1 commit into
masterfrom
plugin-lookup-filter
Nov 7, 2026
Merged

mbastian merged 1 commit into
masterfrom
plugin-lookup-filter

Conversation

@mbastian

@mbastian mbastian commented Nov 7, 2026

Copy link
Copy Markdown
Member

Summary

The contract tests find the implementations they test with Lookup.getDefault().lookupAll(...). When gephi-plugins' CI harness runs them against a plugin, Lookup also returns everything the plugin's dependencies register. A plugin that depends on core layout-plugin (CircularLayout, ForceAtlas3D, GraphvizLayout, …) or on statistics-plugin (LinkPrediction, PrestigePlugin, …) gets every core implementation tested under its name. That makes the run slower, and a core regression or a stricter test then fails that plugin's PR check.

  • Adds PluginLookup.lookupAll(Class). When the gephi.plugins.tests.jar system property is set to a jar file name, it returns only the implementations whose class was loaded from that jar, using the class's CodeSource. When the property isn't set, it returns every registered implementation, as before. That keeps this repo's own self-test, which runs against layout-plugin from the test classpath, unchanged.
  • LayoutContractTest uses it. New contract tests (e.g. statistics) should use it the same way.
  • gephi-plugins' harness (Run gephi-plugins-tests SPI contract tests in CI gephi-plugins#354) already sets the property to ${plugin.artifactId}-${plugin.version}.jar. Version 1.0.0 ignores it, so filtering takes effect once the harness moves to a release that includes this change.

Testing

  • mvn test without the property: 78 cases, same as before.
  • -Dgephi.plugins.tests.jar=layout-plugin-0.11.4.jar: 78 cases, since every core layout lives in that jar.
  • -Dgephi.plugins.tests.jar=nope.jar: 0 cases.
  • Through gephi-plugins' harness with this build installed locally: CircularLayout went from 96 cases (its 3 layouts plus 13 core ones) to 18 (only its own). GeoLayout and HairballBuster are unchanged at 6, and plugins with no layout run 0 cases.

Merging to master triggers release.yml. The version is still 1.0.1-SNAPSHOT, so that only attempts a snapshot deploy, which currently fails with HTTP 401 until SNAPSHOT publishing is enabled for the org.gephi namespace. Cutting 1.1.0 is a separate version commit.

🤖 Generated with Claude Code

PluginLookup.lookupAll() narrows Lookup results to implementations loaded from the jar named by the gephi.plugins.tests.jar system property, which gephi-plugins' CI harness sets to the plugin under test. Otherwise implementations from the plugin's dependencies (e.g. core layout-plugin or statistics-plugin) were tested and their failures reported against the plugin. Without the property, every registered implementation is tested as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant