Skip to content

Commit

Permalink
chore: add more unit tests around useDiffCache function (argoproj#17404)
Browse files Browse the repository at this point in the history
* chore: add more unit tests around useDiffCache function

Signed-off-by: Leonardo Luz Almeida <[email protected]>

* fix doc

Signed-off-by: Leonardo Luz Almeida <[email protected]>

---------

Signed-off-by: Leonardo Luz Almeida <[email protected]>
  • Loading branch information
leoluz authored Mar 6, 2024
1 parent ee78d02 commit 8786ec2
Show file tree
Hide file tree
Showing 5 changed files with 524 additions and 1 deletion.
12 changes: 12 additions & 0 deletions controller/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/argo-cd/v2/common"
"github.com/argoproj/argo-cd/v2/controller/testdata"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
argoappv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
Expand Down Expand Up @@ -1509,6 +1510,17 @@ func TestUseDiffCache(t *testing.T) {
expectedUseCache: true,
serverSideDiff: false,
},
{
testName: "will use diff cache with sync policy",
noCache: false,
manifestInfos: manifestInfos("rev1"),
sources: sources(),
app: test.YamlToApplication(testdata.DiffCacheYaml),
manifestRevisions: []string{"rev1"},
statusRefreshTimeout: time.Hour * 24,
expectedUseCache: true,
serverSideDiff: true,
},
{
testName: "will use diff cache for multisource",
noCache: false,
Expand Down
3 changes: 3 additions & 0 deletions controller/testdata/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ var (

//go:embed target-deployment-new-entries.yaml
TargetDeploymentNewEntries string

//go:embed diff-cache.yaml
DiffCacheYaml string
)
Loading

0 comments on commit 8786ec2

Please sign in to comment.