@@ -190,107 +190,6 @@ public function testVerifyResults()
190190 return $ success ;
191191 }
192192
193- public function testCompareCoverage (): void
194- {
195- $ answers = [
196- 'Total ' => [
197- 'debug ' => 68.97 ,
198- 'release ' => 51.35 ,
199- 'aggregate ' => 72.97 ],
200- 'Third Party ' => [
201- 'debug ' => 100 ,
202- 'release ' => 53.85 ,
203- 'aggregate ' => 69.23 ],
204- 'Experimental ' => [
205- 'debug ' => 62.5 ,
206- 'release ' => 50 ,
207- 'aggregate ' => 75 ],
208- 'Production ' => [
209- 'debug ' => 62.5 ,
210- 'release ' => 50 ,
211- 'aggregate ' => 75 ]];
212- $ this ->compareCoverageCheck ('' , $ answers );
213- }
214-
215- public function testCompareCoverageWithFilters (): void
216- {
217- $ extra_url = '&filtercount=1&showfilters=1&field1=subproject&compare1=62&value1=MyReleaseOnlyFeature ' ;
218- $ answers = [
219- 'Total ' => [
220- 'debug ' => 68.97 ,
221- 'release ' => 51.72 ,
222- 'aggregate ' => 79.31 ],
223- 'Third Party ' => [
224- 'debug ' => 100 ,
225- 'release ' => 60 ,
226- 'aggregate ' => 100 ],
227- 'Experimental ' => [
228- 'debug ' => 62.5 ,
229- 'release ' => 50 ,
230- 'aggregate ' => 75 ],
231- 'Production ' => [
232- 'debug ' => 62.5 ,
233- 'release ' => 50 ,
234- 'aggregate ' => 75 ]];
235- $ this ->compareCoverageCheck ($ extra_url , $ answers );
236- }
237-
238- public function compareCoverageCheck ($ extra_url , $ answers ): void
239- {
240- // Load test data from API.
241- $ this ->get ($ this ->url . "/api/v1/compareCoverage.php?project=CrossSubProjectExample&date=2016-02-16 $ extra_url " );
242- $ content = $ this ->getBrowser ()->getContent ();
243- $ jsonobj = json_decode ($ content , true );
244-
245- // Verify correct number of builds.
246- $ num_builds = count ($ jsonobj ['builds ' ]);
247- if ($ num_builds !== 3 ) {
248- $ this ->fail ("Expected 3 builds, found $ num_builds " );
249- }
250-
251- // Figure out how to distinguish between our coverage builds.
252- $ builds = [];
253- foreach ($ jsonobj ['builds ' ] as $ build ) {
254- switch ($ build ['name ' ]) {
255- case 'debug_coverage ' :
256- $ builds ['debug ' ] = $ build ['key ' ];
257- break ;
258- case 'release_coverage ' :
259- $ builds ['release ' ] = $ build ['key ' ];
260- break ;
261- case 'Aggregate Coverage ' :
262- $ builds ['aggregate ' ] = $ build ['key ' ];
263- break ;
264- default :
265- $ this ->fail ('Unexpected build: ' . $ build ['name ' ]);
266- break ;
267- }
268- }
269-
270- // Verify number of groups.
271- $ num_groups = count ($ jsonobj ['coveragegroups ' ]);
272- if ($ num_groups !== 4 ) {
273- $ this ->fail ("Expected 4 coveragegroups, found $ num_groups " );
274- }
275-
276- // Verify coverage percentage numbers.
277- foreach ($ jsonobj ['coveragegroups ' ] as $ group ) {
278- $ groupname = $ group ['label ' ];
279- if (!array_key_exists ($ groupname , $ answers )) {
280- $ this ->fail ("Unexpected group: $ groupname " );
281- continue ;
282- }
283-
284- foreach ($ builds as $ buildtype => $ key ) {
285- $ expected = $ answers [$ groupname ][$ buildtype ];
286- $ found = $ group [$ key ];
287- if ($ expected !== $ found ) {
288- $ this ->fail ("Expected $ expected but found $ found for $ buildtype $ groupname " );
289- }
290- }
291- }
292- }
293-
294193 public function checkCoverage ($ coverage , $ expected_loctested ,
295194 $ expected_locuntested , $ expected_percentage ,
296195 $ name )
0 commit comments