hansva opened a new issue, #9563: URL: https://github.com/apache/hop/issues/9563
### What needs to happen? Four extension points in the Reflection and Testing plugins assume the pipeline runs on Hop's own engine, without checking: | Plugin | Extension point class | Fired on | Assumption | |---|---|---|---| | Reflection | `PipelineStartLoggingXp` | `PipelinePrepareExecution` | Declared as `IExtensionPoint<Pipeline>`: any other engine object would fail with a `ClassCastException` | | Reflection | `PipelineDataProbeXp` | `PipelineStartThreads` | Same | | Testing | `ValidatePipelineUnitTestExtensionPoint` | `PipelineFinish` | Validates golden data sets against rows collected by row listeners on the local engine's transforms | | Testing | `WriteToDataSetExtensionPoint` | `PipelineStartThreads` | Adds row listeners to the local engine's transforms | `PipelineFinish` is also fired by the Beam and remote engines. When a pipeline runs there with the unit-test flag set (`__UnitTest_Run__=Y`), for example inherited from a parent through variables, the validation compares the golden data with rows that were never collected and reports failures like "Incorrect number of rows received from transform ... we received 0". Hop GUI avoids this by switching the flag off for non-local run configurations (`HopGuiFlagPipelineForUnitTestExtensionPoint`), and the other unit-test listeners already check for the local engine themselves (`InjectDataSetIntoTransformExtensionPoint`, `ChangePipelineMetaPriorToExecutionExtensionPoint`). These four don't, so the protection depends on how the pipeline was started. The two Reflection listeners only work today because no other engine fires `PipelinePrepareExecution` or `PipelineStartThreads`. Any engine that does would fail before the pipeline starts. ### Expected Each of these listeners does nothing on an engine it can't work with, the same way the other unit-test listeners already do. Pipelines on the local engine behave exactly as before. ### Proposed fix - `PipelineStartLoggingXp`, `PipelineDataProbeXp`: implement `IExtensionPoint<IPipelineEngine<PipelineMeta>>` and return when the engine isn't a `Pipeline`. - `ValidatePipelineUnitTestExtensionPoint`, `WriteToDataSetExtensionPoint`: return when the pipeline isn't a `LocalPipelineEngine`, as `InjectDataSetIntoTransformExtensionPoint` does. ### Tests - Reflection: each extension point called with an engine that isn't a `Pipeline` returns without an error, and does its work with a local engine. - Testing: with the unit-test flag and a test name set, validation and write-to-data-set do nothing on a non-local engine, and still run on the local engine. ### Issue Priority Priority: 2 ### Issue Component Component: API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
