Skip to content

Commit

Permalink
tests: make envoy_mobile_android_test macro work with kt files (#2436)
Browse files Browse the repository at this point in the history
Description: Add support for Kotlin robolectric tests by making `envoy_mobile_android_test` macro use `kt_android_local_test` maco as opposed to `android_local_test` macro as the former supports both Java and Kotlin files while the latter supports Java files only. The change should be additive when it comes to functionality. Bump `rules_kotlin` version to v1.7.0-RC-3 to pick up changes from bazelbuild/rules_kotlin#810.
Risk Level: None
Testing: Existing tests using envoy_mobile_android_test macro.
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Rafal Augustyniak <[email protected]>
Signed-off-by: JP Simard <[email protected]>
  • Loading branch information
Augustyniak authored and jpsim committed Nov 28, 2022
1 parent 861e5b0 commit 2f9cbf4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mobile/bazel/envoy_mobile_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def kotlin_repos():

http_archive(
name = "io_bazel_rules_kotlin",
sha256 = "946747acdbeae799b085d12b240ec346f775ac65236dfcf18aa0cd7300f6de78",
urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/v1.7.0-RC-2/rules_kotlin_release.tgz"],
sha256 = "f033fa36f51073eae224f18428d9493966e67c27387728b6be2ebbdae43f140e",
urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/v1.7.0-RC-3/rules_kotlin_release.tgz"],
)

http_archive(
Expand Down
5 changes: 3 additions & 2 deletions mobile/bazel/kotlin_test.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@build_bazel_rules_android//android:rules.bzl", "android_library", "android_local_test")
load("@build_bazel_rules_android//android:rules.bzl", "android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_local_test")
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test")
load("//bazel:kotlin_lib.bzl", "native_lib_name")

Expand Down Expand Up @@ -78,7 +79,7 @@ def envoy_mobile_android_test(name, srcs, deps = [], native_deps = [], repositor
exports = deps,
testonly = True,
)
android_local_test(
kt_android_local_test(
name = name,
srcs = srcs,
data = native_deps,
Expand Down

0 comments on commit 2f9cbf4

Please sign in to comment.