Skip to content

Commit 3f8371e

Browse files
committed
BUILD/MINOR: ci: upgrade bats version
1 parent d1c396b commit 3f8371e

File tree

6 files changed

+46
-173
lines changed

6 files changed

+46
-173
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ stages:
77
variables:
88
DOCKER_HOST: tcp://docker:2375
99
DOCKER_BASE_IMAGE: $CI_REGISTRY_GO/haproxy-debian
10-
BATS_VERSION: v1.4.1
10+
BATS_VERSION: v1.10.0
1111
GO_VERSION: "1.24"
1212
DOCKER_VERSION: "26.0"
1313

e2e/tests/cache/create.bats

Lines changed: 0 additions & 45 deletions
This file was deleted.

e2e/tests/cache/delete.bats

Lines changed: 0 additions & 37 deletions
This file was deleted.

e2e/tests/cache/get.bats

Lines changed: 0 additions & 38 deletions
This file was deleted.

e2e/tests/cache/list.bats

Lines changed: 0 additions & 45 deletions
This file was deleted.

e2e/tests/cache/replace.bats renamed to e2e/tests/cache/test.bats

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,69 @@
1616
#
1717

1818
load '../../libs/dataplaneapi'
19+
load '../../libs/debug'
1920
load '../../libs/get_json_path'
2021
load '../../libs/haproxy_config_setup'
2122
load '../../libs/resource_client'
2223
load '../../libs/version'
2324

2425
load 'utils/_helpers'
2526

26-
@test "cache: Replace one cache" {
27-
resource_put "$_CACHE_BASE_PATH/test_cache" "data/cache_same_name.json"
27+
@test "cache: All Cache Tests" {
28+
resource_post "$_CACHE_BASE_PATH" "data/cache.json"
29+
assert_equal "$SC" 202
30+
31+
resource_get "$_CACHE_BASE_PATH/cache_created"
2832
assert_equal "$SC" 200
2933

34+
assert_equal "cache_created" "$(get_json_path "$BODY" ".name")"
35+
assert_equal 1 "$(get_json_path "$BODY" ".max_object_size")"
36+
assert_equal 1000 "$(get_json_path "$BODY" ".total_max_size")"
37+
38+
resource_post "$_CACHE_BASE_PATH" "data/cache_same_name.json"
39+
assert_equal "$SC" 409
40+
41+
resource_post "$_CACHE_BASE_PATH" "data/cache_unvalid.json"
42+
assert_equal "$SC" 400
43+
44+
45+
resource_delete "$_CACHE_BASE_PATH/test_cache2"
46+
assert_equal "$SC" 202
47+
48+
resource_get "$_CACHE_BASE_PATH/test_cache2"
49+
assert_equal "$SC" 404
50+
51+
resource_delete "$_CACHE_BASE_PATH/i_am_not_here"
52+
assert_equal "$SC" 404
53+
54+
resource_get "$_CACHE_BASE_PATH/test_cache"
55+
assert_equal "$SC" 200
56+
assert_equal "test_cache" "$(get_json_path "$BODY" ".name")"
57+
assert_equal 60 "$(get_json_path "$BODY" ".max_age")"
58+
assert_equal 8 "$(get_json_path "$BODY" ".max_object_size")"
59+
assert_equal 1024 "$(get_json_path "$BODY" ".total_max_size")"
60+
61+
62+
resource_get "$_CACHE_BASE_PATH/i_am_not_here"
63+
assert_equal "$SC" 404
64+
65+
resource_get "$_CACHE_BASE_PATH"
66+
assert_equal "$SC" 200
67+
assert_equal 2 "$(get_json_path "$BODY" ". | length")"
68+
69+
resource_put "$_CACHE_BASE_PATH/test_cache" "data/cache_same_name.json"
70+
assert_equal "$SC" 202
71+
3072
resource_get "$_CACHE_BASE_PATH/test_cache"
3173
assert_equal "$SC" 200
3274
assert_equal "test_cache" "$(get_json_path "$BODY" ".name")"
3375
assert_equal 1 "$(get_json_path "$BODY" ".max_object_size")"
3476
assert_equal 1000 "$(get_json_path "$BODY" ".total_max_size")"
35-
}
3677

37-
38-
@test "cache: Fail replacing cache that doesn't exist" {
3978
resource_put "$_CACHE_BASE_PATH/i_am_not_here" "data/cache_same_name.json"
4079
assert_equal "$SC" 404
41-
}
4280

43-
@test "cache: Fail creating cache that isn't valid" {
4481
resource_put "$_CACHE_BASE_PATH/test_cache" "data/cache_unvalid.json"
4582
assert_equal "$SC" 400
83+
4684
}

0 commit comments

Comments
 (0)