go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/lucicfg/testdata/misc/test_presentation.star (about)

     1  """
     2  The main purpose of this test file is to ensure that
     3  `luci.builder(properties=..., test_presentation=...)` does not throw an error
     4  when the provided `properties` is immutable. This can happen when the
     5  `properties` were passed to/from a different execution context.
     6  """
     7  
     8  # Don't set the default builder properties.
     9  # i.e. No calls to `luci.builder.defaults.properties.set(...)`.
    10  
    11  luci.builder.defaults.test_presentation.set(
    12      resultdb.test_presentation(
    13          column_keys = ["v.gpu"],
    14          grouping_keys = ["v.test_suite", "status"],
    15      ),
    16  )
    17  
    18  luci.recipe.defaults.cipd_package.set("cipd/default")
    19  luci.recipe.defaults.cipd_version.set("refs/default")
    20  
    21  luci.project(
    22      name = "project",
    23      buildbucket = "cr-buildbucket.appspot.com",
    24      scheduler = "luci-scheduler.appspot.com",
    25      swarming = "chromium-swarm.appspot.com",
    26  )
    27  
    28  luci.bucket(name = "ci")
    29  
    30  shared_immutable_properties = {}
    31  
    32  # This should not throw
    33  # `Error in _builder: cannot insert into frozen hash table`
    34  luci.builder(
    35      name = "builder1",
    36      bucket = "ci",
    37      executable = luci.recipe(
    38          name = "recipe",
    39          cipd_package = "cipd/package",
    40          cipd_version = "refs/version",
    41      ),
    42      properties = shared_immutable_properties,
    43      test_presentation = resultdb.test_presentation(
    44          column_keys = ["v.os"],
    45          grouping_keys = ["v.test_suite", "status"],
    46      ),
    47  )
    48  
    49  # This should not throw
    50  # `Error in _builder: cannot insert into frozen hash table`
    51  luci.builder(
    52      name = "builder2",
    53      bucket = "ci",
    54      executable = luci.recipe(
    55          name = "recipe",
    56          cipd_package = "cipd/package",
    57          cipd_version = "refs/version",
    58      ),
    59      properties = shared_immutable_properties,
    60      test_presentation = resultdb.test_presentation(column_keys = ["v.gpu"]),
    61  )
    62  
    63  # Expect configs:
    64  #
    65  # === cr-buildbucket.cfg
    66  # buckets {
    67  #   name: "ci"
    68  #   swarming {
    69  #     builders {
    70  #       name: "builder1"
    71  #       swarming_host: "chromium-swarm.appspot.com"
    72  #       recipe {
    73  #         name: "recipe"
    74  #         cipd_package: "cipd/package"
    75  #         cipd_version: "refs/version"
    76  #         properties_j: "$recipe_engine/resultdb/test_presentation:{\"column_keys\":[\"v.os\"],\"grouping_keys\":[\"v.test_suite\",\"status\"]}"
    77  #       }
    78  #     }
    79  #     builders {
    80  #       name: "builder2"
    81  #       swarming_host: "chromium-swarm.appspot.com"
    82  #       recipe {
    83  #         name: "recipe"
    84  #         cipd_package: "cipd/package"
    85  #         cipd_version: "refs/version"
    86  #         properties_j: "$recipe_engine/resultdb/test_presentation:{\"column_keys\":[\"v.gpu\"],\"grouping_keys\":[\"status\"]}"
    87  #       }
    88  #     }
    89  #   }
    90  # }
    91  # ===
    92  #
    93  # === project.cfg
    94  # name: "project"
    95  # ===
    96  #
    97  # === realms.cfg
    98  # realms {
    99  #   name: "@root"
   100  # }
   101  # realms {
   102  #   name: "ci"
   103  # }
   104  # ===