Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
satr committed Jan 23, 2024
1 parent d649b78 commit b5d27b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion api/deployments/deployment_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,18 @@ func TestGetDeployment_TwoDeploymentsFirstDeployment_ReturnsDeploymentWithCompon
anyDeployment2Name := "ghijkl"
appDeployment1Created, _ := radixutils.ParseTimestamp("2018-11-12T12:00:00Z")
appDeployment2Created, _ := radixutils.ParseTimestamp("2018-11-14T12:00:00Z")
jobName1, jobName2 := "rj1", "rj2"
commitID1 := "commit1"

_, err := commonTestUtils.ApplyDeployment(builders.
_, err := commonTestUtils.ApplyJob(builders.ARadixBuildDeployJob().WithAppName(anyAppName).WithJobName(jobName1).WithCommitID(commitID1))
require.NoError(t, err)
_, err = commonTestUtils.ApplyDeployment(builders.
NewDeploymentBuilder().
WithRadixApplication(
builders.ARadixApplication().
WithAppName(anyAppName)).
WithAppName(anyAppName).
WithLabel(kube.RadixJobNameLabel, jobName1).
WithDeploymentName(anyDeployment1Name).
WithCreated(appDeployment1Created).
WithCondition(v1.DeploymentInactive).
Expand Down Expand Up @@ -372,6 +377,7 @@ func TestGetDeployment_TwoDeploymentsFirstDeployment_ReturnsDeploymentWithCompon
builders.ARadixApplication().
WithAppName(anyAppName)).
WithAppName(anyAppName).
WithLabel(kube.RadixJobNameLabel, jobName2).
WithDeploymentName(anyDeployment2Name).
WithCreated(appDeployment2Created).
WithCondition(v1.DeploymentActive).
Expand Down
2 changes: 1 addition & 1 deletion api/deployments/deployment_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (deploy *deployHandler) getRadixDeploymentRadixJob(ctx context.Context, app
jobName := rd.GetLabels()[kube.RadixJobNameLabel]
radixJob, err := kubequery.GetRadixJob(ctx, deploy.accounts.UserAccount.RadixClient, appName, jobName)
if err != nil {
if !errors.IsNotFound(err) {
if errors.IsNotFound(err) {
return nil, nil
}
return nil, err
Expand Down

0 comments on commit b5d27b1

Please sign in to comment.