Skip to content

Commit c9e1aa8

Browse files
authored
tests: updated tests for gw 3.12 (#1768)
* tests: updated tests for gw 3.12 * tests: fixed runWhen condition for tests
1 parent 165c443 commit c9e1aa8

File tree

2 files changed

+48
-5
lines changed

2 files changed

+48
-5
lines changed

tests/integration/sync_test.go

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,17 @@ var (
769769
},
770770
}
771771

772+
targetPost312 = []*kong.Target{
773+
{
774+
Target: kong.String("198.51.100.11:80"),
775+
Upstream: &kong.Upstream{
776+
ID: kong.String("a6f89ffc-1e53-4b01-9d3d-7a142bcd"),
777+
},
778+
Weight: kong.Int(100),
779+
Failover: kong.Bool(false),
780+
},
781+
}
782+
772783
targetZeroWeight = []*kong.Target{
773784
{
774785
Target: kong.String("198.51.100.11:80"),
@@ -779,6 +790,17 @@ var (
779790
},
780791
}
781792

793+
targetZeroWeightPost312 = []*kong.Target{
794+
{
795+
Target: kong.String("198.51.100.11:80"),
796+
Upstream: &kong.Upstream{
797+
ID: kong.String("a6f89ffc-1e53-4b01-9d3d-7a142bcd"),
798+
},
799+
Weight: kong.Int(0),
800+
Failover: kong.Bool(false),
801+
},
802+
}
803+
782804
rateLimitingPlugin = []*kong.Plugin{
783805
{
784806
Name: kong.String("rate-limiting"),
@@ -3183,7 +3205,16 @@ func Test_Sync_Upstream_Target_From_3x(t *testing.T) {
31833205
Upstreams: upstream,
31843206
Targets: target,
31853207
},
3186-
runWhen: ">=3.11.0",
3208+
runWhen: ">=3.11.0 <3.12.0",
3209+
},
3210+
{
3211+
name: "creates an upstream and target >=3.12.0",
3212+
kongFile: "testdata/sync/004-create-upstream-and-target/kong3x.yaml",
3213+
expectedState: utils.KongRawState{
3214+
Upstreams: upstream,
3215+
Targets: targetPost312,
3216+
},
3217+
runWhen: ">=3.12.0",
31873218
},
31883219
}
31893220

@@ -3334,7 +3365,16 @@ func Test_Sync_Upstreams_Target_ZeroWeight_3x(t *testing.T) {
33343365
Upstreams: upstream,
33353366
Targets: targetZeroWeight,
33363367
},
3337-
runWhen: ">=3.11.0",
3368+
runWhen: ">=3.11.0 <3.12.0",
3369+
},
3370+
{
3371+
name: "creates an upstream and target with weight equals to zero >=3.12.0 ",
3372+
kongFile: "testdata/sync/005-create-upstream-and-target-weight/kong3x.yaml",
3373+
expectedState: utils.KongRawState{
3374+
Upstreams: upstream,
3375+
Targets: targetZeroWeightPost312,
3376+
},
3377+
runWhen: ">=3.12.0",
33383378
},
33393379
}
33403380

tests/integration/testdata/dump/001-entities-with-tags/expected312.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,20 @@ upstreams:
279279
- managed-by-deck
280280
- org-unit-42
281281
targets:
282-
- tags:
282+
- failover: false
283+
tags:
283284
- managed-by-deck
284285
- org-unit-42
285286
target: 198.51.100.11:80
286287
weight: 100
287-
- tags:
288+
- failover: false
289+
tags:
288290
- managed-by-deck
289291
- org-unit-42
290292
target: 198.51.100.12:80
291293
weight: 100
292-
- tags:
294+
- failover: false
295+
tags:
293296
- managed-by-deck
294297
- org-unit-42
295298
target: 198.51.100.13:80

0 commit comments

Comments
 (0)