Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
GiGurra committed Jul 14, 2023
1 parent b3c6dcb commit 94f4f83
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion internal/flycd/deployment_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
)

func TestDeployFromFolder(t *testing.T) {
func TestDeployFromFolder_newApp(t *testing.T) {
ctx := context.Background()
flyClient := mocks.NewMockFlyClient(t)
deployService := NewDeployService(flyClient)
Expand Down Expand Up @@ -41,3 +41,36 @@ func TestDeployFromFolder(t *testing.T) {
}

}

func TestDeployFromFolder_existingApp(t *testing.T) {
ctx := context.Background()
flyClient := mocks.NewMockFlyClient(t)
deployService := NewDeployService(flyClient)
deployCfg := model.
NewDefaultDeployConfig().
WithAbortOnFirstError(true).
WithRetries(0)

fmt.Printf("flyClient: %+v\n", flyClient)

flyClient.
EXPECT().
ExistsApp(mock.Anything, mock.Anything).
Return(true, nil)

flyClient.
EXPECT().
GetDeployedAppConfig(mock.Anything, mock.Anything).
Return(model.AppConfig{}, nil)

flyClient.
EXPECT().
DeployExistingApp(mock.Anything, mock.Anything, mock.Anything, mock.Anything).
Return(nil)

_, err := deployService.DeployAppFromFolder(ctx, "../../test/test-projects/merge-cfg/regular/app1", deployCfg)
if err != nil {
t.Fatalf("DeployAppFromFolder failed: %v", err)
}

}

0 comments on commit 94f4f83

Please sign in to comment.