Bug 43519 - Upload incremental webkit test results json to server
Summary: Upload incremental webkit test results json to server
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Victor Wang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-04 16:27 PDT by Victor Wang
Modified: 2010-08-05 14:40 PDT (History)
1 user (show)

See Also:


Attachments
Proposed Patch (15.28 KB, patch)
2010-08-04 16:32 PDT, Victor Wang
ojan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Wang 2010-08-04 16:27:33 PDT
Currently, run_webkit_tests merges the test results for the current run with the archived results.json and uploads the full results.json to test-results server. To improve the performance, we should only upload the incremental test results and let the server handle the merge.
Comment 1 Victor Wang 2010-08-04 16:32:32 PDT
Created attachment 63510 [details]
Proposed Patch
Comment 2 Ojan Vafai 2010-08-05 11:10:39 PDT
Comment on attachment 63510 [details]
Proposed Patch

Looks good. Please make the changes below and feel free to commit.

> +        # Generate the JSON output file that has full results.
>          if not self._json:
>              self._json = self.get_json()
>          if self._json:
> -            # Specify separators in order to get compact encoding.
> -            json_data = simplejson.dumps(self._json, separators=(',', ':'))
> -            json_string = self.JSON_PREFIX + json_data + self.JSON_SUFFIX
> -
> -            results_file = codecs.open(self._results_file_path, "w", "utf-8")
> -            results_file.write(json_string)
> -            results_file.close()
> +            self._generate_json_file(self._json, self._results_file_path)
> +
> +        # Generate the JSON output file that only has incremental results.
> +        if self._generate_incremental_results:
> +            json = self.get_json(incremental=True)
> +            if json:
> +                self._generate_json_file(
> +                    json, self._incremental_results_file_path)

Once we get all the bots using incremental results, I think we should have setting _generate_incremental_results mean that we don't write out the full results file. Mind putting in a FIXME for that?

> +            for d in buildinfo[JRG.FIXABLE]:
> +                for (k, v) in d.iteritems():
> +                    if k in fixable:
> +                        fixable[k] = fixable[k] + v
> +                    else:
> +                        fixable[k] = v

> +                for r in test[JRG.RESULTS]:
> +                    if r[1] == JRG.FAIL_RESULT:
> +                        failed = r[0]
> +                self.assertTrue(failed == 1)
> +
> +                timing = 0
> +                for t in test[JRG.TIMES]:
> +                    if t[1] == test_timings[test_name]:
> +                        timing = t[0]
> +                self.assertTrue(timing == 1)

For readability sake, abbreviated variable names are discouraged in WebKit code (i.e. for d, k, v, r and t).
Comment 3 Victor Wang 2010-08-05 14:40:10 PDT
Committed r64786: <http://trac.webkit.org/changeset/64786>