Imported Upstream version 1.34.0
[platform/upstream/grpc.git] / tools / internal_ci / linux / grpc_bazel_build_in_docker.sh
index e6e751c..60d5fc3 100755 (executable)
@@ -26,3 +26,18 @@ ${name}')
 cd /var/local/git/grpc
 
 bazel build :all //test/... //examples/...
+
+# TODO(jtattersmusch): Adding a build here for --define=grpc_no_xds is not ideal
+# and we should find a better place for this. Refer
+# https://github.com/grpc/grpc/pull/24536#pullrequestreview-517466531 for more
+# details.
+# Test that builds with --define=grpc_no_xds=true work.
+bazel build //test/cpp/end2end:end2end_test --define=grpc_no_xds=true
+# Test that builds that need xDS do not build with --define=grpc_no_xds=true
+EXIT_CODE=0
+bazel build //test/cpp/end2end:xds_end2end_test --define=grpc_no_xds=true || EXIT_CODE=$?
+if [ $EXIT_CODE -eq 0 ]
+then
+       echo "Building xds_end2end_test succeeded even with --define=grpc_no_xds=true"
+       exit 1
+fi