Improve ObjC bazel test and add TODOs. (#29665)

* objC bazel test: run InteropTests and MacTests

* objC bazel test: run TvTests

* Revert "objC bazel test: run TvTests"

This reverts commit 46a81991a9.

* avoid running flaky objC InteropTests under bazel

* add TODOs for objc run_tests.py tasks

* add a note about GRPC_VERBOSITY=debug being set

* increase timeout for ios-buildtest-example-tvOS-sample test task
pull/29676/head
Jan Tattermusch 3 years ago committed by GitHub
parent 71b42ab312
commit 345f12afa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      tools/internal_ci/macos/grpc_objc_bazel_test.sh
  2. 27
      tools/run_tests/run_tests.py

@ -46,8 +46,9 @@ EXAMPLE_TARGETS=(
TEST_TARGETS=(
# TODO(jtattermusch): ideally we'd say "//src/objective-c/tests/..." but not all the targets currently build
# TODO(jtattermusch): make //src/objective-c/tests:TvTests build reliably
# TODO(jtattermusch): make //src/objective-c/tests:MacTests build reliably
# TODO(jtattermusch): make //src/objective-c/tests:TvTests test pass with bazel
# TODO(jtattermusch): make sure the //src/objective-c/tests:InteropTests test passes reliably under bazel
//src/objective-c/tests:MacTests
//src/objective-c/tests:UnitTests
)
@ -74,10 +75,12 @@ INTEROP_SERVER_BINARY=bazel-bin/test/cpp/interop/interop_server
trap 'echo "KILLING interop_server binaries running on the background"; kill -9 $(jobs -p)' EXIT
# === END SECTION: run interop_server on the background ====
# TODO(jtattermusch): set GRPC_VERBOSITY=debug when running tests on a simulator (how to do that?)
python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path objc_bazel_tests
# NOTE: When using bazel to run the tests, test env variables like GRPC_VERBOSITY or GRPC_TRACE
# seem to be correctly applied to the test environment even when running tests on a simulator.
# The below configuration runs all the tests with --test_env=GRPC_VERBOSITY=debug, which makes
# the test logs much more useful.
objc_bazel_tests/bazel_wrapper \
--bazelrc=tools/remote_build/include/test_locally_with_resultstore_results.bazelrc \
test \

@ -981,6 +981,7 @@ class ObjCLanguage(object):
def test_specs(self):
out = []
# TODO(jtattermusch): Remove this task since the sample is already being built as part of the grpc_objc_bazel_test job.
out.append(
self.config.job_spec(
['src/objective-c/tests/build_one_example_bazel.sh'],
@ -993,6 +994,7 @@ class ObjCLanguage(object):
'FRAMEWORKS': 'NO'
}))
# Currently not supporting compiling as frameworks in Bazel
# TODO(jtattermusch): verify the above claim is still accurate.
out.append(
self.config.job_spec(
['src/objective-c/tests/build_one_example.sh'],
@ -1004,6 +1006,7 @@ class ObjCLanguage(object):
'EXAMPLE_PATH': 'src/objective-c/examples/Sample',
'FRAMEWORKS': 'YES'
}))
# TODO(jtattermusch): Create bazel target for the sample and remove the test task from here.
out.append(
self.config.job_spec(
['src/objective-c/tests/build_one_example.sh'],
@ -1014,10 +1017,11 @@ class ObjCLanguage(object):
'SCHEME': 'SwiftSample',
'EXAMPLE_PATH': 'src/objective-c/examples/SwiftSample'
}))
# TODO(jtattermusch): Remove this task since the sample is already being built as part of the grpc_objc_bazel_test job.
out.append(
self.config.job_spec(
['src/objective-c/tests/build_one_example_bazel.sh'],
timeout_seconds=10 * 60,
timeout_seconds=20 * 60,
shortname='ios-buildtest-example-tvOS-sample',
cpu_cost=1e6,
environ={
@ -1038,12 +1042,17 @@ class ObjCLanguage(object):
# 'EXAMPLE_PATH': 'src/objective-c/examples/watchOS-sample',
# 'FRAMEWORKS': 'NO'
# }))
# TODO(jtattermusch): Create bazel target for the test and remove the test from here
out.append(
self.config.job_spec(['src/objective-c/tests/run_plugin_tests.sh'],
timeout_seconds=60 * 60,
shortname='ios-test-plugintest',
cpu_cost=1e6,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
# Note that this test basically tests whether the codegen plugin works correctly by running protoc and checking the contents of the generated *.pbrpc.* files.
# it doesn't really build any ObjC code.
# TODO(jtattermusch): turn this test into a bazel test or come up with a better place where to put this test.
out.append(
self.config.job_spec(
['src/objective-c/tests/run_plugin_option_tests.sh'],
@ -1051,6 +1060,8 @@ class ObjCLanguage(object):
shortname='ios-test-plugin-option-test',
cpu_cost=1e6,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
# TODO(jtattermusch): move the test out of the test/core/iomgr/CFStreamTests directory?
# How does one add the cfstream dependency in bazel?
out.append(
self.config.job_spec(
['test/core/iomgr/ios/CFStreamTests/build_and_run_tests.sh'],
@ -1058,6 +1069,8 @@ class ObjCLanguage(object):
shortname='ios-test-cfstream-tests',
cpu_cost=1e6,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
# TODO(jtattermusch): Create bazel target for the test and remove the test from here
# TODO(jtattermusch): Clarify what do these tests do?
out.append(
self.config.job_spec(
['src/objective-c/tests/CoreTests/build_and_run_tests.sh'],
@ -1065,43 +1078,52 @@ class ObjCLanguage(object):
shortname='ios-test-core-tests',
cpu_cost=1e6,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
# TODO: replace with run_one_test_bazel.sh when Bazel-Xcode is stable
# TODO(jtattermusch): Remove this task since the tests are already being run as part of the grpc_objc_bazel_test job.
out.append(
self.config.job_spec(['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=60 * 60,
shortname='ios-test-unittests',
cpu_cost=1e6,
environ={'SCHEME': 'UnitTests'}))
# TODO(jtattermusch): Make sure the //src/objective-c/tests:InteropTests bazel test passes reliably and remove the test from there.
out.append(
self.config.job_spec(['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=60 * 60,
shortname='ios-test-interoptests',
cpu_cost=1e6,
environ={'SCHEME': 'InteropTests'}))
# TODO(jtattermusch): Create bazel target for the test and remove the test from here
# (how does one add the cronet dependency in bazel?)
out.append(
self.config.job_spec(['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=60 * 60,
shortname='ios-test-cronettests',
cpu_cost=1e6,
environ={'SCHEME': 'CronetTests'}))
# TODO(jtattermusch): Create bazel target for the test and remove the test from here.
out.append(
self.config.job_spec(['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=30 * 60,
shortname='ios-perf-test',
cpu_cost=1e6,
environ={'SCHEME': 'PerfTests'}))
# TODO(jtattermusch): Clarify what's the difference between PerfTests and PerfTestsPosix
# TODO(jtattermusch): Create bazel target for the test and remove the test from here.
out.append(
self.config.job_spec(['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=30 * 60,
shortname='ios-perf-test-posix',
cpu_cost=1e6,
environ={'SCHEME': 'PerfTestsPosix'}))
# TODO(jtattermusch): Create bazel target for the test (how does one add the cronet dependency in bazel?)
# TODO(jtattermusch): move the test out of the test/cpp/ios directory?
out.append(
self.config.job_spec(['test/cpp/ios/build_and_run_tests.sh'],
timeout_seconds=60 * 60,
shortname='ios-cpp-test-cronet',
cpu_cost=1e6,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
# TODO(jtattermusch): Remove this task since the tests are already being run as part of the grpc_objc_bazel_test job.
out.append(
self.config.job_spec(['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=60 * 60,
@ -1111,6 +1133,7 @@ class ObjCLanguage(object):
'SCHEME': 'MacTests',
'PLATFORM': 'macos'
}))
# TODO(jtattermusch): Make sure the //src/objective-c/tests:TvTests bazel test passes and remove the test from here.
out.append(
self.config.job_spec(['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=30 * 60,

Loading…
Cancel
Save