| 1 |
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") |
| 2 |
|
| 3 |
config_setting( |
| 4 |
name = "windows_x86_64", |
| 5 |
values = {"cpu": "x64_windows"}, |
| 6 |
) |
| 7 |
|
| 8 |
go_library( |
| 9 |
name = "go_default_library", |
| 10 |
srcs = [ |
| 11 |
"cases.go", |
| 12 |
"executor.go", |
| 13 |
"harness.go", |
| 14 |
"worker.go", |
| 15 |
], |
| 16 |
importpath = "github.com/envoyproxy/protoc-gen-validate/tests/harness/executor", |
| 17 |
visibility = ["//visibility:private"], |
| 18 |
deps = [ |
| 19 |
"//tests/harness:harness_go_proto", |
| 20 |
"//tests/harness/cases:go", |
| 21 |
"//tests/harness/cases/other_package:go", |
| 22 |
"//tests/harness/cases/yet_another_package:go", |
| 23 |
"//tests/harness/cases/sort:go", |
| 24 |
"@org_golang_google_protobuf//proto:go_default_library", |
| 25 |
"@org_golang_google_protobuf//types/known/anypb:go_default_library", |
| 26 |
"@org_golang_google_protobuf//types/known/durationpb:go_default_library", |
| 27 |
"@org_golang_google_protobuf//types/known/timestamppb:go_default_library", |
| 28 |
"@org_golang_google_protobuf//types/known/wrapperspb:go_default_library", |
| 29 |
"@org_golang_x_net//context:go_default_library", |
| 30 |
], |
| 31 |
) |
| 32 |
|
| 33 |
go_binary( |
| 34 |
name = "executor", |
| 35 |
data = ["//tests/harness/cc:cc-harness"] + select({ |
| 36 |
":windows_x86_64": [ |
| 37 |
"//tests/harness/go/main:go-harness-exe", |
| 38 |
], |
| 39 |
"//conditions:default": [ |
| 40 |
"//tests/harness/go/main:go-harness-bin", |
| 41 |
"//tests/harness/java:java-harness", |
| 42 |
"//tests/harness/python:python-harness", |
| 43 |
], |
| 44 |
}), |
| 45 |
embed = [":go_default_library"], |
| 46 |
importpath = "github.com/envoyproxy/protoc-gen-validate/tests/harness/executor", |
| 47 |
visibility = ["//visibility:private"], |
| 48 |
) |
| 49 |
|
| 50 |
[ |
| 51 |
sh_test( |
| 52 |
name = "executor_" + lang + "_test", |
| 53 |
srcs = ["executor_test.sh"], |
| 54 |
args = [ |
| 55 |
"$(location :executor)", |
| 56 |
"-" + lang, |
| 57 |
], |
| 58 |
data = [":executor"], |
| 59 |
# This could be sharded more, but each shard incurs overhead and test |
| 60 |
# execution is already sharded by having separate test rules for each language. |
| 61 |
shard_count = 5, |
| 62 |
deps = ["@bazel_tools//tools/bash/runfiles"], |
| 63 |
) |
| 64 |
for lang in ("cc", "go", "java", "python") |
| 65 |
] |