From cc9dae8c245c05ea601eb4ce93d67bb9473a822e Mon Sep 17 00:00:00 2001 From: Rujhan Arora Date: Fri, 13 Dec 2024 17:17:41 +0530 Subject: [PATCH] Introduction of astro deploy --image-name=image_name --remote --runtime-version=rt_version --- software/deploy/deploy_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/software/deploy/deploy_test.go b/software/deploy/deploy_test.go index 1e8fb080d..7349c47c7 100644 --- a/software/deploy/deploy_test.go +++ b/software/deploy/deploy_test.go @@ -1040,10 +1040,10 @@ func (s *Suite) TestUpdateDeploymentImage() { s.Run("When runtimeVersion is empty", func() { houstonMock := new(houston_mocks.ClientInterface) - returnedDeploymentId, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, "", imageName) + returnedDeploymentID, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, "", imageName) s.ErrorIs(err, ErrRuntimeVersionNotPassedForRemoteImage) houstonMock.AssertExpectations(s.T()) - s.Equal(returnedDeploymentId, "") + s.Equal(returnedDeploymentID, "") }) s.Run("When getDeploymentIDForCurrentCommandVar gives an error", func() { @@ -1051,10 +1051,10 @@ func (s *Suite) TestUpdateDeploymentImage() { return deploymentID, nil, errDeploymentNotFound } houstonMock := new(houston_mocks.ClientInterface) - returnedDeploymentId, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, runtimeVersion, imageName) + returnedDeploymentID, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, runtimeVersion, imageName) s.ErrorIs(err, errDeploymentNotFound) houstonMock.AssertExpectations(s.T()) - s.Equal(returnedDeploymentId, "") + s.Equal(returnedDeploymentID, "") }) s.Run("When an error occurs in the GetDeployment api call", func() { @@ -1064,10 +1064,10 @@ func (s *Suite) TestUpdateDeploymentImage() { houstonMock := new(houston_mocks.ClientInterface) houstonMock.On("GetDeployment", mock.Anything).Return(nil, errMockHouston).Once() - returnedDeploymentId, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, runtimeVersion, imageName) + returnedDeploymentID, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, runtimeVersion, imageName) s.ErrorContains(err, "failed to get deployment info: some houston error") houstonMock.AssertExpectations(s.T()) - s.Equal(returnedDeploymentId, "") + s.Equal(returnedDeploymentID, "") }) s.Run("Houston API call throws error", func() { @@ -1080,10 +1080,10 @@ func (s *Suite) TestUpdateDeploymentImage() { } houstonMock.On("GetDeployment", mock.Anything).Return(deployment, nil).Once() houstonMock.On("UpdateDeploymentImage", mock.Anything).Return(nil, errMockHouston).Once() - returnedDeploymentId, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, runtimeVersion, imageName) + returnedDeploymentID, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, runtimeVersion, imageName) s.ErrorContains(err, "some houston error") houstonMock.AssertExpectations(s.T()) - s.Equal(returnedDeploymentId, deploymentID) + s.Equal(returnedDeploymentID, deploymentID) }) s.Run("Successful API call", func() { @@ -1101,9 +1101,9 @@ func (s *Suite) TestUpdateDeploymentImage() { } houstonMock.On("GetDeployment", mock.Anything).Return(deployment, nil).Once() houstonMock.On("UpdateDeploymentImage", mock.Anything).Return(updateDeploymentImageResp, nil).Once() - returnedDeploymentId, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, runtimeVersion, imageName) + returnedDeploymentID, err := UpdateDeploymentImage(houstonMock, deploymentID, wsID, runtimeVersion, imageName) houstonMock.AssertExpectations(s.T()) s.ErrorIs(err, nil) - s.Equal(returnedDeploymentId, deploymentID) + s.Equal(returnedDeploymentID, deploymentID) }) }