New issue
Advanced search Search tips

Issue 750326 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 430770



Sign in to add a comment

clean up validation_pool_unittest

Project Member Reported by akes...@chromium.org, Jul 28 2017

Issue description

It's a mess, uses a bunch of bad patterns, and has lots of needless mox dependencies.
 
Blocking: 430770
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76

commit 26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76
Author: Aviv Keshet <akeshet@chromium.org>
Date: Sat Jul 29 05:07:55 2017

patch_unittest: delete MockTestBase

Get rid of a test class inherited all over the place. Replace with
object composition.

BUG= chromium:750326 
TEST=unittests pass; cidb_integration_test

Change-Id: I74f414006c72ba314a0957b9f8cea4a76813d020
Reviewed-on: https://chromium-review.googlesource.com/591954
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/lib/cq_config_unittest.py
[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/lib/build_failure_message_unittest.py
[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/cbuildbot/stages/report_stages_unittest.py
[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/cbuildbot/relevant_changes_unittest.py
[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/lib/triage_lib_unittest.py
[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/lib/hwtest_results_unittest.py
[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/cbuildbot/build_status_unittest.py
[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/cbuildbot/stages/completion_stages_unittest.py
[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/lib/patch_unittest.py
[modify] https://crrev.com/26d46f1b7f2bcadb5a3d9564bda6f1f8c17b9f76/lib/cidb_integration_test.py

Project Member

Comment 3 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/659c25ceef2d503ac392475ff69c5e5cdf577b09

commit 659c25ceef2d503ac392475ff69c5e5cdf577b09
Author: Aviv Keshet <akeshet@chromium.org>
Date: Sat Jul 29 05:07:54 2017

validation_pool_unittest: move MakeHelper method to module of use

BUG= chromium:750326 
TEST=unittests pass

Change-Id: Ic0c847132cf303463080235f498b4ad109af6a84
Reviewed-on: https://chromium-review.googlesource.com/592340
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/659c25ceef2d503ac392475ff69c5e5cdf577b09/cbuildbot/validation_pool_unittest.py
[modify] https://crrev.com/659c25ceef2d503ac392475ff69c5e5cdf577b09/cbuildbot/patch_series_unittest.py

Project Member

Comment 4 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/788425ac9209b85744c59c8db96b600204b6a5a9

commit 788425ac9209b85744c59c8db96b600204b6a5a9
Author: Aviv Keshet <akeshet@chromium.org>
Date: Sat Jul 29 05:07:54 2017

patch_unittest: pull MockTestBase functionality into helper class

Composition is better than inheritance, for test functionality. This
moves us one step closer to eliminating MockTestBase entirely from
inheritance chain.

Fix a bunch of test cases that need a bit more plumbing in
validation_pool.

BUG= chromium:750326 
TEST=None

Change-Id: I7cb5ee1b2790e8dc9fb66f8281e5ed99e50e7651
Reviewed-on: https://chromium-review.googlesource.com/592496
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/788425ac9209b85744c59c8db96b600204b6a5a9/lib/cq_config_unittest.py
[modify] https://crrev.com/788425ac9209b85744c59c8db96b600204b6a5a9/cbuildbot/validation_pool_unittest.py
[modify] https://crrev.com/788425ac9209b85744c59c8db96b600204b6a5a9/lib/patch_unittest.py

Project Member

Comment 5 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/8094528ed110e6de7a300d371d011aa52051253f

commit 8094528ed110e6de7a300d371d011aa52051253f
Author: Aviv Keshet <akeshet@chromium.org>
Date: Sat Jul 29 07:56:58 2017

cl_messages_unittest: eliminate unnecessary MoxBase inheritor

BUG= chromium:750326 
TEST=None

Change-Id: I8d777de9cd7b6ab2fbcf5291e6a11fed20a646e3
Reviewed-on: https://chromium-review.googlesource.com/592085
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/8094528ed110e6de7a300d371d011aa52051253f/lib/cl_messages_unittest.py

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/701136b52f96840068b9dff766b2beca09741f75

commit 701136b52f96840068b9dff766b2beca09741f75
Author: Aviv Keshet <akeshet@chromium.org>
Date: Sat Jul 29 07:56:59 2017

patch_series_unittest: eliminate MoxBase inheritance

BUG= chromium:750326 
TEST=None

Change-Id: I03d85252100ea9543e38c638320b37903358a145
Reviewed-on: https://chromium-review.googlesource.com/592285
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/701136b52f96840068b9dff766b2beca09741f75/cbuildbot/patch_series_unittest.py

Project Member

Comment 7 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/37a86d44e1fb3380b37d45da565363f41f6d82a2

commit 37a86d44e1fb3380b37d45da565363f41f6d82a2
Author: Aviv Keshet <akeshet@chromium.org>
Date: Sat Jul 29 07:56:59 2017

validation_pool_unittest: privatize MoxBase

There are no remaining outside callers. Privatize it so nobody is
tempted to add new ones.

Now that the mess is isolated, it might be possible to clean up the mox
mess locally.

BUG= chromium:750326 
TEST=None

Change-Id: Iec0fa0c82e17401c3e1f06c983853c89019d1623
Reviewed-on: https://chromium-review.googlesource.com/592528
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/37a86d44e1fb3380b37d45da565363f41f6d82a2/cbuildbot/validation_pool_unittest.py

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/b1fd3040ac58c8338d87ceb1ca35d83c63609cc8

commit b1fd3040ac58c8338d87ceb1ca35d83c63609cc8
Author: Aviv Keshet <akeshet@chromium.org>
Date: Sat Jul 29 07:56:59 2017

validation_pool_unittest: drop MoxTestCase inheritence where unneeded

_MoxBase is now _Base. Other tests in this module that still need mox
get it directly instead of from _MoxBase.

BUG= chromium:750326 
TEST=None

Change-Id: I33b4a3f9bee6544f374587427c376ff709339a54
Reviewed-on: https://chromium-review.googlesource.com/592610
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/b1fd3040ac58c8338d87ceb1ca35d83c63609cc8/cbuildbot/validation_pool_unittest.py

Comment 9 by pho...@chromium.org, Jul 31 2017

Owner: akes...@chromium.org
Status: Started (was: Available)
Project Member

Comment 11 by bugdroid1@chromium.org, Aug 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/3552b56942c90c39c81cf6bc88ec3acc8f601efd

commit 3552b56942c90c39c81cf6bc88ec3acc8f601efd
Author: Aviv Keshet <akeshet@chromium.org>
Date: Tue Aug 01 00:08:29 2017

validation_pool_unittest: de-moxify validation_pool_unittest

Get rid of mox dependency from this module, and all tests within it.

2 tests of fairly low value was deleted because they were tedius to
port.

BUG= chromium:750326 ,  chromium:430770 
TEST=affected test passes

Change-Id: Ib7d28f117a2ddc8fd36546bbd48f67d780a20e37
Reviewed-on: https://chromium-review.googlesource.com/592709
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/3552b56942c90c39c81cf6bc88ec3acc8f601efd/cbuildbot/validation_pool.py
[modify] https://crrev.com/3552b56942c90c39c81cf6bc88ec3acc8f601efd/cbuildbot/validation_pool_unittest.py

Status: Fixed (was: Started)
No more mox. Declaring victory for now.

Sign in to add a comment