New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 780423 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task



Sign in to add a comment

Add unit test for CfM autotest utility classes

Project Member Reported by malmnas@google.com, Nov 1 2017

Issue description

We should add unit tests for the utility functions/classes that are used it CfM autotests.

Unit tests will help document how functions are supposed to work and it will also make it easier to refactor code without breaking tests.

Classes that need unit tests are listed in go/cfm-utils-unit-tests
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 1 2017

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

commit 1ad7db01ec8c8a9de1e0aecd792320ecce289d3b
Author: Kristoffer Erlandsson <kerl@google.com>
Date: Wed Nov 01 18:26:04 2017

Add unit tests for cpu and memory methods.

Preparation for adding and fixing stats related to these.

BUG=chromium:780423
TEST=Ran the unit test locally

Change-Id: Ib57241860bc8f88960ffd4da8ced49ef1baa0bbd
Reviewed-on: https://chromium-review.googlesource.com/749144
Commit-Ready: Kristoffer Erlandsson <kerl@google.com>
Tested-by: Kristoffer Erlandsson <kerl@google.com>
Reviewed-by: Claes Malmnäs <malmnas@google.com>
Reviewed-by: Denis Tosic <dtosic@chromium.org>

[modify] https://crrev.com/1ad7db01ec8c8a9de1e0aecd792320ecce289d3b/client/bin/utils.py
[modify] https://crrev.com/1ad7db01ec8c8a9de1e0aecd792320ecce289d3b/client/bin/utils_unittest.py

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 2 2017

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

commit bbbefad465270a25fb2f2eb24d71c241717c9e7f
Author: Claes Malmnas <malmnas@google.com>
Date: Thu Nov 02 08:42:43 2017

Add first unit tests for get_usb_devices.

Fixed bug in _extract_usb_data at the same time.

Removed unused import statements to get rid of warnings.

BUG=chromium:780423
TEST=ran test locally

Change-Id: I64cad040d2432b1b86ea513904b9a2347f5518c1
Reviewed-on: https://chromium-review.googlesource.com/749182
Tested-by: Claes Malmnäs <malmnas@google.com>
Reviewed-by: Denis Tosic <dtosic@chromium.org>
Reviewed-by: Claes Malmnäs <malmnas@google.com>
Reviewed-by: Kristoffer Erlandsson <kerl@google.com>

[modify] https://crrev.com/bbbefad465270a25fb2f2eb24d71c241717c9e7f/client/common_lib/cros/get_usb_devices.py
[add] https://crrev.com/bbbefad465270a25fb2f2eb24d71c241717c9e7f/client/common_lib/cros/get_usb_devices_unittest.py

Project Member

Comment 3 by bugdroid1@chromium.org, Nov 2 2017

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

commit 0e01eb06167e11a5e2854e6e28885e7fce0da195
Author: Claes Malmnas <malmnas@google.com>
Date: Thu Nov 02 11:50:52 2017

Code cleanup.

 * Removed the redundant CAMERA_LIST and SPEAKER_LIST. The data in these lists
   are duplicating the keys in the corresponding CAMERA_MAP and SPEAKER_LIST.
 * Simplified the logic in some functions
 * Added a unit test for _get_device_prod

BUG=chromium:780423
TEST=locally, unit tests

Change-Id: I1f25b5070594e62e2c63eb6c3743cf343fe14ba7
Reviewed-on: https://chromium-review.googlesource.com/750086
Reviewed-by: Denis Tosic <dtosic@chromium.org>
Commit-Queue: Claes Malmnäs <malmnas@google.com>
Tested-by: Claes Malmnäs <malmnas@google.com>
Trybot-Ready: Claes Malmnäs <malmnas@google.com>

[modify] https://crrev.com/0e01eb06167e11a5e2854e6e28885e7fce0da195/client/common_lib/cros/get_usb_devices.py
[modify] https://crrev.com/0e01eb06167e11a5e2854e6e28885e7fce0da195/client/common_lib/cros/get_usb_devices_unittest.py

Project Member

Comment 4 by bugdroid1@chromium.org, Nov 6 2017

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

