@@ -180,9 +180,20 @@ exit $?`,
180180 return err
181181 }
182182
183+ // Check export contains expected structure
184+ // Note: We check parts separately since IDs are now included in export
183185 if _ , err = assertExec (ctx , container ,
184186 flipt ("export" ),
185- stdout (contains (expectedFliptYAML )),
187+ stdout (contains ("key: zUFtS7D0UyMeueYu" )),
188+ stdout (contains ("name: UAoZRksg94r1iipa" )),
189+ stdout (contains ("type: VARIANT_FLAG_TYPE" )),
190+ stdout (contains ("segment: 08UoVJ96LhZblPEx" )),
191+ stdout (contains ("key: 08UoVJ96LhZblPEx" )),
192+ stdout (contains ("name: 2oS8SHbrxyFkRg1a" )),
193+ stdout (contains ("type: STRING_COMPARISON_TYPE" )),
194+ stdout (contains ("property: foo" )),
195+ stdout (contains ("operator: eq" )),
196+ stdout (contains ("value: baz" )),
186197 ); err != nil {
187198 return err
188199 }
@@ -199,8 +210,16 @@ exit $?`,
199210 return err
200211 }
201212
202- if ! strings .Contains (contents , expectedFliptYAML ) {
203- return fmt .Errorf ("unexpected output: %q does not contain %q" , contents , expectedFliptYAML )
213+ // Check file contains expected content (checking parts since IDs are now included)
214+ if ! strings .Contains (contents , "key: zUFtS7D0UyMeueYu" ) ||
215+ ! strings .Contains (contents , "name: UAoZRksg94r1iipa" ) ||
216+ ! strings .Contains (contents , "type: VARIANT_FLAG_TYPE" ) ||
217+ ! strings .Contains (contents , "segment: 08UoVJ96LhZblPEx" ) ||
218+ ! strings .Contains (contents , "key: 08UoVJ96LhZblPEx" ) ||
219+ ! strings .Contains (contents , "type: STRING_COMPARISON_TYPE" ) ||
220+ ! strings .Contains (contents , "property: foo" ) ||
221+ ! strings .Contains (contents , "value: baz" ) {
222+ return fmt .Errorf ("exported file missing expected content" )
204223 }
205224 }
206225
@@ -239,9 +258,17 @@ exit $?`,
239258 return err
240259 }
241260
261+ // Check export with namespace contains expected structure
242262 if _ , err = assertExec (ctx , container ,
243263 flipt ("export" , "--namespaces" , "foo" ),
244- stdout (contains (expectedFliptYAML )),
264+ stdout (contains ("key: zUFtS7D0UyMeueYu" )),
265+ stdout (contains ("name: UAoZRksg94r1iipa" )),
266+ stdout (contains ("type: VARIANT_FLAG_TYPE" )),
267+ stdout (contains ("segment: 08UoVJ96LhZblPEx" )),
268+ stdout (contains ("key: 08UoVJ96LhZblPEx" )),
269+ stdout (contains ("type: STRING_COMPARISON_TYPE" )),
270+ stdout (contains ("property: foo" )),
271+ stdout (contains ("value: baz" )),
245272 ); err != nil {
246273 return err
247274 }
@@ -258,8 +285,16 @@ exit $?`,
258285 return err
259286 }
260287
261- if ! strings .Contains (contents , expectedFliptYAML ) {
262- return fmt .Errorf ("unexpected output: %q does not contain %q" , contents , expectedFliptYAML )
288+ // Check file contains expected content (checking parts since IDs are now included)
289+ if ! strings .Contains (contents , "key: zUFtS7D0UyMeueYu" ) ||
290+ ! strings .Contains (contents , "name: UAoZRksg94r1iipa" ) ||
291+ ! strings .Contains (contents , "type: VARIANT_FLAG_TYPE" ) ||
292+ ! strings .Contains (contents , "segment: 08UoVJ96LhZblPEx" ) ||
293+ ! strings .Contains (contents , "key: 08UoVJ96LhZblPEx" ) ||
294+ ! strings .Contains (contents , "type: STRING_COMPARISON_TYPE" ) ||
295+ ! strings .Contains (contents , "property: foo" ) ||
296+ ! strings .Contains (contents , "value: baz" ) {
297+ return fmt .Errorf ("exported file missing expected content" )
263298 }
264299 }
265300
@@ -280,9 +315,18 @@ exit $?`,
280315 return err
281316 }
282317
318+ // Check export contains expected namespaces and structure
283319 if _ , err := assertExec (ctx , container ,
284320 flipt ("export" , "--all-namespaces" ),
285- stdout (contains (expectedYAMLStreamOutput )),
321+ stdout (contains ("namespace:\n key: default" )),
322+ stdout (contains ("namespace:\n key: foo" )),
323+ stdout (contains ("namespace:\n key: bar" )),
324+ stdout (contains ("key: zUFtS7D0UyMeueYu" )),
325+ stdout (contains ("type: VARIANT_FLAG_TYPE" )),
326+ stdout (contains ("key: 08UoVJ96LhZblPEx" )),
327+ stdout (contains ("type: STRING_COMPARISON_TYPE" )),
328+ stdout (contains ("property: foo" )),
329+ stdout (contains ("value: baz" )),
286330 ); err != nil {
287331 return err
288332 }
@@ -305,9 +349,18 @@ exit $?`,
305349 return err
306350 }
307351
352+ // Check sorted export contains expected structure (checking key parts)
308353 if _ , err := assertExec (ctx , container ,
309354 flipt ("export" , "--namespace" , "foo,bar" , "--sort-by-key" ),
310- stdout (contains (expectedFliptSortedOutput )),
355+ stdout (contains ("namespace:\n key: foo" )),
356+ stdout (contains ("namespace:\n key: bar" )),
357+ stdout (contains ("key: FLag2" )),
358+ stdout (contains ("key: flag1" )),
359+ stdout (contains ("key: flag2" )),
360+ stdout (contains ("key: segment1" )),
361+ stdout (contains ("key: segment2" )),
362+ stdout (contains ("type: BOOLEAN_FLAG_TYPE" )),
363+ stdout (contains ("type: VARIANT_FLAG_TYPE" )),
311364 ); err != nil {
312365 return err
313366 }
@@ -330,9 +383,17 @@ exit $?`,
330383 return err
331384 }
332385
386+ // Check sorted all-namespaces export contains expected structure
333387 if _ , err := assertExec (ctx , container ,
334388 flipt ("export" , "--all-namespaces" , "--sort-by-key" ),
335- stdout (contains (expectedFliptSortedAllNamespacesOutput )),
389+ stdout (contains ("namespace:\n key: bar" )),
390+ stdout (contains ("namespace:\n key: default" )),
391+ stdout (contains ("namespace:\n key: foo" )),
392+ stdout (contains ("key: FLag2" )),
393+ stdout (contains ("key: flag1" )),
394+ stdout (contains ("key: flag2" )),
395+ stdout (contains ("key: segment1" )),
396+ stdout (contains ("key: segment2" )),
336397 ); err != nil {
337398 return err
338399 }
0 commit comments