Skip to content

Commit

Permalink
Fixing integration test failures for 3.8.1 release (#1428)
Browse files Browse the repository at this point in the history
* fix: integration test fixes for 3.8.1

* removed stray comments

* fixed semver range for dump test
  • Loading branch information
Prashansa-K authored Nov 6, 2024
1 parent 8e377a0 commit c88f497
Show file tree
Hide file tree
Showing 5 changed files with 658 additions and 16 deletions.
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

0 comments on commit c88f497

Please sign in to comment.