Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Issue 6597122: Refactor au_test_harness into modules and refactor to use worker design. (Closed)

Created:
9 years, 9 months ago by sosa
Modified:
9 years, 6 months ago
Reviewers:
dgarrett
CC:
chromium-os-reviews_chromium.org, Mandeep Singh Baines, anush, sosa
Visibility:
Public.

Description

Refactor au_test_harness into modules and refactor to use worker design flow. This CL is a large refactoring that moves the test_harness from using sub-classed classes of au_test into a one where we have the same AU_Test for all test flows but different test workers that operate on different types of machines. Specifically we move the VM / Real-image specific logic into real_au_worker and vm_au_worker. There isn't anything functionally different in this change. Also, we move the classes into their own modules and clean up use of cros_build_lib to be more stylistically correct. Change-Id: I3e25141174c3d5ba22962bf94365815e69e5bedf BUG=chromium-os:11172 TEST=Ran with simple and full w/ w/out delta update payloads and with unittest and without unittest keys. Ran real test using full suite on test device using full update payloads. Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=5566eb1

Patch Set 1 #

Patch Set 2 : ws #

Patch Set 3 : Add missing #

Patch Set 4 : 80 char #

Total comments: 25

Patch Set 5 : Nit party #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1213 lines, -1095 lines) Patch
A bin/au_test_harness/__init__.py View 0 chunks +-1 lines, --1 lines 0 comments Download
A bin/au_test_harness/au_test.py View 1 2 3 4 1 chunk +264 lines, -0 lines 0 comments Download
A bin/au_test_harness/au_worker.py View 1 2 3 4 1 chunk +242 lines, -0 lines 0 comments Download
A bin/au_test_harness/cros_au_test_harness.py View 1 1 chunk +296 lines, -0 lines 0 comments Download
A + bin/au_test_harness/cros_test_proxy.py View 1 6 chunks +19 lines, -16 lines 0 comments Download
A bin/au_test_harness/dev_server_wrapper.py View 1 2 1 chunk +50 lines, -0 lines 0 comments Download
A bin/au_test_harness/dummy_au_worker.py View 1 2 1 chunk +45 lines, -0 lines 0 comments Download
A bin/au_test_harness/parallel_test_job.py View 1 2 3 4 1 chunk +112 lines, -0 lines 0 comments Download
A bin/au_test_harness/real_au_worker.py View 1 2 1 chunk +61 lines, -0 lines 0 comments Download
A bin/au_test_harness/update_exception.py View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
A bin/au_test_harness/vm_au_worker.py View 1 2 3 4 1 chunk +113 lines, -0 lines 0 comments Download
M bin/cros_au_test_harness View 1 chunk +1 line, -1 line 0 comments Download
D bin/cros_au_test_harness.py View 1 chunk +0 lines, -1079 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
sosa
PTAL I know this is big, but retveld couldn't figure out how to do the ...
9 years, 9 months ago (2011-03-02 23:28:47 UTC) #1
dgarrett
This looks like a really good change to me. Pretty much all of my comments ...
9 years, 9 months ago (2011-03-03 02:17:21 UTC) #2
sosa
9 years, 9 months ago (2011-03-03 03:11:41 UTC) #3
Thanks for the review!!!

Pushing after another quick round of testing.

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/au_test.py
File bin/au_test_harness/au_test.py (right):

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/au_test....
bin/au_test_harness/au_test.py:26: @classmethod
Done to set class options i.e. static method since you can't override __init__
for unittests or even instantiate the class yourself (the unittest test harness
does it).

On 2011/03/03 02:17:21, dgarrett wrote:
> Why use the classmethod decorator only for this method?

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/au_test....
bin/au_test_harness/au_test.py:80: # start our proxy at a different. We then
tell our update tools to
On 2011/03/03 02:17:21, dgarrett wrote:
> s/different/different one/
> 
> (Yeah, I know it's my comment originally)

Done.

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/au_test....
bin/au_test_harness/au_test.py:88: # This update is expected to fail...
heh .. comment is wrong :) Done.

On 2011/03/03 02:17:21, dgarrett wrote:
> Either this comment or the docstring is wrong.
> 
> (And yeah, my error originally)

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/au_worke...
File bin/au_test_harness/au_worker.py (right):

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/au_worke...
bin/au_test_harness/au_worker.py:121: @classmethod
Sets a static variable.  I'm using class variables instead of globals much like
with au_test.

On 2011/03/03 02:17:21, dgarrett wrote:
> Why classmethod here?

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/au_worke...
bin/au_test_harness/au_worker.py:196: except Exception, e:
On 2011/03/03 02:17:21, dgarrett wrote:
> This syntax is morphing. What you are doing works, but is only documented in
the
> form:
> 
> "except Exception as e:"
> 
> I'm not really clear on what the difference is, but I think the 'as' is now
> preferred.

Done.

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/cros_au_...
File bin/au_test_harness/cros_au_test_harness.py (right):

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/cros_au_...
bin/au_test_harness/cros_au_test_harness.py:1: #!/usr/bin/python
This hasn't been agreed upon and differs from google style.  I'd like that to be
vetted before I change it.

On 2011/03/03 02:17:21, dgarrett wrote:
> According to the new guide this should be:
> 
> #!/usr/bin/env python

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/dev_serv...
File bin/au_test_harness/dev_server_wrapper.py (right):

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/dev_serv...
bin/au_test_harness/dev_server_wrapper.py:42: @classmethod
Static method.  Doesn't use any specific variables but associated with a dev
server.

On 2011/03/03 02:17:21, dgarrett wrote:
> Again, not a problem, I'm just curious.

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/parallel...
File bin/au_test_harness/parallel_test_job.py (right):

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/parallel...
bin/au_test_harness/parallel_test_job.py:65: def
RunParallelJobs(number_of_sumultaneous_jobs, jobs, jobs_args,
On 2011/03/03 02:17:21, dgarrett wrote:
> s/sumultaneous/simultaneous/

Done.

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/parallel...
bin/au_test_harness/parallel_test_job.py:67: 
On 2011/03/03 02:17:21, dgarrett wrote:
> Extra blank line.

Done.

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/parallel...
bin/au_test_harness/parallel_test_job.py:82: job_start_semaphore =
threading.Semaphore(number_of_sumultaneous_jobs)
On 2011/03/03 02:17:21, dgarrett wrote:
> s/sumultaneous/simultaneous/

Done.

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/parallel...
bin/au_test_harness/parallel_test_job.py:97: # We use a semaphore to ensure we
don't run more jobs that required.
On 2011/03/03 02:17:21, dgarrett wrote:
> s/that/than/

Done.

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/vm_au_wo...
File bin/au_test_harness/vm_au_worker.py (right):

http://codereview.chromium.org/6597122/diff/5008/bin/au_test_harness/vm_au_wo...
bin/au_test_harness/vm_au_worker.py:40: def __init__(self, options):
Wasn't sure.  I put the helper functions it used above it ... but ok with moving
up.  Done.

On 2011/03/03 02:17:21, dgarrett wrote:
> I thought init was supposed to be the first method, but not certain if that's
> the spec.

Powered by Google App Engine
This is Rietveld 408576698