@@ -85,6 +85,9 @@ func TestMaxResourceSize(t *testing.T) {
85
85
}
86
86
})
87
87
t .Run ("JSONPatchType should handle a patch just under the max limit" , func (t * testing.T ) {
88
+ if testing .Short () {
89
+ t .Skip ("skipping expensive test" )
90
+ }
88
91
patchBody := []byte (`[{"op":"add","path":"/foo","value":` + strings .Repeat ("[" , 3 * 1024 * 1024 / 2 - 100 ) + strings .Repeat ("]" , 3 * 1024 * 1024 / 2 - 100 ) + `}]` )
89
92
err = rest .Patch (types .JSONPatchType ).AbsPath ("/api/v1/namespaces/default/secrets/test" ).
90
93
Body (patchBody ).Do (context .TODO ()).Error ()
@@ -93,6 +96,9 @@ func TestMaxResourceSize(t *testing.T) {
93
96
}
94
97
})
95
98
t .Run ("JSONPatchType should handle a valid patch just under the max limit" , func (t * testing.T ) {
99
+ if testing .Short () {
100
+ t .Skip ("skipping expensive test" )
101
+ }
96
102
patchBody := []byte (`[{"op":"add","path":"/foo","value":0` + strings .Repeat (" " , 3 * 1024 * 1024 - 100 ) + `}]` )
97
103
err = rest .Patch (types .JSONPatchType ).AbsPath ("/api/v1/namespaces/default/secrets/test" ).
98
104
Body (patchBody ).Do (context .TODO ()).Error ()
@@ -101,6 +107,9 @@ func TestMaxResourceSize(t *testing.T) {
101
107
}
102
108
})
103
109
t .Run ("MergePatchType should handle a patch just under the max limit" , func (t * testing.T ) {
110
+ if testing .Short () {
111
+ t .Skip ("skipping expensive test" )
112
+ }
104
113
patchBody := []byte (`{"value":` + strings .Repeat ("[" , 3 * 1024 * 1024 / 2 - 100 ) + strings .Repeat ("]" , 3 * 1024 * 1024 / 2 - 100 ) + `}` )
105
114
err = rest .Patch (types .MergePatchType ).AbsPath ("/api/v1/namespaces/default/secrets/test" ).
106
115
Body (patchBody ).Do (context .TODO ()).Error ()
@@ -109,6 +118,9 @@ func TestMaxResourceSize(t *testing.T) {
109
118
}
110
119
})
111
120
t .Run ("MergePatchType should handle a valid patch just under the max limit" , func (t * testing.T ) {
121
+ if testing .Short () {
122
+ t .Skip ("skipping expensive test" )
123
+ }
112
124
patchBody := []byte (`{"value":0` + strings .Repeat (" " , 3 * 1024 * 1024 - 100 ) + `}` )
113
125
err = rest .Patch (types .MergePatchType ).AbsPath ("/api/v1/namespaces/default/secrets/test" ).
114
126
Body (patchBody ).Do (context .TODO ()).Error ()
@@ -117,6 +129,9 @@ func TestMaxResourceSize(t *testing.T) {
117
129
}
118
130
})
119
131
t .Run ("StrategicMergePatchType should handle a patch just under the max limit" , func (t * testing.T ) {
132
+ if testing .Short () {
133
+ t .Skip ("skipping expensive test" )
134
+ }
120
135
patchBody := []byte (`{"value":` + strings .Repeat ("[" , 3 * 1024 * 1024 / 2 - 100 ) + strings .Repeat ("]" , 3 * 1024 * 1024 / 2 - 100 ) + `}` )
121
136
err = rest .Patch (types .StrategicMergePatchType ).AbsPath ("/api/v1/namespaces/default/secrets/test" ).
122
137
Body (patchBody ).Do (context .TODO ()).Error ()
@@ -125,6 +140,9 @@ func TestMaxResourceSize(t *testing.T) {
125
140
}
126
141
})
127
142
t .Run ("StrategicMergePatchType should handle a valid patch just under the max limit" , func (t * testing.T ) {
143
+ if testing .Short () {
144
+ t .Skip ("skipping expensive test" )
145
+ }
128
146
patchBody := []byte (`{"value":0` + strings .Repeat (" " , 3 * 1024 * 1024 - 100 ) + `}` )
129
147
err = rest .Patch (types .StrategicMergePatchType ).AbsPath ("/api/v1/namespaces/default/secrets/test" ).
130
148
Body (patchBody ).Do (context .TODO ()).Error ()
@@ -133,6 +151,9 @@ func TestMaxResourceSize(t *testing.T) {
133
151
}
134
152
})
135
153
t .Run ("ApplyPatchType should handle a patch just under the max limit" , func (t * testing.T ) {
154
+ if testing .Short () {
155
+ t .Skip ("skipping expensive test" )
156
+ }
136
157
patchBody := []byte (`{"value":` + strings .Repeat ("[" , 3 * 1024 * 1024 / 2 - 100 ) + strings .Repeat ("]" , 3 * 1024 * 1024 / 2 - 100 ) + `}` )
137
158
err = rest .Patch (types .ApplyPatchType ).Param ("fieldManager" , "test" ).AbsPath ("/api/v1/namespaces/default/secrets/test" ).
138
159
Body (patchBody ).Do (context .TODO ()).Error ()
@@ -141,6 +162,9 @@ func TestMaxResourceSize(t *testing.T) {
141
162
}
142
163
})
143
164
t .Run ("ApplyPatchType should handle a valid patch just under the max limit" , func (t * testing.T ) {
165
+ if testing .Short () {
166
+ t .Skip ("skipping expensive test" )
167
+ }
144
168
patchBody := []byte (`{"apiVersion":"v1","kind":"Secret"` + strings .Repeat (" " , 3 * 1024 * 1024 - 100 ) + `}` )
145
169
err = rest .Patch (types .ApplyPatchType ).Param ("fieldManager" , "test" ).AbsPath ("/api/v1/namespaces/default/secrets/test" ).
146
170
Body (patchBody ).Do (context .TODO ()).Error ()
@@ -182,6 +206,9 @@ values: ` + strings.Repeat("[", 3*1024*1024))
182
206
183
207
// Create YAML just under 3MB limit, nested
184
208
t .Run ("create should handle a yaml document just under the maximum size with correct nesting" , func (t * testing.T ) {
209
+ if testing .Short () {
210
+ t .Skip ("skipping expensive test" )
211
+ }
185
212
yamlBody := []byte (`
186
213
apiVersion: v1
187
214
kind: ConfigMap
@@ -202,6 +229,9 @@ values: ` + strings.Repeat("[", 3*1024*1024/2-500) + strings.Repeat("]", 3*1024*
202
229
203
230
// Create YAML just under 3MB limit, not nested
204
231
t .Run ("create should handle a yaml document just under the maximum size with unbalanced nesting" , func (t * testing.T ) {
232
+ if testing .Short () {
233
+ t .Skip ("skipping expensive test" )
234
+ }
205
235
yamlBody := []byte (`
206
236
apiVersion: v1
207
237
kind: ConfigMap
@@ -243,6 +273,9 @@ values: ` + strings.Repeat("[", 3*1024*1024-1000))
243
273
244
274
// Create JSON just under 3MB limit, nested
245
275
t .Run ("create should handle a json document just under the maximum size with correct nesting" , func (t * testing.T ) {
276
+ if testing .Short () {
277
+ t .Skip ("skipping expensive test" )
278
+ }
246
279
jsonBody := []byte (`{
247
280
"apiVersion": "v1",
248
281
"kind": "ConfigMap",
@@ -265,6 +298,9 @@ values: ` + strings.Repeat("[", 3*1024*1024-1000))
265
298
266
299
// Create JSON just under 3MB limit, not nested
267
300
t .Run ("create should handle a json document just under the maximum size with unbalanced nesting" , func (t * testing.T ) {
301
+ if testing .Short () {
302
+ t .Skip ("skipping expensive test" )
303
+ }
268
304
jsonBody := []byte (`{
269
305
"apiVersion": "v1",
270
306
"kind": "ConfigMap",
0 commit comments