• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2018 gRPC authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15#
16# This is for the gRPC build system. This isn't intended to be used outsite of
17# the BUILD file for gRPC. It contains the mapping for the template system we
18# use to generate other platform's build system files.
19#
20# Please consider that there should be a high bar for additions and changes to
21# this file.
22# Each rule listed must be re-written for Google's internal build system, and
23# each change must be ported from one to the other.
24#
25
26"""Script to run qps benchmark."""
27
28load("//bazel:grpc_build_system.bzl", "grpc_cc_test")
29load("//test/cpp/qps:qps_json_driver_scenarios.bzl", "QPS_JSON_DRIVER_SCENARIOS")
30load("//test/cpp/qps:json_run_localhost_scenarios.bzl", "JSON_RUN_LOCALHOST_SCENARIOS")
31
32def qps_json_driver_batch():
33    for scenario in QPS_JSON_DRIVER_SCENARIOS:
34        grpc_cc_test(
35            name = "qps_json_driver_test_%s" % scenario,
36            srcs = ["qps_json_driver.cc"],
37            args = [
38                "--run_inproc",
39                "--scenarios_json",
40                QPS_JSON_DRIVER_SCENARIOS[scenario],
41            ],
42            external_deps = [
43                "gflags",
44            ],
45            deps = [
46                ":benchmark_config",
47                ":driver_impl",
48                "//:grpc++",
49                "//test/cpp/util:test_config",
50                "//test/cpp/util:test_util",
51            ],
52            tags = [
53                "qps_json_driver",
54                "no_mac",
55            ],
56        )
57
58def json_run_localhost_batch():
59    for scenario in JSON_RUN_LOCALHOST_SCENARIOS:
60        grpc_cc_test(
61            name = "json_run_localhost_%s" % scenario,
62            srcs = ["json_run_localhost.cc"],
63            args = [
64                "--scenarios_json",
65                JSON_RUN_LOCALHOST_SCENARIOS[scenario],
66            ],
67            data = [
68                "//test/cpp/qps:qps_json_driver",
69                "//test/cpp/qps:qps_worker",
70            ],
71            deps = [
72                "//:gpr",
73                "//test/core/util:grpc_test_util",
74                "//test/cpp/util:test_config",
75                "//test/cpp/util:test_util",
76            ],
77            tags = [
78                "json_run_localhost",
79                "no_windows",
80                "no_mac",
81            ],
82        )
83