Skip to content

Commit

Permalink
Fix runners array quirk
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrymarino committed Aug 10, 2023
1 parent 16a5895 commit 630d536
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rules/test.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@build_bazel_rules_apple//apple/internal/testing:ios_rules.bzl", _ios_internal_ui_test_bundle = "ios_internal_ui_test_bundle", _ios_internal_unit_test_bundle = "ios_internal_unit_test_bundle", _ios_ui_test = "ios_ui_test", _ios_unit_test = "ios_unit_test")
load("@bazel_skylib//lib:types.bzl", "types")
load("//rules:library.bzl", "apple_library")
load("//rules:plists.bzl", "process_infoplists")
load("//rules/internal:framework_middleman.bzl", "dep_middleman", "framework_middleman")
Expand Down Expand Up @@ -162,13 +163,16 @@ def _ios_test(name, bundle_rule, test_rule, test_factory, apple_library, infopli
ios_test_kwargs["test_host"] = "@build_bazel_rules_ios//rules/test_host_app:iOS-%s-AppHost" % ios_test_kwargs.get("minimum_os_version")

runners = kwargs.pop("runners", None)
runner = kwargs.pop("runner", _DEFAULT_APPLE_TEST_RUNNER)
if "runner" in kwargs and (runners and runners != []):
fail("cannot specify both runner and runners for %s" % name)

if runners:
ios_test_kwargs["runners"] = runners
elif types.is_list(runner):
# Runners attribute has accepts a list - we need to gen many tests
ios_test_kwargs["runners"] = runner
else:
ios_test_kwargs["runner"] = kwargs.pop("runner", _DEFAULT_APPLE_TEST_RUNNER)
ios_test_kwargs["runner"] = runner

# Deduplicate against the test deps
if ios_test_kwargs.get("test_host", None):
Expand Down

0 comments on commit 630d536

Please sign in to comment.