New issue
Advanced search Search tips

Issue 593137 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Jun 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Simplify the devserver unit tests

Reported by jrbarnette@chromium.org, Mar 8 2016

Issue description

After this CL:
   https://chromium-review.googlesource.com/#/c/329409/

The unit tests get noticeably bigger.  The cause is the need
to test with dev_server.ENABLE_SSH_CONNECTION_FOR_DEVSERVER set
both True and False.  This can be simplified by changing the
testing strategy:
  * Add tests to test the behavior of run_call() with the
    config setting both ways.
  * Test all callers of run_call() with a mocked version of
    the method that behaves as needed for the test.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/d25fa8aae829a45ad9a496a19946b7ca399276af

commit d25fa8aae829a45ad9a496a19946b7ca399276af
Author: xixuan <xixuan@google.com>
Date: Fri Mar 11 23:18:44 2016

Autotest: Simplify the devserver unit tests

After CL:329409, the dev_server_unittest becomes bigger since it need to
test with ENABLE_SSH_CONNECTION_FOR_DEVSERVER set both True or False.

This CL changes the testing stratgy:
  * Create class SshConnectionTest to test different settings and args
    for func DevServer.run_call() and ImageServerBase.run_call().
  * Test all callers of run_call() with a mocked version of run_call().
In this way, we seperate the tests to `before` and `after` calling run_call().

BUG= chromium:593137 
TEST=ran dev_server_unittest.py locally with --debug.

Change-Id: Id516deaebfba8fcdabff70bc20996d3d49b7c96c
Reviewed-on: https://chromium-review.googlesource.com/332227
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>

[modify] https://crrev.com/d25fa8aae829a45ad9a496a19946b7ca399276af/client/common_lib/cros/dev_server_unittest.py

Comment 2 by benhenry@google.com, Apr 26 2016

Components: Infra>Client>ChromeOS
Labels: -Infra-ChromeOS
Status: Fixed (was: Assigned)
Closing... please feel free to reopen if its not fixed.
Status: Verified (was: Fixed)

Sign in to add a comment