Skip to content

Commit

Permalink
remove redundant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mfleader committed Nov 20, 2023
1 parent 9255c19 commit d95d9ad
Showing 1 changed file with 0 additions and 72 deletions.
72 changes: 0 additions & 72 deletions internal/step/plugin/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"go.arcalot.io/log/v2"
"go.flow.arcalot.io/deployer"
deployer_registry "go.flow.arcalot.io/deployer/registry"
docker "go.flow.arcalot.io/dockerdeployer"
"go.flow.arcalot.io/engine/internal/step"
"go.flow.arcalot.io/engine/internal/step/plugin"
testdeployer "go.flow.arcalot.io/testdeployer"
Expand Down Expand Up @@ -112,59 +111,6 @@ func (s *stageChangeHandler) OnStepComplete(
s.message <- message
}

func TestProvider_MultipleDeployers(t *testing.T) {
logger := log.New(
log.Config{
Level: log.LevelError,
Destination: log.DestinationStdout,
},
)
deployerRegistry := deployer_registry.New(
deployer.Any(testdeployer.NewFactory()),
deployer.Any(docker.NewFactory()))
deployTimeMs := 20
workflowDeployerCfg := map[string]any{
"builtin": map[string]any{
"deployer_name": "test-impl",
"deploy_time": deployTimeMs,
"deploy_succeed": true,
},
"image": map[string]any{
"deployer_name": "docker",
},
}

plp, err := plugin.New(logger, deployerRegistry, workflowDeployerCfg)
assert.NoError(t, err)
assert.Equals(t, plp.Kind(), "plugin")
assert.NotNil(t, plp.ProviderSchema())
assert.NotNil(t, plp.RunProperties())
assert.NotNil(t, plp.Lifecycle())

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

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

assert.NotNil(t, runnable.RunSchema())

_, err = runnable.Lifecycle(map[string]any{"step": "wait"})
assert.NoError(t, err)

_, err = runnable.Lifecycle(map[string]any{"step": "hello"})
assert.NoError(t, err)

// There is more than one step, so no specified one will cause an error.
_, err = runnable.Lifecycle(map[string]any{"step": nil})
assert.Error(t, err)
}

func TestProvider_MissingDeployer(t *testing.T) {
logger := log.New(
log.Config{
Expand All @@ -182,24 +128,6 @@ func TestProvider_MissingDeployer(t *testing.T) {
_, err := plugin.New(logger, deployerRegistry, workflowDeployerCfg)
assert.Error(t, err)
}
func TestProvider_MismatchedDeploymentTypes(t *testing.T) {
logger := log.New(
log.Config{
Level: log.LevelError,
Destination: log.DestinationStdout,
},
)
deployerRegistry := deployer_registry.New(deployer.Any(testdeployer.NewFactory()))
// Mismatched. test-impl is has the deployment type builtin, but we're trying to specify it for the image type.
workflowDeployerCfg := map[string]any{
"image": map[string]any{
"deployer_name": "test-impl",
},
}

_, err := plugin.New(logger, deployerRegistry, workflowDeployerCfg)
assert.Error(t, err)
}

func TestProvider_Utility(t *testing.T) {
workflowDeployerCfg := map[string]any{
Expand Down

0 comments on commit d95d9ad

Please sign in to comment.