From 27f48af189613844ac03fbba07b84fa82f5abc73 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 15 Nov 2024 14:14:43 -0500 Subject: [PATCH 1/9] [Infra] Migrate away fromm macos-12 in performance.yml --- .github/workflows/performance.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index af24594c944..5a4c08e98a7 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -28,7 +28,7 @@ jobs: performance: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' - runs-on: macos-12 + runs-on: macos-14 strategy: matrix: target: [iOS, tvOS] @@ -43,7 +43,6 @@ jobs: run: scripts/setup_bundler.sh - name: Install xcpretty run: gem install xcpretty - #TODO: Xcode 15 tests are blocked by #11903 - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10 run: scripts/third_party/travis/retry.sh scripts/build.sh Performance ${{ matrix.target }} ${{ matrix.test }} From f874a83b6cfa22f753d355467f8608e996b15dda Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 18 Nov 2024 12:44:17 -0500 Subject: [PATCH 2/9] Set exit code 65 if `xcodebuild test` has unexpected failures --- scripts/build.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/build.sh b/scripts/build.sh index 67e576ac990..6b85c48fd66 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -114,6 +114,7 @@ function RunXcodebuild() { result=0 xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? + result=$(CheckUnexpectedFailures $result xcodebuild.log) if [[ $result == 65 ]]; then ExportLogs "$@" @@ -123,6 +124,7 @@ function RunXcodebuild() { result=0 xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? + result=$(CheckUnexpectedFailures $result xcodebuild.log) fi if [[ $result != 0 ]]; then @@ -138,6 +140,19 @@ function ExportLogs() { python "${scripts_dir}/xcresult_logs.py" "$@" } +function CheckUnexpectedFailures() { + local result=$1 + local log_file=$2 + + if [[ $result != 0 ]]; then + return "$result" + elif grep -Eq "[1-9]\d* failures \([1-9]\d* unexpected\)" "$log_file"; then + return 65 + else + return 0 + fi +} + if [[ "$xcode_major" -lt 15 ]]; then ios_flags=( -sdk 'iphonesimulator' From 9030013f4583a032eb53033c475cfda622c0dd1f Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 18 Nov 2024 13:04:33 -0500 Subject: [PATCH 3/9] Echo when `grep` finds unexpected failures --- scripts/build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 6b85c48fd66..96782e297ba 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -131,7 +131,7 @@ function RunXcodebuild() { echo "xcodebuild exited with $result" 1>&2 ExportLogs "$@" - return $result + return "$result" fi } @@ -147,9 +147,10 @@ function CheckUnexpectedFailures() { if [[ $result != 0 ]]; then return "$result" elif grep -Eq "[1-9]\d* failures \([1-9]\d* unexpected\)" "$log_file"; then + echo "xcodebuild failed with unexpected failures; updating exit code." 1>&2 return 65 else - return 0 + return "$result" fi } From eb7fd4153a286fc7e9411dfda03c99f04b960a98 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 18 Nov 2024 15:01:43 -0500 Subject: [PATCH 4/9] Fix return code logic --- scripts/build.sh | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 96782e297ba..4ea6868070a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -110,11 +110,12 @@ source scripts/check_secrets.sh function RunXcodebuild() { echo xcodebuild "$@" - xcbeautify_cmd=(xcbeautify --renderer github-actions) + xcbeautify_cmd=(xcbeautify --renderer github-actions --disable-logging) result=0 - xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? - result=$(CheckUnexpectedFailures $result xcodebuild.log) + xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" \ + && CheckUnexpectedFailures xcodebuild.log \ + || result=$? if [[ $result == 65 ]]; then ExportLogs "$@" @@ -123,8 +124,9 @@ function RunXcodebuild() { sleep 5 result=0 - xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? - result=$(CheckUnexpectedFailures $result xcodebuild.log) + xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" \ + && CheckUnexpectedFailures xcodebuild.log \ + || result=$? fi if [[ $result != 0 ]]; then @@ -141,16 +143,11 @@ function ExportLogs() { } function CheckUnexpectedFailures() { - local result=$1 - local log_file=$2 + local log_file=$1 - if [[ $result != 0 ]]; then - return "$result" - elif grep -Eq "[1-9]\d* failures \([1-9]\d* unexpected\)" "$log_file"; then - echo "xcodebuild failed with unexpected failures; updating exit code." 1>&2 + if grep -Eq "[1-9]\d* failures \([1-9]\d* unexpected\)" "$log_file"; then + echo "xcodebuild failed with unexpected failures." 1>&2 return 65 - else - return "$result" fi } From 164d27a719abf0bcb4a79514dfa49a12f522d786 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 18 Nov 2024 15:32:05 -0500 Subject: [PATCH 5/9] Temporarily disable macos-15 performance.spm jobs --- .github/workflows/performance.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 5a4c08e98a7..edb12fccdbb 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -156,12 +156,12 @@ jobs: - os: macos-14 xcode: Xcode_15.4 target: iOS - - os: macos-15 - xcode: Xcode_16.1 - target: iOS - - os: macos-15 - xcode: Xcode_16.1 - target: tvOS + # - os: macos-15 + # xcode: Xcode_16.1 + # target: iOS + # - os: macos-15 + # xcode: Xcode_16.1 + # target: tvOS runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 From aa0a2d4ab473a070f09ba3970395a81fc91e8b26 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 18 Nov 2024 15:36:03 -0500 Subject: [PATCH 6/9] Revert "Temporarily disable macos-15 performance.spm jobs" This reverts commit 164d27a719abf0bcb4a79514dfa49a12f522d786. --- .github/workflows/performance.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index edb12fccdbb..5a4c08e98a7 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -156,12 +156,12 @@ jobs: - os: macos-14 xcode: Xcode_15.4 target: iOS - # - os: macos-15 - # xcode: Xcode_16.1 - # target: iOS - # - os: macos-15 - # xcode: Xcode_16.1 - # target: tvOS + - os: macos-15 + xcode: Xcode_16.1 + target: iOS + - os: macos-15 + xcode: Xcode_16.1 + target: tvOS runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 From 4bb58e2bf31d6c9d1401f65caccb6a4de214109c Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 18 Nov 2024 15:36:08 -0500 Subject: [PATCH 7/9] Revert "Fix return code logic" This reverts commit eb7fd4153a286fc7e9411dfda03c99f04b960a98. --- scripts/build.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 4ea6868070a..96782e297ba 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -110,12 +110,11 @@ source scripts/check_secrets.sh function RunXcodebuild() { echo xcodebuild "$@" - xcbeautify_cmd=(xcbeautify --renderer github-actions --disable-logging) + xcbeautify_cmd=(xcbeautify --renderer github-actions) result=0 - xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" \ - && CheckUnexpectedFailures xcodebuild.log \ - || result=$? + xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? + result=$(CheckUnexpectedFailures $result xcodebuild.log) if [[ $result == 65 ]]; then ExportLogs "$@" @@ -124,9 +123,8 @@ function RunXcodebuild() { sleep 5 result=0 - xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" \ - && CheckUnexpectedFailures xcodebuild.log \ - || result=$? + xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? + result=$(CheckUnexpectedFailures $result xcodebuild.log) fi if [[ $result != 0 ]]; then @@ -143,11 +141,16 @@ function ExportLogs() { } function CheckUnexpectedFailures() { - local log_file=$1 + local result=$1 + local log_file=$2 - if grep -Eq "[1-9]\d* failures \([1-9]\d* unexpected\)" "$log_file"; then - echo "xcodebuild failed with unexpected failures." 1>&2 + if [[ $result != 0 ]]; then + return "$result" + elif grep -Eq "[1-9]\d* failures \([1-9]\d* unexpected\)" "$log_file"; then + echo "xcodebuild failed with unexpected failures; updating exit code." 1>&2 return 65 + else + return "$result" fi } From f3602f9a7502f4d3383542ebf388003be2fe6ee0 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 18 Nov 2024 15:36:13 -0500 Subject: [PATCH 8/9] Revert "Echo when `grep` finds unexpected failures" This reverts commit 9030013f4583a032eb53033c475cfda622c0dd1f. --- scripts/build.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 96782e297ba..6b85c48fd66 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -131,7 +131,7 @@ function RunXcodebuild() { echo "xcodebuild exited with $result" 1>&2 ExportLogs "$@" - return "$result" + return $result fi } @@ -147,10 +147,9 @@ function CheckUnexpectedFailures() { if [[ $result != 0 ]]; then return "$result" elif grep -Eq "[1-9]\d* failures \([1-9]\d* unexpected\)" "$log_file"; then - echo "xcodebuild failed with unexpected failures; updating exit code." 1>&2 return 65 else - return "$result" + return 0 fi } From 6b1ba1f4503fcc54fa0ba007ff4ee2e02afa76b8 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 18 Nov 2024 15:36:19 -0500 Subject: [PATCH 9/9] Revert "Set exit code 65 if `xcodebuild test` has unexpected failures" This reverts commit f874a83b6cfa22f753d355467f8608e996b15dda. --- scripts/build.sh | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 6b85c48fd66..67e576ac990 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -114,7 +114,6 @@ function RunXcodebuild() { result=0 xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? - result=$(CheckUnexpectedFailures $result xcodebuild.log) if [[ $result == 65 ]]; then ExportLogs "$@" @@ -124,7 +123,6 @@ function RunXcodebuild() { result=0 xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? - result=$(CheckUnexpectedFailures $result xcodebuild.log) fi if [[ $result != 0 ]]; then @@ -140,19 +138,6 @@ function ExportLogs() { python "${scripts_dir}/xcresult_logs.py" "$@" } -function CheckUnexpectedFailures() { - local result=$1 - local log_file=$2 - - if [[ $result != 0 ]]; then - return "$result" - elif grep -Eq "[1-9]\d* failures \([1-9]\d* unexpected\)" "$log_file"; then - return 65 - else - return 0 - fi -} - if [[ "$xcode_major" -lt 15 ]]; then ios_flags=( -sdk 'iphonesimulator'