Skip to content

Commit a895cb8

Browse files
committed
chore(export): Overwrite existing fixtures with auto generated ones
Signed-off-by: crossy-l <[email protected]>
1 parent af21da6 commit a895cb8

12 files changed

+821
-996
lines changed

internal/ext/testdata/export.json

Lines changed: 1 addition & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1 @@
1-
{
2-
"version": "1.4",
3-
"namespace": {
4-
"key": "default",
5-
"name": "default",
6-
"description": "default namespace"
7-
},
8-
"flags": [
9-
{
10-
"key": "flag1",
11-
"name": "flag1",
12-
"type": "VARIANT_FLAG_TYPE",
13-
"description": "description",
14-
"enabled": true,
15-
"variants": [
16-
{
17-
"key": "variant1",
18-
"name": "variant1",
19-
"attachment": {
20-
"pi": 3.141,
21-
"happy": true,
22-
"name": "Niels",
23-
"nothing": null,
24-
"answer": { "everything": 42 },
25-
"list": [1, 0, 2],
26-
"object": { "currency": "USD", "value": 42.99 }
27-
}
28-
},
29-
{
30-
"key": "foo",
31-
"default": true
32-
}
33-
],
34-
"rules": [
35-
{
36-
"segment": "segment1",
37-
"distributions": [{ "variant": "variant1", "rollout": 100 }]
38-
},
39-
{
40-
"segment": {
41-
"keys": ["segment1", "segment2"],
42-
"operator": "AND_SEGMENT_OPERATOR"
43-
}
44-
}
45-
],
46-
"metadata": {
47-
"label": "variant",
48-
"area": true
49-
}
50-
},
51-
{
52-
"key": "flag2",
53-
"name": "flag2",
54-
"type": "BOOLEAN_FLAG_TYPE",
55-
"description": "a boolean flag",
56-
"enabled": false,
57-
"rollouts": [
58-
{
59-
"description": "enabled for internal users",
60-
"segment": { "key": "internal_users", "value": true }
61-
},
62-
{
63-
"description": "enabled for 50%",
64-
"threshold": { "percentage": 50, "value": true }
65-
}
66-
],
67-
"metadata": {
68-
"label": "bool",
69-
"area": 12
70-
}
71-
}
72-
],
73-
"segments": [
74-
{
75-
"key": "segment1",
76-
"name": "segment1",
77-
"match_type": "ANY_MATCH_TYPE",
78-
"description": "description",
79-
"constraints": [
80-
{
81-
"type": "STRING_COMPARISON_TYPE",
82-
"property": "foo",
83-
"operator": "eq",
84-
"value": "baz",
85-
"description": "desc"
86-
},
87-
{
88-
"type": "STRING_COMPARISON_TYPE",
89-
"property": "fizz",
90-
"operator": "neq",
91-
"value": "buzz",
92-
"description": "desc"
93-
}
94-
]
95-
},
96-
{
97-
"key": "segment2",
98-
"name": "segment2",
99-
"match_type": "ANY_MATCH_TYPE",
100-
"description": "description"
101-
}
102-
]
103-
}
1+
{"version":"1.4","namespace":{"key":"default","name":"default","description":"default namespace"},"flags":[{"key":"flag1","name":"flag1","type":"VARIANT_FLAG_TYPE","description":"description","enabled":true,"metadata":{"area":true,"label":"variant"},"variants":[{"key":"variant1","name":"variant1","attachment":{"answer":{"everything":42},"happy":true,"list":[1,0,2],"name":"Niels","nothing":null,"object":{"currency":"USD","value":42.99},"pi":3.141}},{"default":true,"key":"foo"}],"rules":[{"segment":"segment1","distributions":[{"variant":"variant1","rollout":100}]},{"segment":{"keys":["segment1","segment2"],"operator":"AND_SEGMENT_OPERATOR"}}]},{"key":"flag2","name":"flag2","type":"BOOLEAN_FLAG_TYPE","description":"a boolean flag","enabled":false,"metadata":{"area":12,"label":"bool"},"rollouts":[{"id":"1","description":"enabled for internal users","segment":{"key":"internal_users","value":true}},{"id":"2","description":"enabled for 50%","threshold":{"percentage":50,"value":true}}]}],"segments":[{"key":"segment1","name":"segment1","description":"description","constraints":[{"id":"1","type":"STRING_COMPARISON_TYPE","property":"foo","operator":"eq","value":"baz","description":"desc"},{"id":"2","type":"STRING_COMPARISON_TYPE","property":"fizz","operator":"neq","value":"buzz","description":"desc"}],"match_type":"ANY_MATCH_TYPE"},{"key":"segment2","name":"segment2","description":"description","match_type":"ANY_MATCH_TYPE"}]}

internal/ext/testdata/export.yml

