Skip to content

Commit

Permalink
fix: fixed test-case
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashansa-K committed Dec 9, 2024
1 parent c6c77ad commit 1e4d215
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 51 deletions.
51 changes: 9 additions & 42 deletions tests/integration/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1269,47 +1269,14 @@ var (
}

consumerGroupScopedPluginWithTags = []*kong.Plugin{{
Name: kong.String("rate-limiting-advanced"),
Name: kong.String("request-transformer"),
Config: kong.Configuration{
"consumer_groups": nil,
"dictionary_name": string("kong_rate_limiting_counters"),
"disable_penalty": bool(false),
"enforce_consumer_groups": bool(false),
"error_code": float64(429),
"error_message": string("API rate limit exceeded"),
"header_name": nil,
"hide_client_headers": bool(false),
"identifier": string("consumer"),
"limit": []any{float64(10)},
"namespace": string("gold"),
"path": nil,
"redis": map[string]any{
"cluster_addresses": nil,
"connect_timeout": nil,
"database": float64(0),
"host": nil,
"keepalive_backlog": nil,
"keepalive_pool_size": float64(256),
"password": nil,
"port": nil,
"read_timeout": nil,
"send_timeout": nil,
"sentinel_addresses": nil,
"sentinel_master": nil,
"sentinel_password": nil,
"sentinel_role": nil,
"sentinel_username": nil,
"server_name": nil,
"ssl": false,
"ssl_verify": false,
"timeout": float64(2000),
"username": nil,
},
"retry_after_jitter_max": float64(1),
"strategy": string("local"),
"sync_rate": float64(-1),
"window_size": []any{float64(60)},
"window_type": string("sliding"),
"add": map[string]any{"body": []any{}, "headers": []any{}, "querystring": []any{}},
"append": map[string]any{"body": []any{}, "headers": []any{}, "querystring": []any{}},
"http_method": string("GET"),
"remove": map[string]any{"body": []any{}, "headers": []any{string("test-header")}, "querystring": []any{}},
"rename": map[string]any{"body": []any{}, "headers": []any{}, "querystring": []any{}},
"replace": map[string]any{"body": []any{}, "headers": []any{}, "querystring": []any{}, "uri": nil},
},
ConsumerGroup: &kong.ConsumerGroup{
ID: kong.String("58076db2-28b6-423b-ba39-a79719301700"),
Expand Down Expand Up @@ -2853,7 +2820,7 @@ func Test_Sync_PluginsOnEntitiesFrom_3_0_0(t *testing.T) {

// test scope:
// - 3.4.0+
func Test_Sync_PluginsOnConsumerGroupsFrom_3_4_0(t *testing.T) {
func Test_Sync_PluginsOnConsumerGroupsWithTagsFrom_3_4_0(t *testing.T) {
// setup stage
client, err := getTestClient()
if err != nil {
Expand Down Expand Up @@ -2883,7 +2850,7 @@ func Test_Sync_PluginsOnConsumerGroupsFrom_3_4_0(t *testing.T) {

for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
runWhenKongOrKonnect(t, ">=3.4.0")
runWhenEnterpriseOrKonnect(t, ">=3.4.0")
setup(t)

sync(tc.kongFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ consumer_groups:
- id: 58076db2-28b6-423b-ba39-a79719301700
name: foo
plugins:
- name: rate-limiting-advanced
- name: request-transformer
tags:
- tag1
- tag2
config:
namespace: silver
limit:
- 7
retry_after_jitter_max: 1
window_size:
- 60
window_type: sliding
sync_rate: -1
http_method: "GET"
remove:
headers:
- test-header

0 comments on commit 1e4d215

Please sign in to comment.