Skip to content

Commit

Permalink
tests: reverted to older setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashansa-K committed Feb 13, 2025
1 parent f06c5b8 commit 73e9705
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 218 deletions.
2 changes: 2 additions & 0 deletions .ci/setup_kong.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ docker run \
waitContainer "$GATEWAY_CONTAINER_NAME" kong health

waitContainer "$GATEWAY_CONTAINER_NAME" kong version

waitContainer "$GATEWAY_CONTAINER_NAME" env
4 changes: 3 additions & 1 deletion .ci/setup_kong_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ docker run -d --name $GATEWAY_CONTAINER_NAME \
-p 127.0.0.1:8444:8444 \
$KONG_IMAGE

waitContainer "Kong" $GATEWAY_CONTAINER_NAME "kong health"
waitContainer "Kong" $GATEWAY_CONTAINER_NAME "kong health"

waitContainer "Kong" $GATEWAY_CONTAINER_NAME "kong version"
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
go-version-file: go.mod
- name: Setup Kong
run: make setup-kong-new
run: make setup-kong
- name: Run integration tests
run: make test-integration
continue-on-error: ${{ matrix.kong_image == 'kong/kong:master' }}
2 changes: 1 addition & 1 deletion cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ func containsProxyConfiguration(content reconcilerUtils.KongRawState) bool {
return len(content.Services) != 0 ||
len(content.Routes) != 0 ||
len(content.Plugins) != 0 ||
//len(content.FilterChains) != 0 ||
len(content.FilterChains) != 0 ||
len(content.Upstreams) != 0 ||
len(content.Certificates) != 0 ||
len(content.CACertificates) != 0 ||
Expand Down
6 changes: 3 additions & 3 deletions cmd/gateway_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ func ensureGetAllMethods() error {
if _, err := reconcilerUtils.CallGetAll(dummyEmptyState.RBACRoles); err != nil {
return err
}
// if _, err := reconcilerUtils.CallGetAll(dummyEmptyState.FilterChains); err != nil {
// return err
// }
if _, err := reconcilerUtils.CallGetAll(dummyEmptyState.FilterChains); err != nil {
return err
}
return nil
}
74 changes: 37 additions & 37 deletions tests/integration/dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,43 +308,43 @@ func Test_Dump_ConsumerGroupConsumersWithCustomID_Konnect(t *testing.T) {
assert.Equal(t, expected, output)
}

// func Test_Dump_FilterChains(t *testing.T) {
// runWhen(t, "kong", ">=3.4.0")
// setup(t)

// tests := []struct {
// version string
// input string
// expected string
// }{
// {
// version: "<3.5.0",
// input: "testdata/dump/004-filter-chains/kong-3.4.x.yaml",
// expected: "testdata/dump/004-filter-chains/expected-3.4.x.yaml",
// },
// {
// version: ">=3.5.0",
// input: "testdata/dump/004-filter-chains/kong.yaml",
// expected: "testdata/dump/004-filter-chains/expected.yaml",
// },
// }

// for _, tc := range tests {
// t.Run(tc.version, func(t *testing.T) {
// runWhen(t, "kong", tc.version)
// require.NoError(t, sync(context.Background(), tc.input))

// var output string
// flags := []string{"-o", "-"}
// output, err := dump(flags...)
// assert.NoError(t, err)

// expected, err := readFile(tc.expected)
// assert.NoError(t, err)
// assert.Equal(t, expected, output)
// })
// }
// }
func Test_Dump_FilterChains(t *testing.T) {
runWhen(t, "kong", ">=3.4.0")
setup(t)

tests := []struct {
version string
input string
expected string
}{
{
version: "<3.5.0",
input: "testdata/dump/004-filter-chains/kong-3.4.x.yaml",
expected: "testdata/dump/004-filter-chains/expected-3.4.x.yaml",
},
{
version: ">=3.5.0",
input: "testdata/dump/004-filter-chains/kong.yaml",
expected: "testdata/dump/004-filter-chains/expected.yaml",
},
}

for _, tc := range tests {
t.Run(tc.version, func(t *testing.T) {
runWhen(t, "kong", tc.version)
require.NoError(t, sync(context.Background(), tc.input))

var output string
flags := []string{"-o", "-"}
output, err := dump(flags...)
assert.NoError(t, err)

expected, err := readFile(tc.expected)
assert.NoError(t, err)
assert.Equal(t, expected, output)
})
}
}

func Test_SkipConsumersWithConsumerGroups(t *testing.T) {
tests := []struct {
Expand Down
Loading

0 comments on commit 73e9705

Please sign in to comment.