Skip to content

Commit

Permalink
remove duplicated test
Browse files Browse the repository at this point in the history
  • Loading branch information
mfleader committed Oct 27, 2023
1 parent 0ed414e commit c09b7ba
Showing 1 changed file with 0 additions and 63 deletions.
63 changes: 0 additions & 63 deletions internal/step/plugin/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,69 +325,6 @@ func TestProvider_VerifyCancelSignal(t *testing.T) {
}
}

func TestProvider_DeployFail(t *testing.T) {
logConfig := log.Config{
Level: log.LevelError,
Destination: log.DestinationStdout,
}
logger := log.New(
log.Config{
Level: log.LevelError,
Destination: log.DestinationStdout,
},
)
workflowDeployerCfg := map[string]any{
"image": map[string]any{"type": "test-impl"},
}

deployerRegistry := deployer_registry.New(
deployer.Any(testdeployer.NewFactory()))

plp, err := plugin.New(
logger,
deployerRegistry,
workflowDeployerCfg,
)
assert.NoError(t, err)

stepSchema := map[string]any{
"plugin": map[string]string{
"src": "simulation",
"type": "image"},
}
byteSchema := map[string][]byte{}

runnable, err := plp.LoadSchema(stepSchema, byteSchema)
assert.NoError(t, err)
assert.NotNil(t, runnable)

waitLifecycle, err := runnable.Lifecycle(map[string]any{"step": "wait"})
assert.NoError(t, err)
// Verify that the expected lifecycle stage is there, then verify that cancel is disabled.
waitCancelledStageIDIndex := assert.SliceContainsExtractor(t,
func(schema step.LifecycleStageWithSchema) string {
return schema.ID
}, string(plugin.StageIDCancelled), waitLifecycle.Stages)
waitStageIDCancelled := waitLifecycle.Stages[waitCancelledStageIDIndex]
waitStopIfSchema := assert.MapContainsKey(t, "stop_if", waitStageIDCancelled.InputSchema)
if waitStopIfSchema.Disabled {
t.Fatalf("step wait's wait_for schema is disabled when the cancel signal is present.")
}

helloLifecycle, err := runnable.Lifecycle(map[string]any{"step": "hello"})
assert.NoError(t, err)
// Verify that the expected lifecycle stage is there, then verify that cancel is disabled.
helloCancelledStageIDIndex := assert.SliceContainsExtractor(t,
func(schema step.LifecycleStageWithSchema) string {
return schema.ID
}, string(plugin.StageIDCancelled), helloLifecycle.Stages)
helloStageIDCancelled := helloLifecycle.Stages[helloCancelledStageIDIndex]
helloStopIfSchema := assert.MapContainsKey(t, "stop_if", helloStageIDCancelled.InputSchema)
if !helloStopIfSchema.Disabled {
t.Fatalf("step hello's stop_if schema is not disabled when the cancel signal is not present.")
}
}

func TestProvider_DeployFail(t *testing.T) {
logConfig := log.Config{
Level: log.LevelError,
Expand Down

0 comments on commit c09b7ba

Please sign in to comment.