Skip to main content

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, and asserting the outputs or failures against expected values. This function simulates a complete plugin execution flow within a test environment.

Parameters

NameTypeDescription
t*testing.TThe testing context provided by the Go testing framework, used for reporting test failures and assertions.
executorpluginCore.PluginThe plugin implementation to be tested, which will handle the task execution logic.
template*idlCore.TaskTemplateThe task template defining the structure and configuration of the task to be executed by the plugin.
inputs*idlCore.LiteralMapThe literal map representing the input data provided to the plugin for execution.
expectedOutputs*idlCore.LiteralMapThe expected literal map of outputs if the plugin execution is successful. If provided, the function asserts that the actual outputs match these.
expectedFailure*idlCore.ExecutionErrorThe expected execution error if the plugin execution is expected to fail. If provided, the function asserts that the actual error matches this.
iterationUpdatefunc(ctx context.Context, tCtx pluginCore.TaskExecutionContext) errorAn optional callback function that is executed after each iteration of the plugin's Handle method, allowing for custom assertions or state modifications during the test.

Returns

TypeDescription
pluginCore.PhaseInfoThe final phase information of the plugin execution, indicating success, failure, or other terminal states.