diff --git a/pkg/commands/compute/deploy_test.go b/pkg/commands/compute/deploy_test.go index 50a3a2ce5..19f8c5717 100644 --- a/pkg/commands/compute/deploy_test.go +++ b/pkg/commands/compute/deploy_test.go @@ -198,9 +198,9 @@ func TestDeploy(t *testing.T) { args: args("compute deploy --service-id 123 --token 123 --version 1"), api: mock.API{ CloneVersionFn: testutil.CloneVersionError, + GetPackageFn: getPackageOk, GetServiceDetailsFn: getServiceDetailsWasm, ListVersionsFn: testutil.ListVersions, - GetPackageFn: getPackageOk, }, wantError: fmt.Sprintf("error cloning service version: %s", testutil.Err.Error()), }, @@ -209,11 +209,11 @@ func TestDeploy(t *testing.T) { args: args("compute deploy --service-id 123 --token 123"), api: mock.API{ CloneVersionFn: testutil.CloneVersionResult(4), + GetPackageFn: getPackageOk, GetServiceDetailsFn: getServiceDetailsWasm, GetServiceFn: getServiceOK, ListDomainsFn: listDomainsError, ListVersionsFn: testutil.ListVersions, - GetPackageFn: getPackageOk, }, wantError: fmt.Sprintf("error fetching service domains: %s", testutil.Err.Error()), }, @@ -277,8 +277,8 @@ func TestDeploy(t *testing.T) { args: args("compute deploy --token 123"), api: mock.API{ CreateServiceFn: createServiceErrorNoTrial, - GetCurrentUserFn: getCurrentUserError, DeleteServiceFn: deleteServiceOK, + GetCurrentUserFn: getCurrentUserError, }, stdin: []string{ "Y", // when prompted to create a new service @@ -295,8 +295,8 @@ func TestDeploy(t *testing.T) { args: args("compute deploy --token 123"), api: mock.API{ CreateServiceFn: createServiceErrorNoTrial, - GetCurrentUserFn: getCurrentUser, DeleteServiceFn: deleteServiceOK, + GetCurrentUserFn: getCurrentUser, }, httpClientRes: []*http.Response{ { @@ -324,8 +324,8 @@ func TestDeploy(t *testing.T) { args: args("compute deploy --token 123"), api: mock.API{ CreateServiceFn: createServiceErrorNoTrial, - GetCurrentUserFn: getCurrentUser, DeleteServiceFn: deleteServiceOK, + GetCurrentUserFn: getCurrentUser, }, httpClientRes: []*http.Response{ nil, @@ -430,11 +430,11 @@ func TestDeploy(t *testing.T) { name: "undo stack is executed", args: args("compute deploy --token 123"), api: mock.API{ - CreateServiceFn: createServiceOK, - ListDomainsFn: listDomainsNone, - CreateDomainFn: createDomainOK, CreateBackendFn: createBackendError, + CreateDomainFn: createDomainOK, + CreateServiceFn: createServiceOK, DeleteServiceFn: deleteServiceOK, + ListDomainsFn: listDomainsNone, }, stdin: []string{ "Y", // when prompted to create a new service @@ -455,8 +455,8 @@ func TestDeploy(t *testing.T) { ActivateVersionFn: activateVersionError, CloneVersionFn: testutil.CloneVersionResult(4), GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -480,8 +480,8 @@ func TestDeploy(t *testing.T) { api: mock.API{ CloneVersionFn: testutil.CloneVersionResult(4), GetPackageFn: getPackageIdentical, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, }, @@ -496,8 +496,8 @@ func TestDeploy(t *testing.T) { ActivateVersionFn: activateVersionOk, CloneVersionFn: testutil.CloneVersionResult(4), GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -528,8 +528,8 @@ func TestDeploy(t *testing.T) { api: mock.API{ ActivateVersionFn: activateVersionOk, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -564,8 +564,8 @@ func TestDeploy(t *testing.T) { api: mock.API{ ActivateVersionFn: activateVersionOk, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -598,8 +598,8 @@ func TestDeploy(t *testing.T) { api: mock.API{ ActivateVersionFn: activateVersionOk, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -627,8 +627,8 @@ func TestDeploy(t *testing.T) { ActivateVersionFn: activateVersionOk, CloneVersionFn: testutil.CloneVersionResult(4), GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -656,8 +656,8 @@ func TestDeploy(t *testing.T) { ActivateVersionFn: activateVersionOk, CloneVersionFn: testutil.CloneVersionResult(4), GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -685,8 +685,8 @@ func TestDeploy(t *testing.T) { ActivateVersionFn: activateVersionOk, CloneVersionFn: testutil.CloneVersionResult(4), GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1091,8 +1091,8 @@ func TestDeploy(t *testing.T) { CreateBackendFn: createBackendOK, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1128,8 +1128,8 @@ func TestDeploy(t *testing.T) { CloneVersionFn: testutil.CloneVersionResult(4), CreateBackendFn: createBackendOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1180,8 +1180,8 @@ func TestDeploy(t *testing.T) { CloneVersionFn: testutil.CloneVersionResult(4), CreateBackendFn: createBackendOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1232,16 +1232,16 @@ func TestDeploy(t *testing.T) { CreateBackendFn: createBackendOK, CreateConfigStoreFn: createConfigStoreOK, CreateConfigStoreItemFn: createConfigStoreItemOK, - CreateResourceFn: createResourceOK, CreateDomainFn: createDomainOK, + CreateResourceFn: createResourceOK, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, + ListConfigStoresFn: listConfigStoresEmpty, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, - ListConfigStoresFn: listConfigStoresEmpty, }, httpClientRes: []*http.Response{ { @@ -1293,17 +1293,17 @@ func TestDeploy(t *testing.T) { CreateBackendFn: createBackendOK, CreateConfigStoreFn: createConfigStoreOK, CreateConfigStoreItemFn: createConfigStoreItemOK, - CreateResourceFn: createResourceOK, CreateDomainFn: createDomainOK, + CreateResourceFn: createResourceOK, CreateServiceFn: createServiceOK, + GetConfigStoreFn: getConfigStoreOk, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, + ListConfigStoresFn: listConfigStoresOk, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, - ListConfigStoresFn: listConfigStoresOk, - GetConfigStoreFn: getConfigStoreOk, }, httpClientRes: []*http.Response{ { @@ -1356,16 +1356,16 @@ func TestDeploy(t *testing.T) { CreateBackendFn: createBackendOK, CreateConfigStoreFn: createConfigStoreOK, CreateConfigStoreItemFn: createConfigStoreItemOK, - CreateResourceFn: createResourceOK, CreateDomainFn: createDomainOK, + CreateResourceFn: createResourceOK, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, + ListConfigStoresFn: listConfigStoresEmpty, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, - ListConfigStoresFn: listConfigStoresEmpty, }, httpClientRes: []*http.Response{ { @@ -1411,16 +1411,16 @@ func TestDeploy(t *testing.T) { CreateBackendFn: createBackendOK, CreateConfigStoreFn: createConfigStoreOK, CreateConfigStoreItemFn: createConfigStoreItemOK, - CreateResourceFn: createResourceOK, CreateDomainFn: createDomainOK, + CreateResourceFn: createResourceOK, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, + ListConfigStoresFn: listConfigStoresEmpty, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, - ListConfigStoresFn: listConfigStoresEmpty, }, httpClientRes: []*http.Response{ { @@ -1473,8 +1473,8 @@ func TestDeploy(t *testing.T) { CloneVersionFn: testutil.CloneVersionResult(4), CreateBackendFn: createBackendOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1521,8 +1521,8 @@ func TestDeploy(t *testing.T) { CreateDomainFn: createDomainOK, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1570,8 +1570,8 @@ func TestDeploy(t *testing.T) { CreateDomainFn: createDomainOK, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1620,8 +1620,8 @@ func TestDeploy(t *testing.T) { CreateDomainFn: createDomainOK, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1667,8 +1667,8 @@ func TestDeploy(t *testing.T) { CloneVersionFn: testutil.CloneVersionResult(4), CreateBackendFn: createBackendOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1717,18 +1717,18 @@ func TestDeploy(t *testing.T) { api: mock.API{ ActivateVersionFn: activateVersionOk, CreateBackendFn: createBackendOK, - InsertKVStoreKeyFn: createKVStoreItemOK, - CreateResourceFn: createResourceOK, CreateDomainFn: createDomainOK, + CreateResourceFn: createResourceOK, CreateServiceFn: createServiceOK, + GetKVStoreFn: getKVStoreOk, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, + InsertKVStoreKeyFn: createKVStoreItemOK, ListDomainsFn: listDomainsOk, + ListKVStoresFn: listKVStoresOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, - ListKVStoresFn: listKVStoresOk, - GetKVStoreFn: getKVStoreOk, }, httpClientRes: []*http.Response{ { @@ -1779,18 +1779,18 @@ func TestDeploy(t *testing.T) { args: args("compute deploy --token 123"), api: mock.API{ CreateBackendFn: createBackendOK, + CreateDomainFn: createDomainOK, CreateKVStoreFn: createKVStoreOK, - InsertKVStoreKeyFn: createKVStoreItemOK, CreateResourceFn: createResourceOK, - CreateDomainFn: createDomainOK, CreateServiceFn: createServiceOK, + DeleteServiceFn: deleteServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, + InsertKVStoreKeyFn: createKVStoreItemOK, ListDomainsFn: listDomainsOk, - ListVersionsFn: testutil.ListVersions, - DeleteServiceFn: deleteServiceOK, ListKVStoresFn: listKVStoresEmpty, + ListVersionsFn: testutil.ListVersions, }, httpClientRes: []*http.Response{ { @@ -1828,18 +1828,18 @@ func TestDeploy(t *testing.T) { api: mock.API{ ActivateVersionFn: activateVersionOk, CreateBackendFn: createBackendOK, + CreateDomainFn: createDomainOK, CreateKVStoreFn: createKVStoreOK, - InsertKVStoreKeyFn: createKVStoreItemOK, CreateResourceFn: createResourceOK, - CreateDomainFn: createDomainOK, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, + InsertKVStoreKeyFn: createKVStoreItemOK, ListDomainsFn: listDomainsOk, + ListKVStoresFn: listKVStoresEmpty, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, - ListKVStoresFn: listKVStoresEmpty, }, httpClientRes: []*http.Response{ { @@ -1883,18 +1883,18 @@ func TestDeploy(t *testing.T) { api: mock.API{ ActivateVersionFn: activateVersionOk, CreateBackendFn: createBackendOK, + CreateDomainFn: createDomainOK, CreateKVStoreFn: createKVStoreOK, - InsertKVStoreKeyFn: createKVStoreItemOK, CreateResourceFn: createResourceOK, - CreateDomainFn: createDomainOK, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, + InsertKVStoreKeyFn: createKVStoreItemOK, ListDomainsFn: listDomainsOk, + ListKVStoresFn: listKVStoresEmpty, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, - ListKVStoresFn: listKVStoresEmpty, }, httpClientRes: []*http.Response{ { @@ -1948,8 +1948,8 @@ func TestDeploy(t *testing.T) { CloneVersionFn: testutil.CloneVersionResult(4), CreateBackendFn: createBackendOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, @@ -1996,18 +1996,18 @@ func TestDeploy(t *testing.T) { api: mock.API{ ActivateVersionFn: activateVersionOk, CreateBackendFn: createBackendOK, - CreateResourceFn: createResourceOK, CreateDomainFn: createDomainOK, + CreateResourceFn: createResourceOK, + CreateSecretFn: createSecretOk, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, + GetSecretStoreFn: getSecretStoreOk, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, + ListSecretStoresFn: listSecretStoresOk, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, - ListSecretStoresFn: listSecretStoresOk, - GetSecretStoreFn: getSecretStoreOk, - CreateSecretFn: createSecretOk, }, httpClientRes: []*http.Response{ { @@ -2062,18 +2062,18 @@ func TestDeploy(t *testing.T) { api: mock.API{ ActivateVersionFn: activateVersionOk, CreateBackendFn: createBackendOK, - CreateResourceFn: createResourceOK, CreateDomainFn: createDomainOK, + CreateResourceFn: createResourceOK, + CreateSecretFn: createSecretOk, + CreateSecretStoreFn: createSecretStoreOk, CreateServiceFn: createServiceOK, GetPackageFn: getPackageOk, - GetServiceFn: getServiceOK, GetServiceDetailsFn: getServiceDetailsWasm, + GetServiceFn: getServiceOK, ListDomainsFn: listDomainsOk, + ListSecretStoresFn: listSecretStoresEmpty, ListVersionsFn: testutil.ListVersions, UpdatePackageFn: updatePackageOk, - ListSecretStoresFn: listSecretStoresEmpty, - CreateSecretStoreFn: createSecretStoreOk, - CreateSecretFn: createSecretOk, }, httpClientRes: []*http.Response{ {