New issue
Advanced search Search tips

Issue 901570 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Unit tests not executed for tast-local-tests-cros

Project Member Reported by derat@chromium.org, Nov 3

Issue description

(initially reported at https://crrev.com/c/1307176)

When I run "FEATURES=test emerge-caroline tast-local-tests-cros" or run "./fast_build.sh -T" in src/platform/tast in the chroot, I see the following failure:

--- FAIL: TestTimeout (0.00s)
        timeout_test.go:33: arc.SettingsBridge: timeout is too short (0s < 3m30s)
FAIL                                                 
FAIL    chromiumos/tast/local/bundles/cros/arc  0.099s

This is in fact an issue in the test, which I'll upload a change to fix.

But the bigger problem is that we don't seem to be running these unit tests. When I look at the UnitTests stage on e.g. the eve-paladin run at http://cros-goldeneye/chromeos/healthmonitoring/buildDetails?buildbucketId=8930945584699123184, it looks like we aren't running unit tests for tast-local-tests-cros:

13:28:02: WARNING: The following packages do not have tests:
13:28:02: WARNING: app-benchmarks/punybench
app-benchmarks/xfstests
chromeos-base/arc-adbd
chromeos-base/arc-base
...
chromeos-base/system_api
chromeos-base/tast-local-test-runner
chromeos-base/tast-local-tests-cros
chromeos-base/timberslide
chromeos-base/toolchain-tests
...

I'm not completely sure why yet. We're setting CROS_GO_TEST in tast-local-tests-cros-9999.ebuild:

CROS_GO_TEST=(
    # Also test support packages that live above local/bundles/.
    "chromiumos/tast/local/..."
)

The ebuild doesn't declare a src_test function directly, though.
 
> The ebuild doesn't declare a src_test function directly, though.

that's the problem.  see chromite/lib/portage_util.py:PackagesWithTest for details.
Thanks, Mike.

tast-local-tests-cros-9999.ebuild inherits tast-bundle.
tast-bundle.eclass inherits cros-go.
cros-go.eclass defines cros-go_src_test and calls "EXPORT_FUNCTIONS ... src_test".

The Classify method in chromite/lib/portage_util.py checks if the ebuild has a line starting with src_test() or platform_pkg_test(). It also contains this:

      if line.startswith('inherit '):
        eclasses = line.split()
        if 'cros-workon' in eclasses:
          is_workon = True
        if 'cros-common.mk' in eclasses:
          has_test = True

Any objection to me also adding conditions for tast-bundle and cros-go to cover the includes?
if every package that inherits those eclasses will have unittests, should be fine
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/fc41cb4f01a3a2c784bcf1eb1464e396c0d2f359

commit fc41cb4f01a3a2c784bcf1eb1464e396c0d2f359
Author: Daniel Erat <derat@chromium.org>
Date: Mon Nov 05 05:30:50 2018

tast-tests: Add 4-minute timeout to arc.SettingsBridge.

Set an explicit timeout on the arc.SettingsBridge test. This
is needed by the TestTimeout unit test.

BUG=b:111049216, chromium:901570 
TEST=tests pass for chromiumos/tast/local/bundles/cros/arc

Change-Id: Ib07ce4d6a03d53165e6a97494ea7a991422af7a5
Reviewed-on: https://chromium-review.googlesource.com/c/1316335
Commit-Queue: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Trybot-Ready: Dan Erat <derat@chromium.org>
Reviewed-by: Sara Kato <sarakato@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>

[modify] https://crrev.com/fc41cb4f01a3a2c784bcf1eb1464e396c0d2f359/src/chromiumos/tast/local/bundles/cros/arc/settings_bridge.go

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 7

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

commit 682ca2ed7fb355249f0bd4459bfef156a5045547
Author: Daniel Erat <derat@chromium.org>
Date: Wed Nov 07 14:35:05 2018

portage_util: Set has_test for cros-go and tast-bundle.

Set the has_test property for Portage packages that inherit
the cros-go or tast-bundle eclasses. This is needed to make
these unit tests run on builders.

BUG= chromium:901570 
TEST=updated unit tests

Change-Id: Ie4349e2c4846d8085fe3a0f40bd16090d38fbe22
Reviewed-on: https://chromium-review.googlesource.com/1316819
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/682ca2ed7fb355249f0bd4459bfef156a5045547/lib/portage_util_unittest.py
[modify] https://crrev.com/682ca2ed7fb355249f0bd4459bfef156a5045547/lib/portage_util.py

Status: Fixed (was: Assigned)

Sign in to add a comment