From d95d9ad083e4a06d36e2c92669ca8fc133d1cb90 Mon Sep 17 00:00:00 2001 From: Matthew F Leader Date: Mon, 20 Nov 2023 16:52:41 -0500 Subject: [PATCH] remove redundant tests --- internal/step/plugin/provider_test.go | 72 --------------------------- 1 file changed, 72 deletions(-) diff --git a/internal/step/plugin/provider_test.go b/internal/step/plugin/provider_test.go index 97669f4d..d5677085 100644 --- a/internal/step/plugin/provider_test.go +++ b/internal/step/plugin/provider_test.go @@ -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" @@ -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{ @@ -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{