commit a4284af727b461f285c92385160eaddc8f64ae49
Author: Claes Malmnas <malmnas@google.com>
Date: Mon Nov 06 15:55:59 2017

Extract code for extracting vid and pid to utility method.

Reduce code duplicaton.

Fixed formatting of @param and @returns at the same time.

BUG=chromium:780423
TEST=locally

Change-Id: Ib2aab3f2cdd572c82b474d1620ebc97fd6aa1f37
Reviewed-on: https://chromium-review.googlesource.com/754685
Commit-Ready: Claes Malmnäs <malmnas@google.com>
Tested-by: Claes Malmnäs <malmnas@google.com>
Reviewed-by: Kristoffer Erlandsson <kerl@google.com>

[modify] https://crrev.com/a4284af727b461f285c92385160eaddc8f64ae49/client/common_lib/cros/get_usb_devices.py
[modify] https://crrev.com/a4284af727b461f285c92385160eaddc8f64ae49/client/common_lib/cros/get_usb_devices_unittest.py

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 10 2017

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

commit 134949883f1f2a9c786a27b9de696ef816cee0ae
Author: Claes Malmnas <malmnas@google.com>
Date: Fri Nov 10 08:31:19 2017

Introduce a method for filtering usb data to reduce code duplication.

BUG=chromium:780423
TEST=locally

Change-Id: I8e792066bae484a7e4261a5978ea450cb0ce015c
Reviewed-on: https://chromium-review.googlesource.com/760417
Reviewed-by: Kristoffer Erlandsson <kerl@google.com>
Commit-Queue: Claes Malmnäs <malmnas@google.com>
Tested-by: Claes Malmnäs <malmnas@google.com>

[modify] https://crrev.com/134949883f1f2a9c786a27b9de696ef816cee0ae/client/common_lib/cros/get_usb_devices.py

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 10 2017

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

commit 2f9ebf7df88745695d6eb52a853aefd99d404469
Author: Claes Malmnas <malmnas@google.com>
Date: Fri Nov 10 13:02:09 2017

Simplified the code in is_usb_device_ok a bit and added a unit test.

BUG=chromium:780423
TEST=locally, unit tests (the modified autotest is not run anywhere)

Change-Id: If4c25db1e38514a8e3a82de170609f76ea2e98fd
Reviewed-on: https://chromium-review.googlesource.com/758258
Reviewed-by: Kristoffer Erlandsson <kerl@google.com>
Reviewed-by: Claes Malmnäs <malmnas@google.com>
Commit-Queue: Claes Malmnäs <malmnas@google.com>
Tested-by: Claes Malmnäs <malmnas@google.com>

[modify] https://crrev.com/2f9ebf7df88745695d6eb52a853aefd99d404469/client/common_lib/cros/get_usb_devices.py
[modify] https://crrev.com/2f9ebf7df88745695d6eb52a853aefd99d404469/server/site_tests/enterprise_CFM_MimoSanity/enterprise_CFM_MimoSanity.py
[modify] https://crrev.com/2f9ebf7df88745695d6eb52a853aefd99d404469/client/common_lib/cros/get_usb_devices_unittest.py

Components: Infra>Client>ChromeOS Enterprise
Labels: Enterprise-Triaged
Owner: malmnas@google.com
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 14 2017

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

commit dd8f59ae1d84d17269f32bdd7f7ce7974eab4632
Author: Claes Malmnas <malmnas@google.com>
Date: Tue Nov 14 14:38:15 2017

Code refactoring.

Simplified the code in get_usb_devices.py a bit.

BUG=chromium:780423
TEST=unit tests

Change-Id: I20ac58d889e565fe3c8939b9f61be19e772072a4
Reviewed-on: https://chromium-review.googlesource.com/768742
Reviewed-by: Denis Tosic <dtosic@chromium.org>
Reviewed-by: Claes Malmnäs <malmnas@google.com>
Commit-Queue: Claes Malmnäs <malmnas@google.com>
Tested-by: Claes Malmnäs <malmnas@google.com>
Trybot-Ready: Claes Malmnäs <malmnas@google.com>

