Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
levan-m committed Jan 16, 2025
1 parent bc3a576 commit 08fcc21
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/condition/condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ package condition

import (
"testing"
"time"

"github.com/google/go-cmp/cmp"
assert "github.com/stretchr/testify/require"
appsv1 "k8s.io/api/apps/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
Expand Down Expand Up @@ -108,3 +111,11 @@ func TestDeleteDatadogAgentStatusCondition(t *testing.T) {
})
}
}

func TestDSUpdateWhenNil(t *testing.T) {
var ds *appsv1.DaemonSet
dsStatus := UpdateDaemonSetStatus(ds, []*v2alpha1.DaemonSetStatus{}, &metav1.Time{Time: time.Now()})
dsStatus = UpdateDaemonSetStatus(ds, dsStatus, &metav1.Time{Time: time.Now()})
dsStatus = UpdateDaemonSetStatus(ds, dsStatus, &metav1.Time{Time: time.Now()})
assert.Equal(t, 1, len(dsStatus))
}

0 comments on commit 08fcc21

Please sign in to comment.