Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing integration test failures for 3.8.1 release #1428

Merged
merged 6 commits into from
Nov 6, 2024
Merged
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
40 changes: 30 additions & 10 deletions tests/integration/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,18 +752,38 @@ func Test_Diff_Unmasked_NewerThan3x(t *testing.T) {
// test scope:
// - 3.5
func Test_Diff_NoDiffUnorderedArray(t *testing.T) {
runWhen(t, "enterprise", ">=3.5.0")
setup(t)
tests := []struct {
name string
stateFile string
runWhen string
}{
{
name: "no diffs with unordered arrays >=3.5.0 <3.8.1",
stateFile: "testdata/diff/004-no-diff-plugin/kong.yaml",
runWhen: ">=3.5.0 <3.8.1",
},
// Uncomment post solving: https://konghq.atlassian.net/browse/FTI-6303
// {
// name: "no diffs with unordered arrays >=3.8.1",
// stateFile: "testdata/diff/004-no-diff-plugin/kong.yaml",
// runWhen: ">=3.8.1",
// },
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
runWhen(t, "enterprise", tc.runWhen)
setup(t)

// test that the diff command does not return any changes when
// array fields are not sorted.
stateFile := "testdata/diff/004-no-diff-plugin/kong.yaml"
assert.NoError(t, sync(stateFile, "--timeout", "60"))
// test that the diff command does not return any changes when
// array fields are not sorted.
assert.NoError(t, sync(tc.stateFile, "--timeout", "60"))

out, err := diff(stateFile)
assert.NoError(t, err)
assert.Equal(t, emptyOutput, out)
reset(t)
out, err := diff(tc.stateFile)
assert.NoError(t, err)
assert.Equal(t, emptyOutput, out)
reset(t)
})
}
}

// test scope:
Expand Down
21 changes: 18 additions & 3 deletions tests/integration/dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,24 @@ func Test_Dump_SelectTags_3x(t *testing.T) {
name string
stateFile string
expectedFile string
runWhen string
}{
{
name: "dump with select-tags",
name: "dump with select-tags >=3.1.0 <3.8.1",
stateFile: "testdata/dump/001-entities-with-tags/kong.yaml",
expectedFile: "testdata/dump/001-entities-with-tags/expected.yaml",
runWhen: ">=3.1.0 <3.8.1",
},
{
name: "dump with select-tags 3.8.1",
stateFile: "testdata/dump/001-entities-with-tags/kong.yaml",
expectedFile: "testdata/dump/001-entities-with-tags/expected381.yaml",
runWhen: ">=3.8.1",
},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
runWhen(t, "kong", ">=3.1.0")
runWhen(t, "kong", tc.runWhen)
setup(t)

assert.NoError(t, sync(tc.stateFile))
Expand Down Expand Up @@ -123,7 +131,14 @@ func Test_Dump_SkipConsumers(t *testing.T) {
stateFile: "testdata/dump/002-skip-consumers/kong34.yaml",
expectedFile: "testdata/dump/002-skip-consumers/expected-no-skip-35.yaml",
skipConsumers: false,
runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.5.0") },
runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.5.0 <3.8.1") },
},
{
name: "3.8.1 dump with no skip-consumers",
stateFile: "testdata/dump/002-skip-consumers/kong34.yaml",
expectedFile: "testdata/dump/002-skip-consumers/expected-no-skip-381.yaml",
skipConsumers: false,
runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.8.1") },
},
}
for _, tc := range tests {
Expand Down
Loading
Loading