diff --git a/.travis.yml b/.travis.yml index c640a566..c39264a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ install: matrix: fast_finish: true env: - - TEST_TYPE=bazel.build + - TEST_TYPE=bazel.test script: ./ci/ci_steps.sh branches: diff --git a/api/rlds.proto b/api/rlds.proto index 0b1f7692..b8fdb224 100644 --- a/api/rlds.proto +++ b/api/rlds.proto @@ -61,20 +61,6 @@ message RateLimitDescriptor { repeated Entry entries = 1; } -// Defines an actual rate limit in terms of requests per unit of time and the unit itself. -message RateLimit { - enum Unit { - UNKNOWN = 0; - SECOND = 1; - MINUTE = 2; - HOUR = 3; - DAY = 4; - } - - uint32 requests_per_unit = 1; - Unit unit = 2; -} - // A response from a ShouldRateLimit call. message RateLimitResponse { enum Code { @@ -83,6 +69,20 @@ message RateLimitResponse { OVER_LIMIT = 2; } + // Defines an actual rate limit in terms of requests per unit of time and the unit itself. + message RateLimit { + enum Unit { + UNKNOWN = 0; + SECOND = 1; + MINUTE = 2; + HOUR = 3; + DAY = 4; + } + + uint32 requests_per_unit = 1; + Unit unit = 2; + } + message DescriptorStatus { // The response code for an individual descriptor. Code code = 1; diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 46b24328..49194d1c 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -8,9 +8,10 @@ set -e echo "building using ${NUM_CPUS} CPUs" -if [[ "$1" == "bazel.build" ]]; then - echo "bazel build..." +if [[ "$1" == "bazel.test" ]]; then + echo "bazel building and testing..." bazel --batch build ${BAZEL_BUILD_OPTIONS} //... + bazel --batch test ${BAZEL_TEST_OPTIONS} //... exit 0 else echo "Invalid do_ci.sh target. The only valid target is bazel.build." diff --git a/test/build/BUILD b/test/build/BUILD new file mode 100644 index 00000000..681dacc4 --- /dev/null +++ b/test/build/BUILD @@ -0,0 +1,12 @@ +cc_test( + name = "build_test", + srcs = ["build_test.cc"], + deps = [ + "//api:cds", + "//api:eds", + "//api:hds", + "//api:lds", + "//api:rlds", + "//api:rds", + ], +) diff --git a/test/build/build_test.cc b/test/build/build_test.cc new file mode 100644 index 00000000..476fe075 --- /dev/null +++ b/test/build/build_test.cc @@ -0,0 +1,16 @@ +#include "api/cds.pb.h" +#include "api/eds.pb.h" +#include "api/hds.pb.h" +#include "api/lds.pb.h" +#include "api/rlds.pb.h" +#include "api/rds.pb.h" + +// Basic C++ build/link validation for the v2 xDS APIs. +int main(int argc, char *argv[]) { + envoy::api::v2::ClusterDiscoveryService::descriptor(); + envoy::api::v2::EndpointDiscoveryService::descriptor(); + envoy::api::v2::HealthDiscoveryService::descriptor(); + envoy::api::v2::ListenerDiscoveryService::descriptor(); + envoy::api::v2::RateLimitDiscoveryService::descriptor(); + envoy::api::v2::RouteDiscoveryService::descriptor(); +}