RunPluginEndToEndTest
No overview available.
def RunPluginEndToEndTest(
t: *testing.T,
executor: pluginCore.Plugin,
template: *idlCore.TaskTemplate,
inputs: *idlCore.LiteralMap,
expectedOutputs: *idlCore.LiteralMap,
expectedFailure: *idlCore.ExecutionError,
iterationUpdate: func(ctx context.Context, tCtx pluginCore.TaskExecutionContext) error
) - > pluginCore.PhaseInfo
Executes a plugin end-to-end test by setting up a mocked task execution context, running the provided plugin's handler, and asserting the outputs or failures against expected values. This function is used to simulate a plugin's execution flow in an isolated testing environment.
Parameters
| Name | Type | Description |
|---|---|---|
| t | *testing.T | The testing context provided by the Go testing framework, used for assertions and reporting test failures. |
| executor | pluginCore.Plugin | The plugin instance to be tested, which will have its Handle method invoked during the test. |
| template | *idlCore.TaskTemplate | The task template defining the structure and configuration of the task being executed by the plugin. |
| inputs | *idlCore.LiteralMap | The literal map representing the input data provided to the plugin for execution. |
| expectedOutputs | *idlCore.LiteralMap | The expected literal map of outputs if the plugin execution is successful. If provided, the test asserts that the actual outputs match these. |
| expectedFailure | *idlCore.ExecutionError | The expected execution error if the plugin execution is expected to fail. If provided, the test asserts that the actual error matches this. |
| iterationUpdate | func(ctx context.Context, tCtx pluginCore.TaskExecutionContext) error | An optional callback function that is executed after each iteration of the plugin's Handle method, allowing for custom logic or assertions during the execution loop. |
Returns
| Type | Description |
|---|---|
pluginCore.PhaseInfo | The final phase information of the plugin execution, indicating success, failure, or other terminal states. |