Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/fatih/color v1.19.0
github.com/google/go-cmp v0.7.0
github.com/kong/go-apiops v0.4.6
github.com/kong/go-database-reconciler v1.42.4
github.com/kong/go-database-reconciler v1.42.5-0.20260910123708-de3744ec50a3
github.com/kong/go-kong v0.78.0
github.com/mitchellh/go-homedir v1.1.0
github.com/spf13/cobra v1.10.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kong/go-apiops v0.4.6 h1:sQkTievX92AT5PZNZcUFbm7inysBVeZIIagXN8MWnP8=
github.com/kong/go-apiops v0.4.6/go.mod h1:Xt99d90LallLVwYJAGaufiNbBdsK0KKboe7gR4Ryths=
github.com/kong/go-database-reconciler v1.42.4 h1:CxeipG/dWIHi73bztg6BU7lIwotOKP1FUmfbz7sp6PE=
github.com/kong/go-database-reconciler v1.42.4/go.mod h1:/lEPLhpDI1x+OOhQ+JeY3OsxvXYN04o12AmqzN7llRQ=
github.com/kong/go-database-reconciler v1.42.5-0.20260910123708-de3744ec50a3 h1:lyOdsCUS4gDB4SOpzH2HZQT9qMP8k4iU6EVv+3SXDEE=
github.com/kong/go-database-reconciler v1.42.5-0.20260910123708-de3744ec50a3/go.mod h1:/lEPLhpDI1x+OOhQ+JeY3OsxvXYN04o12AmqzN7llRQ=
github.com/kong/go-kong v0.78.0 h1:VK5g26BCeF+l9o3j3pgU3BOuOdmTd9Vj33x29mKGtkg=
github.com/kong/go-kong v0.78.0/go.mod h1:Wx5aTcMjyUnIF94M5NYFWb/EnuEkqB5STrWvybFSYYQ=
github.com/kong/go-slugify v1.0.0 h1:vCFAyf2sdoSlBtLcrmDWUFn0ohlpKiKvQfXZkO5vSKY=
Expand Down
57 changes: 57 additions & 0 deletions tests/integration/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,63 @@
assert.Equal(t, emptyOutput, out)
}

func Test_Diff_Partials_NoPerpetualDiff(t *testing.T) {
runWhenEnterpriseOrKonnect(t, ">=3.10.0")

isKonnect := os.Getenv("DECK_KONNECT_TOKEN") != ""

if isKonnect {
runDualTestWithSkipDefaults(t, "Test_Diff_Partials_NoPerpetualDiff", testDiffPartialsNoPerpetualDiffImpl)
} else {
testDiffPartialsNoPerpetualDiffImpl(t)
}
}

func testDiffPartialsNoPerpetualDiffImpl(t *testing.T) {
setup(t)
ctx := context.Background()

stateFile := "testdata/sync/039-partials/kong.yaml"

for i := range 2 {
require.NoError(t, sync(ctx, stateFile))

out, err := diff(stateFile)
require.NoError(t, err)
require.Equal(t, emptyOutput, out, "diff after sync %d reported changes", i+1)
}
}

func Test_Diff_Partials_RealChangeStillDetected(t *testing.T) {
runWhenEnterpriseOrKonnect(t, ">=3.10.0")

isKonnect := os.Getenv("DECK_KONNECT_TOKEN") != ""

if isKonnect {
runDualTestWithSkipDefaults(t, "Test_Diff_Partials_RealChangeStillDetected", testDiffPartialsRealChangeStillDetectedImpl)

Check failure on line 1206 in tests/integration/diff_test.go

View workflow job for this annotation

GitHub Actions / lint

The line is 123 characters long, which exceeds the maximum of 120 characters. (lll)
} else {
testDiffPartialsRealChangeStillDetectedImpl(t)
}
}

func testDiffPartialsRealChangeStillDetectedImpl(t *testing.T) {
setup(t)
ctx := context.Background()

require.NoError(t, sync(ctx, "testdata/sync/039-partials/kong.yaml"))

out, err := diff("testdata/sync/039-partials/kong-update.yaml")
require.NoError(t, err)
assert.NotEqual(t, emptyOutput, out)
assert.Contains(t, out, "updating partial my-ee-partial")

require.NoError(t, sync(ctx, "testdata/sync/039-partials/kong-update.yaml"))

out, err = diff("testdata/sync/039-partials/kong-update.yaml")
require.NoError(t, err)
assert.Equal(t, emptyOutput, out)
}

func Test_Diff_Konnect_Workspace(t *testing.T) {
runWhenKonnect(t)
setup(t)
Expand Down
Loading