[modify] https://crrev.com/dd8f59ae1d84d17269f32bdd7f7ce7974eab4632/client/common_lib/cros/get_usb_devices.py

Project Member

Comment 10 by bugdroid1@chromium.org, Nov 21 2017

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

commit baa9aa86ce25b01365a807da238c93c970047d3f
Author: Denis Tosic <dtosic@chromium.org>
Date: Tue Nov 21 14:36:52 2017

[autotest] Add unit tests for cfm_facade_native.py

BUG=chromium:780423
TEST=ran test locally

Change-Id: Iba22072a27402be7eac168e7592d5a972c81456d
Reviewed-on: https://chromium-review.googlesource.com/779121
Commit-Ready: Claes Malmnäs <malmnas@google.com>
Commit-Ready: Denis Tosic <dtosic@chromium.org>
Tested-by: Claes Malmnäs <malmnas@google.com>
Tested-by: Denis Tosic <dtosic@chromium.org>
Reviewed-by: Claes Malmnäs <malmnas@google.com>
Reviewed-by: Denis Tosic <dtosic@chromium.org>

[add] https://crrev.com/baa9aa86ce25b01365a807da238c93c970047d3f/client/cros/multimedia/cfm_facade_native_unittest.py

Project Member

Comment 11 by bugdroid1@chromium.org, Nov 29 2017

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

commit 708660068e6d301744aa626d37d49dc6535dd78f
Author: Denis Tosic <dtosic@chromium.org>
Date: Wed Nov 29 10:06:25 2017

[autotest][cfm] Store the bus and port number for USB devices

This is so we can perforem gpio resets in our tests easier.

TEST=unit tests extended
BUG=chromium:780423, chromium:785271

Change-Id: Iba331001775d9aaa23673b02c30fa12d1868c22d
Reviewed-on: https://chromium-review.googlesource.com/795890
Reviewed-by: Denis Tosic <dtosic@chromium.org>
Commit-Queue: Denis Tosic <dtosic@chromium.org>
Tested-by: Denis Tosic <dtosic@chromium.org>
Trybot-Ready: Denis Tosic <dtosic@chromium.org>

[modify] https://crrev.com/708660068e6d301744aa626d37d49dc6535dd78f/client/common_lib/cros/cfm/usb/usb_device_collector_unittest.py
[modify] https://crrev.com/708660068e6d301744aa626d37d49dc6535dd78f/client/common_lib/cros/cfm/usb/usb_device_collector.py
[modify] https://crrev.com/708660068e6d301744aa626d37d49dc6535dd78f/client/common_lib/cros/cfm/usb/usb_device.py

Project Member

Comment 12 by bugdroid1@chromium.org, Nov 29 2017

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

commit 657a6883efd0120f92b20c0c0ccee9c48c952eb0
Author: Denis Tosic <dtosic@chromium.org>
Date: Wed Nov 29 10:31:37 2017

[autotest][cfm] Fix unit tests after https://crrev.com/c/795890

Forgot to update these.

TEST=ran all unit tests under server/ and client/
BUG=chromium:780423, chromium:785271

Change-Id: If4f03a7a9b608bd7b65f3c41a8017c1b15f0cef6
Reviewed-on: https://chromium-review.googlesource.com/796030
Reviewed-by: Kristoffer Erlandsson <kerl@google.com>
Commit-Queue: Denis Tosic <dtosic@chromium.org>
Tested-by: Denis Tosic <dtosic@chromium.org>
Trybot-Ready: Denis Tosic <dtosic@chromium.org>

[modify] https://crrev.com/657a6883efd0120f92b20c0c0ccee9c48c952eb0/server/cros/cfm/configurable_test/actions_unittest.py
[modify] https://crrev.com/657a6883efd0120f92b20c0c0ccee9c48c952eb0/client/common_lib/cros/cfm/usb/usb_device_unittest.py

Hi, this bug has not been updated recently. Please acknowledge the bug and provide status within two weeks (6/22/2018), or the bug will be archived. Thank you.

Sign in to add a comment