Skip to content

Commit

Permalink
[M115][infra] More closely unify variant and mixin behavior.
Browse files Browse the repository at this point in the history
Variants are logically similar to mixins in their ability to modify a
test suite, with the difference being that a test spec is created for
each variant rather than all being applied to a single test spec. To
ensure more consistent treatment of fields, variants will now use the
mixin codepath to modify a test.

The following differences remain with variants:
* The enabled, identifier and mixins fields specify behavior that is
  specific to variants.
* Skylab details can be specified on a variant under the skylab key.
  When a variant is applied to a test, if the skylab key is present, all
  fields of the value will be lifted to the top-level, except for the
  cros_chrome_version field, which is only used by the cros skylab image
  roller to compare against other data sources.

This CL introduces the following behavior changes:
* The swarming field in a variant is merged in the same way as with a
  mixin, in particular, dimension_sets will be added to the test's
  dimension_sets value instead of merging elements at the same index.
  This didn't result in any changes to generated files, but all variants
  have been updated to use dimensions instead of dimension_sets to
  ensure the same behavior going forward.
* A mixin that specifies the description field (non exist at this
  point), will have the description appended to any existing description
  for the test.

(cherry picked from commit 8d6708c)

Bug: 1456553
Change-Id: I869d8baad76027d811b7c3b96ed35d46509a819b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4703284
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1173053}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4706387
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Cr-Commit-Position: refs/branch-heads/5790@{#1844}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
kleerwater authored and Chromium LUCI CQ committed Jul 26, 2023
1 parent 8ad26ff commit d14b74c
Show file tree
Hide file tree
Showing 17 changed files with 110 additions and 266 deletions.
8 changes: 8 additions & 0 deletions infra/config/lib/targets.star
Expand Up @@ -328,6 +328,7 @@ def _swarming(
def _mixin(
*,
name = None,
description = None,
args = None,
precommit_args = None,
android_args = None,
Expand All @@ -352,6 +353,9 @@ def _mixin(
Args:
name: The name of the mixin.
description: A description to attach to the test. If specified,
it will be appended to any description already present on
the test.
args: Arguments to be passed to the test binary. Will be
appended to any existing args for the test.
precommit_args: Arguments to be passed to the test binary when
Expand Down Expand Up @@ -394,6 +398,7 @@ def _mixin(
timeout_sec: The maximum time the test can take to run.
"""
mixin_values = dict(
description = description,
args = args,
precommit_args = precommit_args,
linux_args = linux_args,
Expand Down Expand Up @@ -517,6 +522,9 @@ def _generate_mixins_pyl(ctx):
mixin = n.props.mixin_values
formatter.open_scope("'{}': {{".format(n.key.id))

if "description" in mixin:
formatter.add_line("'description': '{}',".format(mixin["description"]))

for args_attr in (
"args",
"precommit_args",
Expand Down
14 changes: 0 additions & 14 deletions testing/buildbot/chrome.json
Expand Up @@ -1552,7 +1552,6 @@
],
"skylab_tests": [
{
"args": [],
"autotest_name": "tast.chrome-from-tls",
"cros_board": "octopus",
"cros_img": "octopus-release/R115-15460.0.0",
Expand Down Expand Up @@ -1693,7 +1692,6 @@
],
"skylab_tests": [
{
"args": [],
"cros_board": "dedede",
"cros_img": "dedede-release/R114-15410.0.0",
"name": "lacros_all_tast_tests DEDEDE_RELEASE_LKGM",
Expand All @@ -1709,7 +1707,6 @@
"variant_id": "DEDEDE_RELEASE_LKGM"
},
{
"args": [],
"cros_board": "dedede",
"cros_img": "dedede-release/R113-15393.12.0",
"name": "lacros_all_tast_tests DEDEDE_RELEASE_DEV",
Expand All @@ -1725,7 +1722,6 @@
"variant_id": "DEDEDE_RELEASE_DEV"
},
{
"args": [],
"cros_board": "dedede",
"cros_img": "dedede-release/R112-15359.37.0",
"name": "lacros_all_tast_tests DEDEDE_RELEASE_BETA",
Expand All @@ -1741,7 +1737,6 @@
"variant_id": "DEDEDE_RELEASE_BETA"
},
{
"args": [],
"cros_board": "dedede",
"cros_img": "dedede-release/R111-15329.59.0",
"name": "lacros_all_tast_tests DEDEDE_RELEASE_STABLE",
Expand All @@ -1757,7 +1752,6 @@
"variant_id": "DEDEDE_RELEASE_STABLE"
},
{
"args": [],
"cros_board": "eve",
"cros_img": "eve-release/R114-15410.0.0",
"name": "lacros_all_tast_tests EVE_RELEASE_LKGM",
Expand All @@ -1773,7 +1767,6 @@
"variant_id": "EVE_RELEASE_LKGM"
},
{
"args": [],
"cros_board": "eve",
"cros_img": "eve-release/R113-15393.12.0",
"name": "lacros_all_tast_tests EVE_RELEASE_DEV",
Expand All @@ -1789,7 +1782,6 @@
"variant_id": "EVE_RELEASE_DEV"
},
{
"args": [],
"cros_board": "eve",
"cros_img": "eve-release/R112-15359.37.0",
"name": "lacros_all_tast_tests EVE_RELEASE_BETA",
Expand All @@ -1805,7 +1797,6 @@
"variant_id": "EVE_RELEASE_BETA"
},
{
"args": [],
"cros_board": "eve",
"cros_img": "eve-release/R111-15329.59.0",
"name": "lacros_all_tast_tests EVE_RELEASE_STABLE",
Expand Down Expand Up @@ -1856,7 +1847,6 @@
],
"skylab_tests": [
{
"args": [],
"cros_board": "jacuzzi",
"cros_img": "jacuzzi-release/R114-15410.0.0",
"name": "lacros_all_tast_tests JACUZZI_RELEASE_LKGM",
Expand All @@ -1872,7 +1862,6 @@
"variant_id": "JACUZZI_RELEASE_LKGM"
},
{
"args": [],
"cros_board": "jacuzzi",
"cros_img": "jacuzzi-release/R113-15393.12.0",
"name": "lacros_all_tast_tests JACUZZI_RELEASE_DEV",
Expand All @@ -1888,7 +1877,6 @@
"variant_id": "JACUZZI_RELEASE_DEV"
},
{
"args": [],
"cros_board": "jacuzzi",
"cros_img": "jacuzzi-release/R112-15359.37.0",
"name": "lacros_all_tast_tests JACUZZI_RELEASE_BETA",
Expand All @@ -1904,7 +1892,6 @@
"variant_id": "JACUZZI_RELEASE_BETA"
},
{
"args": [],
"cros_board": "jacuzzi",
"cros_img": "jacuzzi-release/R111-15329.59.0",
"name": "lacros_all_tast_tests JACUZZI_RELEASE_STABLE",
Expand Down Expand Up @@ -1955,7 +1942,6 @@
],
"skylab_tests": [
{
"args": [],
"cros_board": "strongbad",
"cros_img": "strongbad-release/R114-15410.0.0",
"name": "lacros_all_tast_tests STRONGBAD_RELEASE_LKGM",
Expand Down
6 changes: 0 additions & 6 deletions testing/buildbot/chromium.chromiumos.json
Expand Up @@ -1479,7 +1479,6 @@
],
"skylab_tests": [
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "eve",
"cros_img": "eve-public/R114-15410.0.0",
Expand All @@ -1499,7 +1498,6 @@
"variant_id": "EVE_PUBLIC_LKGM"
},
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "eve",
"cros_img": "eve-public/R113-15393.12.0",
Expand All @@ -1519,7 +1517,6 @@
"variant_id": "EVE_PUBLIC_DEV"
},
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "eve",
"cros_img": "eve-public/R112-15359.37.0",
Expand All @@ -1539,7 +1536,6 @@
"variant_id": "EVE_PUBLIC_BETA"
},
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "eve",
"cros_img": "eve-public/R111-15329.59.0",
Expand Down Expand Up @@ -1638,7 +1634,6 @@
],
"skylab_tests": [
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "jacuzzi",
"cros_img": "jacuzzi-public/R114-15410.0.0",
Expand Down Expand Up @@ -1667,7 +1662,6 @@
],
"skylab_tests": [
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "kevin",
"cros_img": "kevin64-public/R114-15410.0.0",
Expand Down
7 changes: 0 additions & 7 deletions testing/buildbot/chromium.fyi.json
Expand Up @@ -36806,7 +36806,6 @@
],
"skylab_tests": [
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "octopus",
"cros_img": "octopus-public/R114-15410.0.0",
Expand All @@ -36823,7 +36822,6 @@
"variant_id": "OCTOPUS_PUBLIC_LKGM"
},
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "eve",
"cros_img": "eve-public/R114-15410.0.0",
Expand All @@ -36850,7 +36848,6 @@
],
"skylab_tests": [
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "jacuzzi",
"cros_img": "jacuzzi-public/R114-15410.0.0",
Expand All @@ -36867,7 +36864,6 @@
"variant_id": "JACUZZI_PUBLIC_LKGM"
},
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "kevin",
"cros_img": "kevin64-public/R114-15410.0.0",
Expand All @@ -36891,7 +36887,6 @@
],
"skylab_tests": [
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "jacuzzi",
"cros_img": "jacuzzi-public/R114-15410.0.0",
Expand All @@ -36908,7 +36903,6 @@
"variant_id": "JACUZZI_PUBLIC_LKGM"
},
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "jacuzzi",
"cros_img": "jacuzzi-public/R114-15410.0.0",
Expand All @@ -36927,7 +36921,6 @@
"variant_id": "JACUZZI_CQ_PUBLIC_LKGM"
},
{
"args": [],
"bucket": "chromiumos-image-archive",
"cros_board": "kevin",
"cros_img": "kevin64-public/R114-15410.0.0",
Expand Down

0 comments on commit d14b74c

Please sign in to comment.