Lines changed: 77 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -4,77 +4,81 @@ namespace:
44
name: default
55
description: default namespace
66
flags:
7-
- key: flag1
8-
name: flag1
9-
type: "VARIANT_FLAG_TYPE"
10-
description: description
11-
enabled: true
12-
variants:
13-
- key: variant1
14-
name: variant1
15-
attachment:
16-
pi: 3.141
17-
happy: true
18-
name: Niels
19-
nothing:
20-
answer:
21-
everything: 42
22-
list:
23-
- 1
24-
- 0
25-
- 2
26-
object:
27-
currency: USD
28-
value: 42.99
29-
- key: foo
30-
default: true
31-
rules:
32-
- segment: segment1
33-
distributions:
34-
- variant: variant1
35-
rollout: 100
36-
- segment:
37-
keys:
38-
- segment1
39-
- segment2
40-
operator: AND_SEGMENT_OPERATOR
41-
metadata:
42-
label: variant
43-
area: true
44-
- key: flag2
45-
name: flag2
46-
type: "BOOLEAN_FLAG_TYPE"
47-
description: a boolean flag
48-
enabled: false
49-
rollouts:
50-
- description: enabled for internal users
51-
segment:
52-
key: internal_users
53-
value: true
54-
- description: enabled for 50%
55-
threshold:
56-
percentage: 50
57-
value: true
58-
metadata:
59-
label: bool
60-
area: 12
7+
- key: flag1
8+
name: flag1
9+
type: VARIANT_FLAG_TYPE
10+
description: description
11+
enabled: true
12+
metadata:
13+
area: true
14+
label: variant
15+
variants:
16+
- key: variant1
17+
name: variant1
18+
attachment:
19+
answer:
20+
everything: 42
21+
happy: true
22+
list:
23+
- 1
24+
- 0
25+
- 2
26+
name: Niels
27+
nothing: null
28+
object:
29+
currency: USD
30+
value: 42.99
31+
pi: 3.141
32+
- default: true
33+
key: foo
34+
rules:
35+
- segment: segment1
36+
distributions:
37+
- variant: variant1
38+
rollout: 100
39+
- segment:
40+
keys:
41+
- segment1
42+
- segment2
43+
operator: AND_SEGMENT_OPERATOR
44+
- key: flag2
45+
name: flag2
46+
type: BOOLEAN_FLAG_TYPE
47+
description: a boolean flag
48+
enabled: false
49+
metadata:
50+
area: 12
51+
label: bool
52+
rollouts:
53+
- id: "1"
54+
description: enabled for internal users
55+
segment:
56+
key: internal_users
57+
value: true
58+
- id: "2"
59+
description: enabled for 50%
60+
threshold:
61+
percentage: 50
62+
value: true
6163
segments:
62-
- key: segment1
63-
name: segment1
64-
match_type: "ANY_MATCH_TYPE"
65-
description: description
66-
constraints:
67-
- type: STRING_COMPARISON_TYPE
68-
property: foo
69-
operator: eq
70-
value: baz
71-
description: desc
72-
- type: STRING_COMPARISON_TYPE
73-
property: fizz
74-
operator: neq
75-
value: buzz
76-
description: desc
77-
- key: segment2
78-
name: segment2
79-
match_type: "ANY_MATCH_TYPE"
80-
description: description
64+
- key: segment1
65+
name: segment1
66+
description: description
67+
constraints:
68+
- id: "1"
69+
type: STRING_COMPARISON_TYPE
70+
property: foo
71+
operator: eq
72+
value: baz
73+
description: desc
74+
- id: "2"
75+
type: STRING_COMPARISON_TYPE
76+
property: fizz
77+
operator: neq
78+
value: buzz
79+
description: desc
80+
match_type: ANY_MATCH_TYPE
81+
- key: segment2
82+
name: segment2
83+
description: description
84+
match_type: ANY_MATCH_TYPE
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{"version":"1.4","namespace":{"key":"default","name": "default","description":"default namespace"}}
2-
{"namespace":{"key":"foo","name":"foo","description":"foo namespace"},"flags":[{"key":"flag1","name":"flag1","type":"VARIANT_FLAG_TYPE","description":"description","enabled":true,"variants":[{"key":"variant1","name":"variant1","attachment":{"pi":3.141,"happy":true,"name":"Niels","nothing":null,"answer":{"everything":42},"list":[1,0,2],"object":{"currency":"USD","value":42.99}}},{"key":"foo"}],"rules":[{"segment":"segment1","distributions":[{"variant":"variant1","rollout":100}]},{"segment":{"keys":["segment1","segment2"],"operator":"AND_SEGMENT_OPERATOR"}}]},{"key":"flag2","name":"flag2","type":"BOOLEAN_FLAG_TYPE","description":"a boolean flag","enabled":false,"rollouts":[{"description":"enabled for internal users","segment":{"key":"internal_users","value":true}},{"description":"enabled for 50%","threshold":{"percentage":50,"value":true}}]}],"segments":[{"key":"segment1","name":"segment1","match_type":"ANY_MATCH_TYPE","description":"description","constraints":[{"type":"STRING_COMPARISON_TYPE","property":"foo","operator":"eq","value":"baz","description":"desc"},{"type":"STRING_COMPARISON_TYPE","property":"fizz","operator":"neq","value":"buzz","description":"desc"}]},{"key":"segment2","name":"segment2","match_type":"ANY_MATCH_TYPE","description":"description"}]}
3-
{"namespace":{"key":"bar","name":"bar","description":"bar namespace"},"flags":[{"key":"flag1","name":"flag1","type":"VARIANT_FLAG_TYPE","description":"description","enabled":true,"variants":[{"key":"variant1","name":"variant1","attachment":{"pi":3.141,"happy":true,"name":"Niels","nothing":null,"answer":{"everything":42},"list":[1,0,2],"object":{"currency":"USD","value":42.99}}},{"key":"foo"}],"rules":[{"segment":"segment1","distributions":[{"variant":"variant1","rollout":100}]},{"segment":{"keys":["segment1","segment2"],"operator":"AND_SEGMENT_OPERATOR"}}]},{"key":"flag2","name":"flag2","type":"BOOLEAN_FLAG_TYPE","description":"a boolean flag","enabled":false,"rollouts":[{"description":"enabled for internal users","segment":{"key":"internal_users","value":true}},{"description":"enabled for 50%","threshold":{"percentage":50,"value":true}}]}],"segments":[{"key":"segment1","name":"segment1","match_type":"ANY_MATCH_TYPE","description":"description","constraints":[{"type":"STRING_COMPARISON_TYPE","property":"foo","operator":"eq","value":"baz","description":"desc"},{"type":"STRING_COMPARISON_TYPE","property":"fizz","operator":"neq","value":"buzz","description":"desc"}]},{"key":"segment2","name":"segment2","match_type":"ANY_MATCH_TYPE","description":"description"}]}
1+
{"version":"1.4","namespace":{"key":"default","name":"default","description":"default namespace"}}
2+
{"namespace":{"key":"foo","name":"foo","description":"foo namespace"},"flags":[{"key":"flag1","name":"flag1","type":"VARIANT_FLAG_TYPE","description":"description","enabled":true,"variants":[{"key":"variant1","name":"variant1","attachment":{"answer":{"everything":42},"happy":true,"list":[1,0,2],"name":"Niels","nothing":null,"object":{"currency":"USD","value":42.99},"pi":3.141}},{"key":"foo"}],"rules":[{"segment":"segment1","distributions":[{"variant":"variant1","rollout":100}]},{"segment":{"keys":["segment1","segment2"],"operator":"AND_SEGMENT_OPERATOR"}}]},{"key":"flag2","name":"flag2","type":"BOOLEAN_FLAG_TYPE","description":"a boolean flag","enabled":false,"rollouts":[{"id":"1","description":"enabled for internal users","segment":{"key":"internal_users","value":true}},{"id":"2","description":"enabled for 50%","threshold":{"percentage":50,"value":true}}]}],"segments":[{"key":"segment1","name":"segment1","description":"description","constraints":[{"id":"1","type":"STRING_COMPARISON_TYPE","property":"foo","operator":"eq","value":"baz","description":"desc"},{"id":"2","type":"STRING_COMPARISON_TYPE","property":"fizz","operator":"neq","value":"buzz","description":"desc"}],"match_type":"ANY_MATCH_TYPE"},{"key":"segment2","name":"segment2","description":"description","match_type":"ANY_MATCH_TYPE"}]}
3+
{"namespace":{"key":"bar","name":"bar","description":"bar namespace"},"flags":[{"key":"flag1","name":"flag1","type":"VARIANT_FLAG_TYPE","description":"description","enabled":true,"variants":[{"key":"variant1","name":"variant1","attachment":{"answer":{"everything":42},"happy":true,"list":[1,0,2],"name":"Niels","nothing":null,"object":{"currency":"USD","value":42.99},"pi":3.141}},{"key":"foo"}],"rules":[{"segment":"segment1","distributions":[{"variant":"variant1","rollout":100}]},{"segment":{"keys":["segment1","segment2"],"operator":"AND_SEGMENT_OPERATOR"}}]},{"key":"flag2","name":"flag2","type":"BOOLEAN_FLAG_TYPE","description":"a boolean flag","enabled":false,"rollouts":[{"id":"1","description":"enabled for internal users","segment":{"key":"internal_users","value":true}},{"id":"2","description":"enabled for 50%","threshold":{"percentage":50,"value":true}}]}],"segments":[{"key":"segment1","name":"segment1","description":"description","constraints":[{"id":"1","type":"STRING_COMPARISON_TYPE","property":"foo","operator":"eq","value":"baz","description":"desc"},{"id":"2","type":"STRING_COMPARISON_TYPE","property":"fizz","operator":"neq","value":"buzz","description":"desc"}],"match_type":"ANY_MATCH_TYPE"},{"key":"segment2","name":"segment2","description":"description","match_type":"ANY_MATCH_TYPE"}]}

0 commit comments

Comments
 (0)