@@ -51,87 +51,107 @@ def test_app_size_action(fake_aab_size:, fake_apks:, expected_payload:, **other_
51
51
end
52
52
53
53
context 'when `include_split_sizes` is turned off' do
54
- it 'generates the expected payload compressed by default' do
55
- expected = {
56
- meta : [
57
- { name : 'Platform' , value : 'Android' } ,
58
- { name : 'App Name' , value : 'my-app' } ,
59
- { name : 'App Version' , value : '10.2-rc-3' } ,
60
- { name : 'Product Flavor' , value : 'Vanilla' } ,
61
- { name : 'Build Type' , value : 'Release' } ,
62
- { name : 'Source' , value : 'unit-test' } ,
63
- ] ,
64
- metrics : [
65
- { name : 'AAB File Size' , value : 123_456 } ,
66
- ]
67
- }
68
-
69
- test_app_size_action (
70
- fake_aab_size : 123_456 ,
71
- fake_apks : { } ,
72
- expected_payload : expected ,
73
- app_name : 'my-app' ,
74
- app_version_name : '10.2-rc-3' ,
75
- product_flavor : 'Vanilla' ,
76
- build_type : 'Release' ,
77
- source : 'unit-test' ,
78
- include_split_sizes : false
79
- )
54
+ context 'when only providing an `aab_path`' do
55
+ it 'generates the expected payload compressed by default' do
56
+ expected = {
57
+ meta : [
58
+ { name : 'Platform' , value : 'Android' } ,
59
+ { name : 'App Name' , value : 'my-app' } ,
60
+ { name : 'App Version' , value : '10.2-rc-3' } ,
61
+ { name : 'Product Flavor' , value : 'Vanilla' } ,
62
+ { name : 'Build Type' , value : 'Release' } ,
63
+ { name : 'Source' , value : 'unit-test' } ,
64
+ ] ,
65
+ metrics : [
66
+ { name : 'AAB File Size' , value : 123_456 } ,
67
+ ]
68
+ }
69
+
70
+ test_app_size_action (
71
+ fake_aab_size : 123_456 ,
72
+ fake_apks : { } ,
73
+ expected_payload : expected ,
74
+ app_name : 'my-app' ,
75
+ app_version_name : '10.2-rc-3' ,
76
+ product_flavor : 'Vanilla' ,
77
+ build_type : 'Release' ,
78
+ source : 'unit-test' ,
79
+ include_split_sizes : false
80
+ )
81
+ end
82
+
83
+ it 'generates the expected payload uncompressed when disabling gzip' do
84
+ expected = {
85
+ meta : [
86
+ { name : 'Platform' , value : 'Android' } ,
87
+ { name : 'App Name' , value : 'my-app' } ,
88
+ { name : 'App Version' , value : '10.2-rc-3' } ,
89
+ { name : 'Product Flavor' , value : 'Vanilla' } ,
90
+ { name : 'Build Type' , value : 'Release' } ,
91
+ { name : 'Source' , value : 'unit-test' } ,
92
+ ] ,
93
+ metrics : [
94
+ { name : 'AAB File Size' , value : 123_456 } ,
95
+ ]
96
+ }
97
+
98
+ test_app_size_action (
99
+ fake_aab_size : 123_456 ,
100
+ fake_apks : { } ,
101
+ expected_payload : expected ,
102
+ app_name : 'my-app' ,
103
+ app_version_name : '10.2-rc-3' ,
104
+ product_flavor : 'Vanilla' ,
105
+ build_type : 'Release' ,
106
+ source : 'unit-test' ,
107
+ include_split_sizes : false ,
108
+ use_gzip_content_encoding : false
109
+ )
110
+ end
80
111
end
81
112
82
- it 'generates the expected payload uncompressed when disabling gzip' do
83
- expected = {
84
- meta : [
85
- { name : 'Platform' , value : 'Android' } ,
86
- { name : 'App Name' , value : 'my-app' } ,
87
- { name : 'App Version' , value : '10.2-rc-3' } ,
88
- { name : 'Product Flavor' , value : 'Vanilla' } ,
89
- { name : 'Build Type' , value : 'Release' } ,
90
- { name : 'Source' , value : 'unit-test' } ,
91
- ] ,
92
- metrics : [
93
- { name : 'AAB File Size' , value : 123_456 } ,
94
- ]
95
- }
96
-
97
- test_app_size_action (
98
- fake_aab_size : 123_456 ,
99
- fake_apks : { } ,
100
- expected_payload : expected ,
101
- app_name : 'my-app' ,
102
- app_version_name : '10.2-rc-3' ,
103
- product_flavor : 'Vanilla' ,
104
- build_type : 'Release' ,
105
- source : 'unit-test' ,
106
- include_split_sizes : false ,
107
- use_gzip_content_encoding : false
108
- )
113
+ context 'when only providing an `universal_apk_path`' do
114
+ it 'generates the expected payload containing the apk file size'
115
+ end
116
+
117
+ context 'when providing both an `aab_path` and an `universal_apk_path`' do
118
+ it 'generates the expected payload containing the aab and universal apk file size'
109
119
end
110
120
end
111
121
112
122
context 'when keeping the default value of `include_split_sizes` turned on' do
113
- it 'generates the expected payload containing the aab file size and optimized split sizes' do
114
- expected_fixture = File . join ( test_data_dir , 'android-metrics-payload.json' )
115
- expected = JSON . parse ( File . read ( expected_fixture ) )
116
-
117
- test_app_size_action (
118
- fake_aab_size : 987_654_321 ,
119
- fake_apks : {
120
- 'base-arm64_v8a.apk' : [ 164_080 , 64_080 ] ,
121
- 'base-arm64_v8a_2.apk' : [ 164_082 , 64_082 ] ,
122
- 'base-armeabi.apk' : [ 150_000 , 50_000 ] ,
123
- 'base-armeabi_2.apk' : [ 150_002 , 50_002 ] ,
124
- 'base-armeabi_v7a.apk' : [ 150_070 , 50_070 ] ,
125
- 'base-armeabi_v7a_2.apk' : [ 150_072 , 50_072 ]
126
- } ,
127
- expected_payload : expected ,
128
- app_name : 'wordpress' ,
129
- app_version_name : '19.8-rc-3' ,
130
- app_version_code : 1214 ,
131
- product_flavor : 'Vanilla' ,
132
- build_type : 'Release' ,
133
- source : 'unit-test'
134
- )
123
+ context 'when only providing an `aab_path`' do
124
+ it 'generates the expected payload containing the aab file size and optimized split sizes' do
125
+ expected_fixture = File . join ( test_data_dir , 'android-metrics-payload.json' )
126
+ expected = JSON . parse ( File . read ( expected_fixture ) )
127
+
128
+ test_app_size_action (
129
+ fake_aab_size : 987_654_321 ,
130
+ fake_apks : {
131
+ 'base-arm64_v8a.apk' : [ 164_080 , 64_080 ] ,
132
+ 'base-arm64_v8a_2.apk' : [ 164_082 , 64_082 ] ,
133
+ 'base-armeabi.apk' : [ 150_000 , 50_000 ] ,
134
+ 'base-armeabi_2.apk' : [ 150_002 , 50_002 ] ,
135
+ 'base-armeabi_v7a.apk' : [ 150_070 , 50_070 ] ,
136
+ 'base-armeabi_v7a_2.apk' : [ 150_072 , 50_072 ]
137
+ } ,
138
+ expected_payload : expected ,
139
+ app_name : 'wordpress' ,
140
+ app_version_name : '19.8-rc-3' ,
141
+ app_version_code : 1214 ,
142
+ product_flavor : 'Vanilla' ,
143
+ build_type : 'Release' ,
144
+ source : 'unit-test'
145
+ )
146
+ end
147
+ end
148
+
149
+ context 'when only providing an `universal_apk_path`' do
150
+ it 'generates the expected payload containing the apk file size and optimized file and download sizes'
151
+ end
152
+
153
+ context 'when providing both an `aab_path` and an `universal_apk_path`' do
154
+ it 'generates the expected payload containing the aab and universal apk file size and optimized file and download sizes for all splits'
135
155
end
136
156
end
137
157
end
0 commit comments