From 9df6d1d41ef06c679c864fb7fc8fdd48b9fd878e Mon Sep 17 00:00:00 2001 From: "Denny C. Dai" Date: Tue, 28 Sep 2021 04:15:40 -0700 Subject: [PATCH] [objc] Clean pod cache in CI build and set verbose (#27494) --- src/objective-c/tests/build_tests.sh | 22 +++++++++++++------ .../iomgr/ios/CFStreamTests/build_tests.sh | 13 +++++------ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/objective-c/tests/build_tests.sh b/src/objective-c/tests/build_tests.sh index 6dbca6a58ef..95d17cd74d7 100755 --- a/src/objective-c/tests/build_tests.sh +++ b/src/objective-c/tests/build_tests.sh @@ -16,7 +16,7 @@ # Don't run this script standalone. Instead, run from the repository root: # ./tools/run_tests/run_tests.py -l objc -set -e +set -ev # CocoaPods requires the terminal to be using UTF-8 encoding. export LANG=en_US.UTF-8 @@ -29,12 +29,20 @@ hash xcodebuild 2>/dev/null || { exit 1 } -# clean the directory -rm -rf Pods -rm -rf Tests.xcworkspace -rm -f Podfile.lock +# clean pod cache and prior pods +rm -Rf Pods Podfile.lock Tests.xcworkspace rm -f RemoteTestClient/*.{h,m} +pod cache clean --all echo "TIME: $(date)" -pod install | ./verbose_time.sh - +pod install --verbose | ./verbose_time.sh + +# verify pod header installation +if [ -d "./Pods/Headers/Public/gRPC-Core/grpc/impl/codegen" ] +then + echo "grpc/impl/codegen/ has been imported." + number_of_files=$(find Pods/Headers/Public/gRPC-Core/grpc/impl/codegen -name "*.h" | wc -l) + echo "The number of files in Pods/Headers/Public/gRPC-Core/grpc/impl/codegen/ is $number_of_files" +else + echo "Error: grpc/impl/codegen/ hasn't been imported." +fi diff --git a/test/core/iomgr/ios/CFStreamTests/build_tests.sh b/test/core/iomgr/ios/CFStreamTests/build_tests.sh index a008dc517cb..f4262456012 100755 --- a/test/core/iomgr/ios/CFStreamTests/build_tests.sh +++ b/test/core/iomgr/ios/CFStreamTests/build_tests.sh @@ -16,7 +16,7 @@ # Don't run this script standalone. Instead, run from the repository root: # ./tools/run_tests/run_tests.py -l objc -set -e +set -ev # CocoaPods requires the terminal to be using UTF-8 encoding. export LANG=en_US.UTF-8 @@ -29,19 +29,18 @@ hash xcodebuild 2>/dev/null || { exit 1 } -# clean the directory -rm -rf Pods -rm -rf CFStreamTests.xcworkspace -rm -f Podfile.lock +# clean up pod cache and existing pods +rm -Rf Pods Podfile.lock CFStreamTests.xcworkspace +pod cache clean --all echo "TIME: $(date)" -pod install +pod install --verbose # ios-test-cfstream-tests flakes sometimes because of missing files in gRPC-Core, # add some log to help find out the root cause. # TODO(yulinliang): Delete it after solving the issue. if [ -d "./Pods/Headers/Public/gRPC-Core/grpc/impl/codegen" ] -then +then echo "grpc/impl/codegen/ has been imported." number_of_files=$(find Pods/Headers/Public/gRPC-Core/grpc/impl/codegen -name "*.h" | wc -l) echo "The number of files in Pods/Headers/Public/gRPC-Core/grpc/impl/codegen/ is $number_of_files"