Changeset 86252 in webkit
- Timestamp:
- May 11, 2011 12:12:20 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r86246 r86252 1 2011-05-11 Alice Boxhall <aboxhall@chromium.org> 2 3 Reviewed by Ojan Vafai. 4 5 Modify jsonresults_unittest.py to use a dict format for its test data, and modify jsonresults.py to flatten hierarchical directory structures in input JSON. 6 https://bugs.webkit.org/show_bug.cgi?id=60521 7 8 First steps towards making the results JSON all hierarchical. 9 10 * TestResultServer/model/jsonresults.py: 11 * TestResultServer/model/jsonresults_unittest.py: 12 1 13 2011-05-11 Kevin Ollivier <kevino@theolliviers.com> 2 14 -
trunk/Tools/TestResultServer/model/jsonresults.py
r75234 r86252 46 46 JSON_RESULTS_MIN_TIME = 1 47 47 JSON_RESULTS_VERSION = 3 48 JSON_RESULTS_HIERARCHICAL_VERSION = 4 48 49 JSON_RESULTS_MAX_BUILDS = 750 49 50 JSON_RESULTS_MAX_BUILDS_SMALL = 200 … … 320 321 321 322 @classmethod 323 def _flatten_json_tests(cls, json, prefix=None): 324 """Flattens a trie directory structure in tests into a flat structure. 325 326 Args: 327 json: json tests structure. 328 prefix: aleady-computed path to append to the eventual test name, if any. 329 330 Returns: 331 The flattened json tests structure. 332 """ 333 result = {} 334 for name, test in json.iteritems(): 335 if prefix: 336 fullname = prefix + "/" + name 337 else: 338 fullname = name 339 340 if "results" in test: 341 result[fullname] = test 342 else: 343 result.update(cls._flatten_json_tests(test, fullname)) 344 345 return result 346 347 @classmethod 322 348 def _check_json(cls, builder, json): 323 349 """Check whether the given json is valid. 350 Converts partially-supported json to supported version json. 324 351 325 352 Args: 326 353 builder: builder name this json is for. 327 json: json object to check .354 json: json object to check and convert if necessary. 328 355 329 356 Returns: … … 333 360 334 361 version = json[JSON_RESULTS_VERSION_KEY] 335 if version > JSON_RESULTS_ VERSION:362 if version > JSON_RESULTS_HIERARCHICAL_VERSION: 336 363 logging.error("Results JSON version '%s' is not supported.", 337 364 version) … … 346 373 logging.error("Missing build number in json results.") 347 374 return False 375 376 # FIXME(aboxhall): Once the dashboard can read hierarchical JSON, both 377 # incremental and aggregated JSON can be hierarchical, with no need to 378 # flatten here. 379 if version == JSON_RESULTS_HIERARCHICAL_VERSION: 380 flattened_tests = cls._flatten_json_tests(results_for_builder[JSON_RESULTS_TESTS]) 381 json[builder][JSON_RESULTS_TESTS] = flattened_tests 382 json[JSON_RESULTS_VERSION_KEY] = JSON_RESULTS_VERSION 348 383 349 384 return True -
trunk/Tools/TestResultServer/model/jsonresults_unittest.py
r86063 r86252 32 32 except ImportError: 33 33 print "ERROR: Add the TestResultServer, google_appengine and yaml/lib directories to your PYTHONPATH" 34 raise 34 35 35 36 import unittest … … 49 50 '"wontfixCounts":[[TESTDATA_COUNTS]]' 50 51 '},' 51 '"version": 3'52 '"version":[VERSION]' 52 53 '}') 53 54 … … 63 64 '"Z":[TESTDATA]}') 64 65 66 JSON_RESULTS_DIRECTORY_TEMPLATE = '"[TESTDATA_DIRECTORY]":{[TESTDATA_DATA]}' 67 65 68 JSON_RESULTS_TESTS_TEMPLATE = ( 66 69 '"[TESTDATA_TEST_NAME]":{' … … 83 86 return JSON_RESULTS_PREFIX + JSON_RESULTS_SUFFIX 84 87 85 (builds, tests) = test_data 88 builds = test_data["builds"] 89 tests = test_data["tests"] 86 90 if not builds or not tests: 87 91 return JSON_RESULTS_PREFIX + JSON_RESULTS_SUFFIX … … 108 112 json = json.replace("[TESTDATA_TIMES]", ",".join(times)) 109 113 114 if "version" in test_data: 115 json = json.replace("[VERSION]", str(test_data["version"])) 116 else: 117 json = json.replace("[VERSION]", "3") 118 110 119 json_tests = [] 111 for test in tests: 112 t = JSON_RESULTS_TESTS_TEMPLATE.replace("[TESTDATA_TEST_NAME]", test[0]) 113 t = t.replace("[TESTDATA_TEST_RESULTS]", test[1]) 114 t = t.replace("[TESTDATA_TEST_TIMES]", test[2]) 115 json_tests.append(t) 120 for (name, test) in sorted(tests.iteritems()): 121 json_tests.append(self._parse_tests_dict(name, test)) 116 122 117 123 json = json.replace("[TESTDATA_TESTS]", ",".join(json_tests)) 118 124 119 125 return JSON_RESULTS_PREFIX + json + JSON_RESULTS_SUFFIX 126 127 def _parse_tests_dict(self, name, test): 128 if "results" in test: 129 test_results = JSON_RESULTS_TESTS_TEMPLATE.replace("[TESTDATA_TEST_NAME]", name) 130 test_results = test_results.replace("[TESTDATA_TEST_RESULTS]", test["results"]) 131 test_results = test_results.replace("[TESTDATA_TEST_TIMES]", test["times"]) 132 return test_results 133 134 test_results = JSON_RESULTS_DIRECTORY_TEMPLATE.replace("[TESTDATA_DIRECTORY]", name) 135 testdata = [] 136 for (child_name, child_test) in sorted(test.iteritems()): 137 testdata.append(self._parse_tests_dict(child_name, child_test)) 138 test_results = test_results.replace("[TESTDATA_DATA]", ",".join(testdata)) 139 return test_results 120 140 121 141 def _test_merge(self, aggregated_data, incremental_data, expected_data, max_builds=jsonresults.JSON_RESULTS_MAX_BUILDS): … … 152 172 self._test_merge( 153 173 # Aggregated results 154 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]), 174 {"builds": ["2", "1"], 175 "tests": {"001.html": { 176 "results": "[200,\"F\"]", 177 "times": "[200,0]"}}}, 155 178 # Incremental results 156 179 None, … … 163 186 self._test_merge( 164 187 # Aggregated results 165 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]), 166 # Incremental results 167 ([], []), 188 {"builds": ["2", "1"], 189 "tests": {"001.html": { 190 "results": "[200,\"F\"]", 191 "times": "[200,0]"}}}, 192 # Incremental results 193 {"builds": [], 194 "tests": {}}, 168 195 # Expected no merge happens. 169 196 None) … … 176 203 None, 177 204 # Incremental results 178 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]), 179 # Expected results 180 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]])) 205 206 {"builds": ["2", "1"], 207 "tests": {"001.html": { 208 "results": "[200,\"F\"]", 209 "times": "[200,0]"}}}, 210 # Expected result 211 {"builds": ["2", "1"], 212 "tests": {"001.html": { 213 "results": "[200,\"F\"]", 214 "times": "[200,0]"}}}) 181 215 182 216 def test_merge_incremental_single_test_single_run_same_result(self): … … 187 221 self._test_merge( 188 222 # Aggregated results 189 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]), 190 # Incremental results 191 (["3"], [["001.html", "[1,\"F\"]", "[1,0]"]]), 192 # Expected results 193 (["3", "2", "1"], [["001.html", "[201,\"F\"]", "[201,0]"]])) 223 {"builds": ["2", "1"], 224 "tests": {"001.html": { 225 "results": "[200,\"F\"]", 226 "times": "[200,0]"}}}, 227 # Incremental results 228 {"builds": ["3"], 229 "tests": {"001.html": { 230 "results": "[1,\"F\"]", 231 "times": "[1,0]"}}}, 232 # Expected results 233 {"builds": ["3", "2", "1"], 234 "tests": {"001.html": { 235 "results": "[201,\"F\"]", 236 "times": "[201,0]"}}}) 194 237 195 238 def test_merge_single_test_single_run_different_result(self): … … 199 242 self._test_merge( 200 243 # Aggregated results 201 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]), 202 # Incremental results 203 (["3"], [["001.html", "[1, \"I\"]", "[1,1]"]]), 204 # Expected results 205 (["3", "2", "1"], [["001.html", "[1,\"I\"],[200,\"F\"]", "[1,1],[200,0]"]])) 244 {"builds": ["2", "1"], 245 "tests": {"001.html": { 246 "results": "[200,\"F\"]", 247 "times": "[200,0]"}}}, 248 # Incremental results 249 {"builds": ["3"], 250 "tests": {"001.html": { 251 "results": "[1, \"I\"]", 252 "times": "[1,1]"}}}, 253 # Expected results 254 {"builds": ["3", "2", "1"], 255 "tests": {"001.html": { 256 "results": "[1,\"I\"],[200,\"F\"]", 257 "times": "[1,1],[200,0]"}}}) 206 258 207 259 def test_merge_single_test_single_run_result_changed(self): … … 210 262 self._test_merge( 211 263 # Aggregated results 212 (["2", "1"], [["001.html", "[200,\"F\"],[10,\"I\"]", "[200,0],[10,1]"]]), 213 # Incremental results 214 (["3"], [["001.html", "[1,\"I\"]", "[1,1]"]]), 215 # Expected results 216 (["3", "2", "1"], [["001.html", "[1,\"I\"],[200,\"F\"],[10,\"I\"]", "[1,1],[200,0],[10,1]"]])) 264 {"builds": ["2", "1"], 265 "tests": {"001.html": { 266 "results": "[200,\"F\"],[10,\"I\"]", 267 "times": "[200,0],[10,1]"}}}, 268 # Incremental results 269 {"builds": ["3"], 270 "tests": {"001.html": { 271 "results": "[1,\"I\"]", 272 "times": "[1,1]"}}}, 273 # Expected results 274 {"builds": ["3", "2", "1"], 275 "tests": {"001.html": { 276 "results": "[1,\"I\"],[200,\"F\"],[10,\"I\"]", 277 "times": "[1,1],[200,0],[10,1]"}}}) 217 278 218 279 def test_merge_multiple_tests_single_run(self): … … 220 281 self._test_merge( 221 282 # Aggregated results 222 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"], ["002.html", "[100,\"I\"]", "[100,1]"]]), 223 # Incremental results 224 (["3"], [["001.html", "[1,\"F\"]", "[1,0]"], ["002.html", "[1,\"I\"]", "[1,1]"]]), 225 # Expected results 226 (["3", "2", "1"], [["001.html", "[201,\"F\"]", "[201,0]"], ["002.html", "[101,\"I\"]", "[101,1]"]])) 283 {"builds": ["2", "1"], 284 "tests": {"001.html": { 285 "results": "[200,\"F\"]", 286 "times": "[200,0]"}, 287 "002.html": { 288 "results": "[100,\"I\"]", 289 "times": "[100,1]"}}}, 290 # Incremental results 291 {"builds": ["3"], 292 "tests": {"001.html": { 293 "results": "[1,\"F\"]", 294 "times": "[1,0]"}, 295 "002.html": { 296 "results": "[1,\"I\"]", 297 "times": "[1,1]"}}}, 298 # Expected results 299 {"builds": ["3", "2", "1"], 300 "tests": {"001.html": { 301 "results": "[201,\"F\"]", 302 "times": "[201,0]"}, 303 "002.html": { 304 "results": "[101,\"I\"]", 305 "times": "[101,1]"}}}) 227 306 228 307 def test_merge_multiple_tests_single_run_one_no_result(self): 229 308 self._test_merge( 230 309 # Aggregated results 231 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"], ["002.html", "[100,\"I\"]", "[100,1]"]]), 232 # Incremental results 233 (["3"], [["002.html", "[1,\"I\"]", "[1,1]"]]), 234 # Expected results 235 (["3", "2", "1"], [["001.html", "[1,\"N\"],[200,\"F\"]", "[201,0]"], ["002.html", "[101,\"I\"]", "[101,1]"]])) 310 {"builds": ["2", "1"], 311 "tests": {"001.html": { 312 "results": "[200,\"F\"]", 313 "times": "[200,0]"}, 314 "002.html": { 315 "results": "[100,\"I\"]", 316 "times": "[100,1]"}}}, 317 # Incremental results 318 {"builds": ["3"], 319 "tests": {"002.html": { 320 "results": "[1,\"I\"]", 321 "times": "[1,1]"}}}, 322 # Expected results 323 {"builds": ["3", "2", "1"], 324 "tests": {"001.html": { 325 "results": "[1,\"N\"],[200,\"F\"]", 326 "times": "[201,0]"}, 327 "002.html": { 328 "results": "[101,\"I\"]", 329 "times": "[101,1]"}}}) 236 330 237 331 def test_merge_single_test_multiple_runs(self): 238 332 self._test_merge( 239 333 # Aggregated results 240 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]), 241 # Incremental results 242 (["4", "3"], [["001.html", "[2, \"I\"]", "[2,2]"]]), 243 # Expected results 244 (["4", "3", "2", "1"], [["001.html", "[2,\"I\"],[200,\"F\"]", "[2,2],[200,0]"]])) 334 {"builds": ["2", "1"], 335 "tests": {"001.html": { 336 "results": "[200,\"F\"]", 337 "times": "[200,0]"}}}, 338 # Incremental results 339 {"builds": ["4", "3"], 340 "tests": {"001.html": { 341 "results": "[2, \"I\"]", 342 "times": "[2,2]"}}}, 343 # Expected results 344 {"builds": ["4", "3", "2", "1"], 345 "tests": {"001.html": { 346 "results": "[2,\"I\"],[200,\"F\"]", 347 "times": "[2,2],[200,0]"}}}) 245 348 246 349 def test_merge_multiple_tests_multiple_runs(self): 247 350 self._test_merge( 248 351 # Aggregated results 249 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"], ["002.html", "[10,\"Z\"]", "[10,0]"]]), 250 # Incremental results 251 (["4", "3"], [["001.html", "[2, \"I\"]", "[2,2]"], ["002.html", "[1,\"C\"]", "[1,1]"]]), 252 # Expected results 253 (["4", "3", "2", "1"], [["001.html", "[2,\"I\"],[200,\"F\"]", "[2,2],[200,0]"], ["002.html", "[1,\"C\"],[10,\"Z\"]", "[1,1],[10,0]"]])) 352 {"builds": ["2", "1"], 353 "tests": {"001.html": { 354 "results": "[200,\"F\"]", 355 "times": "[200,0]"}, 356 "002.html": { 357 "results": "[10,\"Z\"]", 358 "times": "[10,0]"}}}, 359 # Incremental results 360 {"builds": ["4", "3"], 361 "tests": {"001.html": { 362 "results": "[2, \"I\"]", 363 "times": "[2,2]"}, 364 "002.html": { 365 "results": "[1,\"C\"]", 366 "times": "[1,1]"}}}, 367 # Expected results 368 {"builds": ["4", "3", "2", "1"], 369 "tests": {"001.html": { 370 "results": "[2,\"I\"],[200,\"F\"]", 371 "times": "[2,2],[200,0]"}, 372 "002.html": { 373 "results": "[1,\"C\"],[10,\"Z\"]", 374 "times": "[1,1],[10,0]"}}}) 254 375 255 376 def test_merge_incremental_result_older_build(self): … … 259 380 self._test_merge( 260 381 # Aggregated results 261 (["3", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]), 262 # Incremental results 263 (["2"], [["001.html", "[1, \"F\"]", "[1,0]"]]), 382 {"builds": ["3", "1"], 383 "tests": {"001.html": { 384 "results": "[200,\"F\"]", 385 "times": "[200,0]"}}}, 386 # Incremental results 387 {"builds": ["2"], 388 "tests": {"001.html": { 389 "results": "[1, \"F\"]", 390 "times": "[1,0]"}}}, 264 391 # Expected no merge happens. 265 392 None) … … 271 398 self._test_merge( 272 399 # Aggregated results 273 (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]), 274 # Incremental results 275 (["3", "2"], [["001.html", "[2, \"F\"]", "[2,0]"]]), 400 {"builds": ["2", "1"], 401 "tests": {"001.html": { 402 "results": "[200,\"F\"]", 403 "times": "[200,0]"}}}, 404 # Incremental results 405 {"builds": ["3", "2"], 406 "tests": {"001.html": { 407 "results": "[2, \"F\"]", 408 "times": "[2,0]"}}}, 276 409 # Expected no merge happens. 277 410 None) … … 281 414 self._test_merge( 282 415 # Aggregated results 283 (["2", "1"], [["001.html", "[200,\"N\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]), 284 # Incremental results 285 (["3"], [["001.html", "[1,\"N\"]", "[1,0]"], ["002.html", "[1,\"P\"]", "[1,0]"]]), 286 # Expected results 287 (["3", "2", "1"], [["002.html", "[1,\"P\"],[10,\"F\"]", "[11,0]"]])) 416 {"builds": ["2", "1"], 417 "tests": {"001.html": { 418 "results": "[200,\"N\"]", 419 "times": "[200,0]"}, 420 "002.html": { 421 "results": "[10,\"F\"]", 422 "times": "[10,0]"}}}, 423 # Incremental results 424 {"builds": ["3"], 425 "tests": {"001.html": { 426 "results": "[1,\"N\"]", 427 "times": "[1,0]"}, 428 "002.html": { 429 "results": "[1,\"P\"]", 430 "times": "[1,0]"}}}, 431 # Expected results 432 {"builds": ["3", "2", "1"], 433 "tests": {"002.html": { 434 "results": "[1,\"P\"],[10,\"F\"]", 435 "times": "[11,0]"}}}) 288 436 289 437 def test_merge_remove_test_with_all_pass(self): … … 291 439 self._test_merge( 292 440 # Aggregated results 293 (["2", "1"], [["001.html", "[200,\"P\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]), 294 # Incremental results 295 (["3"], [["001.html", "[1,\"P\"]", "[1,0]"], ["002.html", "[1,\"P\"]", "[1,0]"]]), 296 # Expected results 297 (["3", "2", "1"], [["002.html", "[1,\"P\"],[10,\"F\"]", "[11,0]"]])) 441 {"builds": ["2", "1"], 442 "tests": {"001.html": { 443 "results": "[200,\"P\"]", 444 "times": "[200,0]"}, 445 "002.html": { 446 "results": "[10,\"F\"]", 447 "times": "[10,0]"}}}, 448 # Incremental results 449 {"builds": ["3"], 450 "tests": {"001.html": { 451 "results": "[1,\"P\"]", 452 "times": "[1,0]"}, 453 "002.html": { 454 "results": "[1,\"P\"]", 455 "times": "[1,0]"}}}, 456 # Expected results 457 {"builds": ["3", "2", "1"], 458 "tests": {"002.html": { 459 "results": "[1,\"P\"],[10,\"F\"]", 460 "times": "[11,0]"}}}) 298 461 299 462 def test_merge_keep_test_with_all_pass_but_slow_time(self): … … 301 464 self._test_merge( 302 465 # Aggregated results 303 (["2", "1"], [["001.html", "[200,\"P\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]), 304 # Incremental results 305 (["3"], [["001.html", "[1,\"P\"]", "[1,1]"], ["002.html", "[1,\"P\"]", "[1,0]"]]), 306 # Expected results 307 (["3", "2", "1"], [["001.html", "[201,\"P\"]", "[1,1],[200,0]"], ["002.html", "[1,\"P\"],[10,\"F\"]", "[11,0]"]])) 466 {"builds": ["2", "1"], 467 "tests": {"001.html": { 468 "results": "[200,\"P\"]", 469 "times": "[200,0]"}, 470 "002.html": { 471 "results": "[10,\"F\"]", 472 "times": "[10,0]"}}}, 473 # Incremental results 474 {"builds": ["3"], 475 "tests": {"001.html": { 476 "results": "[1,\"P\"]", 477 "times": "[1,1]"}, 478 "002.html": { 479 "results": "[1,\"P\"]", 480 "times": "[1,0]"}}}, 481 # Expected results 482 {"builds": ["3", "2", "1"], 483 "tests": {"001.html": { 484 "results": "[201,\"P\"]", 485 "times": "[1,1],[200,0]"}, 486 "002.html": { 487 "results": "[1,\"P\"],[10,\"F\"]", 488 "times": "[11,0]"}}}) 308 489 309 490 def test_merge_prune_extra_results(self): … … 313 494 self._test_merge( 314 495 # Aggregated results 315 (["2", "1"], [["001.html", "[" + max_builds + ",\"F\"],[1,\"I\"]", "[" + max_builds + ",0],[1,1]"]]), 316 # Incremental results 317 (["3"], [["001.html", "[1,\"T\"]", "[1,1]"]]), 318 # Expected results 319 (["3", "2", "1"], [["001.html", "[1,\"T\"],[" + max_builds + ",\"F\"]", "[1,1],[" + max_builds + ",0]"]])) 496 {"builds": ["2", "1"], 497 "tests": {"001.html": { 498 "results": "[" + max_builds + ",\"F\"],[1,\"I\"]", 499 "times": "[" + max_builds + ",0],[1,1]"}}}, 500 # Incremental results 501 {"builds": ["3"], 502 "tests": {"001.html": { 503 "results": "[1,\"T\"]", 504 "times": "[1,1]"}}}, 505 # Expected results 506 {"builds": ["3", "2", "1"], 507 "tests": {"001.html": { 508 "results": "[1,\"T\"],[" + max_builds + ",\"F\"]", 509 "times": "[1,1],[" + max_builds + ",0]"}}}) 320 510 321 511 def test_merge_prune_extra_results_small(self): … … 325 515 self._test_merge( 326 516 # Aggregated results 327 (["2", "1"], [["001.html", "[" + max_builds + ",\"F\"],[1,\"I\"]", "[" + max_builds + ",0],[1,1]"]]), 328 # Incremental results 329 (["3"], [["001.html", "[1,\"T\"]", "[1,1]"]]), 330 # Expected results 331 (["3", "2", "1"], [["001.html", "[1,\"T\"],[" + max_builds + ",\"F\"]", "[1,1],[" + max_builds + ",0]"]]), 517 {"builds": ["2", "1"], 518 "tests": {"001.html": { 519 "results": "[" + max_builds + ",\"F\"],[1,\"I\"]", 520 "times": "[" + max_builds + ",0],[1,1]"}}}, 521 # Incremental results 522 {"builds": ["3"], 523 "tests": {"001.html": { 524 "results": "[1,\"T\"]", 525 "times": "[1,1]"}}}, 526 # Expected results 527 {"builds": ["3", "2", "1"], 528 "tests": {"001.html": { 529 "results": "[1,\"T\"],[" + max_builds + ",\"F\"]", 530 "times": "[1,1],[" + max_builds + ",0]"}}}, 332 531 int(max_builds)) 333 532 … … 338 537 self._test_merge( 339 538 # Aggregated results 340 (["2", "1"], [["001.html", "[" + max_builds + ",\"F\"],[1,\"N\"]", "[" + max_builds + ",0],[1,1]"]]), 341 # Incremental results 342 (["3"], [["001.html", "[1,\"F\"]", "[1,0]"]]), 343 # Expected results 344 (["3", "2", "1"], [["001.html", "[" + max_builds + ",\"F\"]", "[" + max_builds + ",0]"]]), 539 {"builds": ["2", "1"], 540 "tests": {"001.html": { 541 "results": "[" + max_builds + ",\"F\"],[1,\"N\"]", 542 "times": "[" + max_builds + ",0],[1,1]"}}}, 543 # Incremental results 544 {"builds": ["3"], 545 "tests": {"001.html": { 546 "results": "[1,\"F\"]", 547 "times": "[1,0]"}}}, 548 # Expected results 549 {"builds": ["3", "2", "1"], 550 "tests": {"001.html": { 551 "results": "[" + max_builds + ",\"F\"]", 552 "times": "[" + max_builds + ",0]"}}}, 345 553 int(max_builds)) 554 555 def test_merge_build_directory_hierarchy(self): 556 self._test_merge( 557 # Aggregated results 558 {"builds": ["2", "1"], 559 "tests": {"foo/001.html": { 560 "results": "[50,\"F\"]", 561 "times": "[50,0]"}, 562 "foo/002.html": { 563 "results": "[100,\"I\"]", 564 "times": "[100,0]"}}}, 565 # Incremental results 566 {"builds": ["3"], 567 "tests": {"foo": { 568 "001.html": { 569 "results": "[1,\"F\"]", 570 "times": "[1,0]"}, 571 "002.html": { 572 "results": "[1,\"I\"]", 573 "times": "[1,0]"}}}, 574 "version": 4}, 575 # Expected results 576 {"builds": ["3", "2", "1"], 577 "tests": {"foo/001.html": { 578 "results": "[51,\"F\"]", 579 "times": "[51,0]"}, 580 "foo/002.html": { 581 "results": "[101,\"I\"]", 582 "times": "[101,0]"}}, 583 "version": 3}) 584 585 # FIXME(aboxhall): Add some tests for xhtml/svg test results. 346 586 347 587 def test_get_test_name_list(self): … … 350 590 self._test_get_test_list( 351 591 # Input results 352 (["3", "2", "1"], [["001.html", "[200,\"P\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]), 592 {"builds": ["3", "2", "1"], 593 "tests": {"001.html": { 594 "results": "[200,\"P\"]", 595 "times": "[200,0]"}, 596 "002.html": { 597 "results": "[10,\"F\"]", 598 "times": "[10,0]"}}}, 353 599 # Expected results 354 600 ["001.html", "002.html"])
Note: See TracChangeset
for help on using the changeset viewer.