Changeset 252490 in webkit
- Timestamp:
- Nov 15, 2019 11:18:52 AM (4 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r252489 r252490 1 2019-11-15 Jonathan Bedard <jbedard@apple.com> 2 3 results.webkit.org: Report JSC tests to the results database 4 https://bugs.webkit.org/show_bug.cgi?id=204091 5 <rdar://problem/49778900> 6 7 Reviewed by Aakash Jain. 8 9 Upload results to the specified results database. 10 11 DEMONSTRATION OF FAILURE IN EWS BEHAVIOR, DO NOT LAND! 12 13 * Scripts/run-javascriptcore-tests: 14 (runTest): Parse binary output to mark individual tests as passing 15 or failing. 16 (uploadConfiguration): Return a hash map representing the configuration 17 For this specific test run. 18 (uploadResults): If a report URL is defined, upload test results to that URL. 19 * Scripts/webkitdirs.pm: 20 (splitVersionString): splitVersionString is supposed to be a generally used 21 function, so should not set a global variable. 22 (determineOSXVersion): Remove newline from version number. 23 1 24 2019-11-15 Jonathan Bedard <jbedard@apple.com> 2 25 -
trunk/Tools/Scripts/run-javascriptcore-tests
r251161 r252490 58 58 my $memoryLimited; 59 59 60 my $report; 61 my $buildbotMaster; 62 my $builderName; 63 my $buildNumber; 64 my $buildbotWorker; 65 60 66 my $buildJSC = 1; 61 67 my $copyJSC = 1; … … 92 98 my $remoteHost = 0; 93 99 my $model = 0; 100 my $version; 101 my $versionName; 102 my $sdk; 94 103 my $failFast = 1; 95 104 my %jsonData = (); 105 my %reportData = (); 96 106 my @testResults = (); 97 107 my $isTestFailed = 0; … … 232 242 --remote-config-file= Same as remote, but read config from JSON file. 233 243 --model= Specify remote hardware model, this info used for determine what jsc tests should run on remote 244 --version Specify the version number of the device running tests. 245 --version-name Specify the version name of the hardware running tests. 246 --sdk Specific SDK or OS version of the form ##*### 234 247 --extra-tests= Path to a file containing extra tests 235 248 --child-processes= Specify the number of child processes. … … 252 265 --gmalloc: Run tests with Guard Malloc enabled (if no path is given: $gmallocDefaultPath is used) 253 266 --verbose: Verbose output (specify more than once to increase verbosity). 267 268 --report: Results database url to report results to. 269 --buildbot-master: The url of the buildbot master. 270 --builder-name: The name of the buildbot builder tests were run on. 271 --build-number: The buildbot build number tests are associated with. 272 --buildbot-worker: The buildbot worker tests were run on. 254 273 255 274 Environment Variables: … … 290 309 'remote=s' => \$remoteHost, 291 310 'model=s' => \$model, 311 'version=s' => \$version, 312 'version-name=s' => \$versionName, 313 'sdk=s' => \$sdk, 292 314 'remote-config-file=s' => \$remoteConfigFile, 293 315 'child-processes=s' => \$childProcesses, … … 301 323 'env-vars=s' => \$envVars, 302 324 'gmalloc:s' => \$gmallocPath, 303 'verbose+' => \$verbose 325 'verbose+' => \$verbose, 326 'report=s' => \$report, 327 'buildbot-master=s' => \$buildbotMaster, 328 'builder-name=s' => \$builderName, 329 'build-number=s' => \$buildNumber, 330 'buildbot-worker=s' => \$buildbotWorker, 304 331 ); 305 332 … … 316 343 } 317 344 345 if ($version) { 346 $version = splitVersionString($version); 347 } 348 318 349 sub enableTestOrNot { 319 350 my ($state) = @_; … … 324 355 } 325 356 return $state; 357 } 358 359 sub configurationForUpload() 360 { 361 my $platform; 362 my $sdk; 363 my $simulator = 0; 364 365 if (index(xcodeSDKPlatformName(), "simulator") != -1) { 366 $simulator = 1; 367 } 368 369 if (index($model, 'iPhone') != -1 || index($model, 'iPad') != -1) { 370 $platform = 'ios'; 371 if (!$version) { 372 $version = iosVersion(); 373 } 374 } elsif (index($model, 'watch') != -1 || index(xcodeSDKPlatformName(), "watch") != -1) { 375 $platform = 'watchos'; 376 die "No watchOS version specified" if !$version; 377 } elsif (index(xcodeSDKPlatformName(), "appletv") != -1) { 378 $platform = 'tvos'; 379 die "No tvOS version specified" if !$version; 380 } elsif (isGtk()) { 381 $platform = 'GTK'; 382 if (!$version) { 383 chomp($version = `/usr/bin/uname -r`); 384 $version = splitVersionString($version); 385 } 386 } elsif (isWPE()) { 387 $platform = 'WPE'; 388 if (!$version) { 389 chomp($version = `/usr/bin/uname -r`); 390 $version = splitVersionString($version); 391 } 392 } elsif (isAnyWindows()) { 393 $platform = 'win'; 394 if (!$version) { 395 $version = winVersion(); 396 } 397 } elsif (isAppleMacWebKit()) { 398 $platform = 'mac'; 399 chomp($model = `/usr/sbin/sysctl -n hw.model`); 400 if (!$version) { 401 $version = osXVersion(); 402 } 403 if (!$sdk) { 404 chomp($sdk = `/usr/bin/sw_vers -buildVersion`); 405 } 406 407 if (!$versionName) { 408 if ($version->{minor} eq 15) { 409 $versionName = "Catalina"; 410 } elsif ($version->{minor} eq 14) { 411 $versionName = "Mojave"; 412 } elsif ($version->{minor} eq 13) { 413 $versionName = "High Sierra"; 414 } 415 } 416 } else { 417 die "Cannot determine platform\n"; 418 } 419 420 my $result = { 421 platform => $platform, 422 architecture => architecture(), 423 is_simulator => $simulator, 424 style => lc(configuration()), 425 version => "$version->{major}.$version->{minor}.$version->{subminor}", 426 }; 427 if ($model) { 428 $result->{model} = $model; 429 } 430 if ($versionName) { 431 $result->{version_name} = $versionName; 432 } 433 if ($sdk) { 434 $result->{sdk} = $sdk; 435 } 436 return $result; 326 437 } 327 438 … … 343 454 344 455 setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root)); 456 configurationForUpload() if (defined($report)); 345 457 346 458 if (defined($jsonFileName)) { … … 375 487 setPathForRunningWebKitApp(\%ENV) if isCygwin(); 376 488 489 my $startTime = time(); 490 my $endTime = $startTime; 491 377 492 sub testPath { 378 493 my ($productDir, $testName) = @_; … … 398 513 } 399 514 400 # Use an "indirect object" so that system() won't get confused if the path 401 # contains spaces (see perldoc -f exec). 402 my $testResult = system { $command[0] } @command; 515 my $testResult = 0; 516 my $failureFlag = 0; 517 my $lastOptimizeLevel; 518 519 open(TEST, "-|", "@command 2>&1") or die "Failed to run @command"; 520 while ( my $line = <TEST> ) { 521 my $subTestName; 522 print $line; 523 524 # e.g.: 'O2: testRotRWithImmShift(uint64-max, uint32-min): OK!'' 525 if ($line =~ /(O\d): (\S+)(\(.*\)): ([A-Za-z]+)!\n/) { 526 $lastOptimizeLevel = $1; 527 $subTestName = "$testName.$1.$2$3"; 528 $failureFlag += 1 if ($4 ne "OK"); 529 } 530 # Assertion in binary 531 # e.g.: ASSERTION FAILED: things[0] == 2 532 elsif ($line =~ /ASSERTION FAILED:/) { 533 $failureFlag += 1; 534 next; 535 } 536 # e.g.: file/path(397) : void (anonymous namespace)::testShuffleSimpleBroadcast() 537 elsif ($failureFlag && $line =~ /.*\(\d+\) : \S+ .*::(\S+)(\(.*\))/) { 538 if (defined $lastOptimizeLevel) { 539 $subTestName = "$testName.$lastOptimizeLevel.$1$2"; 540 } else { 541 $subTestName = "$testName.$1$2"; 542 } 543 } 544 # sub-test from the c-api, of the form: 545 # e.g.: 'testapi[15422:16904790] parallelPromiseResolveTest(): done.'' 546 elsif ($line =~ /\[\d+:\d+\] (\S+)(): done\.\n/) { 547 $subTestName = "$testName.objective-c.$1"; 548 } 549 # End of C-API tests (meaning we just finished the ungrouped main tests) 550 elsif ($line =~ /Starting C-API tests in C++/) { 551 $subTestName = "$testName.objective-c.main"; 552 } 553 # End of testapi 554 # e.g.: FAIL: Some tests failed. 555 elsif ($line =~ /FAIL: Some tests failed\./) { 556 $failureFlag = 0; 557 next; 558 } 559 # Test cases inside API tests 560 # e.g.: 'testapi[15422:16904790] TEST: "2 + 2": PASSED' 561 elsif ($line =~ /\[\d+:\d+\] TEST: ".*": ([A-Z]+)\n/) { 562 $failureFlag += 1 if ($1 ne "PASSED" && $1 ne "PASS"); 563 next; 564 } 565 # e.g.: 'testBitXorAndAndArgs(0, 0,uint32-max): OK!'' 566 elsif ($line =~ /(\S+)(\(.*\)): ([A-Za-z]+)!\n/) { 567 $subTestName = "$testName.$1$2"; 568 $failureFlag += 1 if ($3 ne "OK"); 569 } 570 # General testcase statement, filtered to exclude some junk logging 571 # e.g.: 'PASS: DFG script timed out as expected when no callback is specified.'' 572 elsif ($line =~ /([A-Z]+): (.*)\.*\n/ && !($line =~ /[A-Z]+: \d+\n/ || $line =~ /\[\d+:\d+\] [A-Z]+:/)) { 573 $subTestName = "$testName.$2"; 574 $failureFlag += 1 if ($1 ne "PASS"); 575 } 576 # e.g.: 'test description: PASSED' 577 elsif ($line =~ /.*: ([A-Z]+)\n/) { 578 $failureFlag += 1 if ($1 ne "PASSED" && $1 ne "PASS"); 579 next; 580 } else { 581 next; 582 } 583 584 if (!defined $reportData{$subTestName}) { 585 print("$subTestName $failureFlag\n") if $failureFlag; 586 $reportData{$subTestName} = $failureFlag ? {actual => "FAIL"} : {actual => "PASS"}; 587 } 588 $failureFlag = 0; 589 } 590 $testResult = close(TEST) ? 0 : $?; 591 403 592 my $exitStatus = exitStatus($testResult); 404 593 print "$testName completed with rc=$testResult ($exitStatus)\n\n"; … … 416 605 reportTestFailures(); 417 606 writeJsonDataIfApplicable(); 418 exit exitStatus($testResult); 607 608 $endTime = time(); 609 uploadResults(); 610 exit $exitStatus; 419 611 } 420 612 } … … 447 639 chdirWebKit(); 448 640 641 # FIXME: report stress test failures https://bugs.webkit.org/show_bug.cgi?id=204096 449 642 runJSCStressTests(); 450 643 reportTestFailures(); 644 645 $endTime = time(); 646 uploadResults(); 451 647 452 648 if ($isTestFailed) { … … 667 863 } 668 864 } 865 866 sub uploadResults 867 { 868 if (not defined $report) { 869 print "Skipping upload to results database since no report URL was specified\n"; 870 return 0; 871 } 872 873 my %upload = ( 874 version => 0, 875 suite => 'javascriptcore-tests', 876 # FIXME: Integrate branches, https://bugs.webkit.org/show_bug.cgi?id=204094 877 # FIXME: Integrate the Safari repository, https://bugs.webkit.org/show_bug.cgi?id=204095 878 commits => [{ 879 repository_id => 'webkit', 880 id => determineCurrentSVNRevision(), 881 }], 882 configuration => configurationForUpload(), 883 test_results => { 884 run_stats => { 885 start_time => $startTime, 886 end_time => $endTime, 887 tests_skipped => 0, 888 }, 889 results => \%reportData, 890 }, 891 timestamp => $startTime, 892 ); 893 if (defined $buildbotMaster and defined $builderName and defined $buildNumber and defined $buildbotWorker) { 894 $upload{test_results}{details} = { 895 buildbot_master => $buildbotMaster, 896 builder_name => $builderName, 897 build_number => $buildNumber, 898 buildbot_worker => $buildbotWorker, 899 }; 900 } else { 901 print " No buildbot details provided, test run will not be linked to CI system\n"; 902 } 903 if (defined $ENV{'RESULTS_SERVER_API_KEY'}) { 904 $upload{'api_key'} = $ENV{'RESULTS_SERVER_API_KEY'}; 905 } 906 907 print "Uploading results to $report\n"; 908 909 open(HANDLE, "|-", "curl -X POST $report/api/upload -H 'Content-Type: application/json' -f -d '\@-'") or die "Failed to open curl"; 910 911 # Json conforming to https://results.webkit.org/documentation#API-Uploads. 912 my $encodedUpload = encode_json(\%upload); 913 print HANDLE "$encodedUpload\n\0"; 914 my $success = close HANDLE; 915 916 if ($success) { 917 print "Upload successful!\n"; 918 return 0; 919 } 920 print "Upload to $report failed\n"; 921 return 1; 922 } -
trunk/Tools/Scripts/webkitdirs.pm
r251293 r252490 1564 1564 my @splitVersion = split(/\./, $versionString); 1565 1565 @splitVersion >= 2 or die "Invalid version $versionString"; 1566 $osXVersion ={1567 1568 1569 1566 return { 1567 "major" => $splitVersion[0], 1568 "minor" => $splitVersion[1], 1569 "subminor" => (defined($splitVersion[2]) ? $splitVersion[2] : 0), 1570 1570 }; 1571 1571 } … … 1580 1580 } 1581 1581 1582 my $versionString = `sw_vers -productVersion`;1582 chomp(my $versionString = `sw_vers -productVersion`); 1583 1583 $osXVersion = splitVersionString($versionString); 1584 1584 }
Note: See TracChangeset
for help on using the changeset viewer.