Repository navigation
Description
Goal and boundary
Provide a reusable test-scope plugin contract kit that an out-of-tree Java plugin can consume to verify its reactive behavior against ShenYu's existing LEGACY executor. Extract and organize existing regression tests and real runtime fixtures rather than creating another mock chain or changing ShenyuPlugin semantics.
This task owns the reusable fixture/package, role-aware assertions, example consumer and contribution guide. #7294 remains the owner of plugin-store build/release infrastructure, published API/BOM compatibility matrices and cross-repository E2E workflows; #7306 remains the migration tracker. This is not another SDK/release program and does not depend on implementing graph execution.
Verified starting point
Reviewed master 750673e3f619e335333150ff1b2d14070d5d5c31:
- ShenyuPlugin exposes
Mono<Void>execution, skip and ordering. Its before/after documentation explicitly retains publisher-construction timing;afteris not an asynchronous completion callback. - ShenyuPluginChain.fork() is optional isolated internal dispatch. The real legacy implementation owns the mutable cursor, independent fork and deferred invocation. A test fixture must exercise this path, not silently substitute different continuation semantics.
- Existing coverage includes per-subscription runtime regression tests, loader/classloader tests under
shenyu-web, starter auto-configuration tests, and a real uploaded-plugin smoke test. The custom fixture POM currently inherits the main reactor version. - The graph compatibility audit is an existing design artifact. Its wrapper/terminal/transform dimensions are useful test vocabulary, but the graph runtime and parity work remain owned by [Task] Separate legacy and graph execution paths with an explicit dispatcher #7996/[Task] Validate plugin orchestration end to end and document rollout #8001.
The gap is independently consumable, common behavioral evidence for a plugin author; it is not a claim that plugins currently have no tests.
First delivery
- Package existing useful fixtures and assertions. Add a focused test-support artifact, a documented supported dependency surface and a minimal out-of-tree example. It must not add runtime dependencies to plugins or require their production artifacts to depend on test infrastructure. Reuse the actual legacy runtime where chain integration is tested.
- Make tests role-aware. Provide a common lifecycle/diagnostic layer and opt-in profiles for pass-through/transform plugins, short-circuit or response-owner plugins, downstream wrappers, and
AbstractShenyuPluginselector/rule matching. Internal-dispatch/fork tests apply only where that capability is used. A wrapper that legitimately decorates or resubscribes downstream must not fail a blanket “continuation exactly once” assertion. - Cover observable reactive contracts. Exercise side effects at the actual handler/root subscription boundary, completion/error/cancellation propagation, skip and rule misses, response ownership/decorators, wrapper nesting and resource release hooks. Keep the current construction-time
before/afterbehavior. Do not forbid all side effects during a directexecute()call: the real handler defers invocation to root subscription, and the kit must test that documented boundary rather than invent a new assembly-purity rule. Add configuration update/remove fixtures for plugins that declare a data handler; resources/leases are tested only against contracts that actually exist. - Explain what each check proves. Record test-kit version, core revision/version, selected profiles and skipped/unsupported capabilities. Keep protocol/SDK-specific correctness and real external-system E2E in the owning plugin repository. Future GRAPH parity can reuse fixtures, but must not change LEGACY expectations in this task.
Acceptance criteria
- An example outside the main source reactor builds and runs the packaged test support against its declared core/API dependencies. A producer packaging step plus a fixed staging repository is acceptable for development verification; a local reactor shortcut is not the only evidence.
- At least two distinct existing roles are demonstrated: a transformation plugin and a downstream wrapper/short-circuit fixture. Their expected downstream invocation patterns are explicit, rather than guessed from numeric order.
- Tests detect representative bad fixtures: effects before the root handler publisher is subscribed, lost cancellation/cleanup, unexpected duplicate side effects for a declared role, broken decorator propagation and stale state after an explicitly supported configuration removal.
- Tests use controlled signals/time and avoid sleeps, nondeterministic traffic percentages or coverage-count targets. Failure output names the plugin, contract/profile and expected signal or state.
- Real runtime integration covers skip/miss, normal completion, failure, cancellation, repeated subscriptions and optional isolated fork behavior without copying the legacy cursor implementation into the test package.
- Ordinary unit-contract runs need no Docker or shared credentials. One opt-in real-gateway smoke/example reuses the existing integration-test machinery; [Task] Establish the shenyu-plugin-store build, test, E2E, and release baseline #7294 consumes it for store CI rather than this task replacing that workflow.
- Contribution documentation explains role selection, legacy limitations, descriptor-free plugin compatibility and how a third-party repository adds the kit. No mandatory new plugin interface,
cache()insertion or execution-path change is introduced.
Coordination
- [Task] Establish the shenyu-plugin-store build, test, E2E, and release baseline #7294 / [Task] Track the phased migration of optional integrations to shenyu-plugin-store #7306: build, compatibility, publication and migration ownership are unchanged.
- [Task] Define plugin graph contracts and audit compatibility #7994 / [Task][Plugin Graph] Define continuation invocation and resubscription semantics precisely #8015: reuse the continuation audit and record unresolved semantic boundaries; do not treat graph design as an implemented executor or silently normalize legacy behavior.
- [Task] Separate legacy and graph execution paths with an explicit dispatcher #7996 / [Task] Validate plugin orchestration end to end and document rollout #8001: future graph/legacy parity consumers.
- [Feature] Define configuration-instance lifecycle and shared SDK resource leases #8061 / [Feature] Define typed shared extension contracts for transport, credentials and resource providers #8063: add provider/resource profiles only when their concrete contracts exist; no new lease or provider framework here.
- Coordinate with the plugin-system configuration-contract and capability-descriptor tasks. The initial kit can select profiles explicitly and must not wait for descriptors to become mandatory.
Tracking
Plugin-system tracker: #8199.
Activity
test(web): add legacy plugin contract fixture (#8317)
test(web): complete externally consumable plugin contract kit (#8370)