From 4c883882b066ecb3f0a39e88c2425c80c7cd6d94 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 3 Nov 2022 23:42:23 -0800 Subject: [PATCH 1/9] improve tooling for local tests --- .github/workflows/test.yml | 48 +++++++++++- Brewfile | 1 + Brewfile.lock.json | 125 ++++++++++++++++++++++++------- Gemfile | 1 + Gemfile.lock | 10 ++- Makefile | 3 + Sentry.xcodeproj/project.pbxproj | 4 + fastlane/Fastfile | 3 +- scripts/xcode-test.sh | 3 +- 9 files changed, 164 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66045c2aa82..cacc5ce9584 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: if: steps.cache_test_server.outputs.cache-hit != 'true' working-directory: test-server run: >- - swift build -c release + swift build -c release 2>&1 | tee test-server-build.log - name: Copy exec working-directory: test-server @@ -50,6 +50,14 @@ jobs: path: | ./test-server/test-server-exec + - name: Archiving Raw Test Logs + uses: actions/upload-artifact@v3 + if: ${{ failure() || cancelled() }} + with: + name: test-server-build-log-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} + path: | + raw-test-output.log + unit-tests: name: Unit ${{matrix.platform}} - Xcode ${{matrix.xcode}} - OS ${{matrix.test-destination-os}} runs-on: ${{matrix.runs-on}} @@ -169,7 +177,7 @@ jobs: # passed to xcodebuild doesn't end up in the job name, # because GitHub Actions don't provide an easy way of # manipulating string in expressions. - run: ./scripts/xcode-test.sh ${{matrix.platform}} ${{matrix.test-destination-os}} ${{matrix.xcode}} $GITHUB_REF_NAME + run: ./scripts/xcode-test.sh ${{matrix.platform}} ${{matrix.test-destination-os}} $GITHUB_REF_NAME - name: Archiving DerivedData Logs uses: actions/upload-artifact@v3 @@ -249,6 +257,15 @@ jobs: run: for i in {1..2}; do fastlane ui_tests_${{matrix.target}} && break ; done shell: sh +# TODO: adapt matrix parameters and figure out where logs go from fastlane +# - name: Archiving Raw Test Logs +# uses: actions/upload-artifact@v3 +# if: ${{ failure() || cancelled() }} +# with: +# name: raw-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} +# path: | +# raw-test-output.log + # SwiftUI only supports iOS 14+ so we run it in a separate matrix here ui-tests-swift-ui: name: UI Tests for SwiftUI on ${{matrix.device}} Simulator @@ -274,6 +291,15 @@ jobs: run: for i in {1..2}; do fastlane ui_tests_ios_swiftui device:"${{matrix.device}}" && break ; done shell: sh +# TODO: adapt matrix parameters and figure out where logs go from fastlane +# - name: Archiving Raw Test Logs +# uses: actions/upload-artifact@v3 +# if: ${{ failure() || cancelled() }} +# with: +# name: raw-swiftui-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} +# path: | +# raw-test-output.log + # macos-11 doesn't have a simulator for iOS 12 ui-tests-swift-ios-12: name: UI Tests on iOS 12 Simulator @@ -297,6 +323,15 @@ jobs: run: for i in {1..2}; do fastlane ui_tests_${{matrix.target}} device:"iPhone 8 (12.4)" address_sanitizer:false && break ; done shell: sh +# TODO: adapt matrix parameters and figure out where logs go from fastlane +# - name: Archiving Raw Test Logs +# uses: actions/upload-artifact@v3 +# if: ${{ failure() || cancelled() }} +# with: +# name: raw-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} +# path: | +# raw-test-output.log + ui-tests-address-sanitizer: name: UI Tests with Address Sanitizer runs-on: macos-12 @@ -309,3 +344,12 @@ jobs: - name: Run Fastlane run: for i in {1..2}; do fastlane ui_tests_ios_swift device:"$iPhone 8 (15.5)" address_sanitizer:true && break ; done shell: sh + +# TODO: adapt matrix parameters and figure out where logs go from fastlane +# - name: Archiving Raw Test Logs +# uses: actions/upload-artifact@v3 +# if: ${{ failure() || cancelled() }} +# with: +# name: raw-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} +# path: | +# raw-test-output.log diff --git a/Brewfile b/Brewfile index 5834e970755..f73ea974548 100644 --- a/Brewfile +++ b/Brewfile @@ -3,3 +3,4 @@ brew 'swiftlint' brew 'carthage' brew 'rbenv' brew 'pre-commit' +brew 'tmux' diff --git a/Brewfile.lock.json b/Brewfile.lock.json index 59d43636514..c4e3174a1ac 100644 --- a/Brewfile.lock.json +++ b/Brewfile.lock.json @@ -2,40 +2,45 @@ "entries": { "brew": { "clang-format": { - "version": "14.0.6", + "version": "15.0.4", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:22ce42d45047a82dbaeb294c988491c8dc41a14db585aba895289b94c98567b5", + "sha256": "22ce42d45047a82dbaeb294c988491c8dc41a14db585aba895289b94c98567b5" + }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:9f25fa006c4f3684d7cc403d81f3dbbd00aef5dcee54d8909fc0b929dc46fd21", - "sha256": "9f25fa006c4f3684d7cc403d81f3dbbd00aef5dcee54d8909fc0b929dc46fd21" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:e6687055a4bbb8c45c534c97593da173020a89464131f8e28d9c51635abdf85e", + "sha256": "e6687055a4bbb8c45c534c97593da173020a89464131f8e28d9c51635abdf85e" }, "arm64_big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:7f1cebeec140ce27dbbf0f9b7ffde342ad1a7d7ae90476e2d8ecf659e44cc8c3", - "sha256": "7f1cebeec140ce27dbbf0f9b7ffde342ad1a7d7ae90476e2d8ecf659e44cc8c3" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:635e65e903d7509bc7b66246b33e80c2c6fa7970ae5ae976b8115346298684af", + "sha256": "635e65e903d7509bc7b66246b33e80c2c6fa7970ae5ae976b8115346298684af" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:7185911bd8c322d7b88340b6a2479454271609d6356c86538c2e2fb7c037950d", - "sha256": "7185911bd8c322d7b88340b6a2479454271609d6356c86538c2e2fb7c037950d" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:840020306f475284733e073f7d3d1f4c2f2e14b8e1a89d79bfa2df8d4dee2c53", + "sha256": "840020306f475284733e073f7d3d1f4c2f2e14b8e1a89d79bfa2df8d4dee2c53" }, "big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:5ce43d5e2e82cdbc41d8dffed41d389c7876509109911132a1a206dd5324eeef", - "sha256": "5ce43d5e2e82cdbc41d8dffed41d389c7876509109911132a1a206dd5324eeef" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:9743f1cb8befbaacba5b60e22762fab2db9337fcbddb66ee9fae69ccb54174ab", + "sha256": "9743f1cb8befbaacba5b60e22762fab2db9337fcbddb66ee9fae69ccb54174ab" }, "catalina": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:5c8b3a8d0fecfed6220b2e97ea818452160fa0e6af03260f350a613e42fd242a", - "sha256": "5c8b3a8d0fecfed6220b2e97ea818452160fa0e6af03260f350a613e42fd242a" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:44458ac88b30b5fddfa0a9679339a6fdca3ad0cd9591f655387d7d12f85ce383", + "sha256": "44458ac88b30b5fddfa0a9679339a6fdca3ad0cd9591f655387d7d12f85ce383" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:201ae67f25cbb2a92d024a40bccf978f8f8b165cad149eabf8dc8f701ff33347", - "sha256": "201ae67f25cbb2a92d024a40bccf978f8f8b165cad149eabf8dc8f701ff33347" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:ba30cee4820b592e8ff594fe0174246286ed062c709e058c713d882a073ac388", + "sha256": "ba30cee4820b592e8ff594fe0174246286ed062c709e058c713d882a073ac388" } } } @@ -60,6 +65,11 @@ "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:de4f931704cfdbd7300a74d8f0ef807394f3366ed1d3d59eabb87edcefa926af", + "sha256": "de4f931704cfdbd7300a74d8f0ef807394f3366ed1d3d59eabb87edcefa926af" + }, "arm64_monterey": { "cellar": ":any_skip_relocation", "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:d983879e2d9ea075bf80e223da5adb258f01d9fab4fc6f71f83c4add80490290", @@ -84,6 +94,11 @@ "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/carthage/blobs/sha256:44bfddd205d71910f3a6829fa7448b10a9bde620cc0d3b88a3d18ecbdb42fe21", + "sha256": "44bfddd205d71910f3a6829fa7448b10a9bde620cc0d3b88a3d18ecbdb42fe21" + }, "arm64_monterey": { "cellar": ":any_skip_relocation", "url": "https://ghcr.io/v2/homebrew/core/carthage/blobs/sha256:31e066eb80819a224b4b98b2c5cb9f11989c787e8de7cc0b4c492663fd0e7075", @@ -123,6 +138,11 @@ "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { + "arm64_ventura": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:09bccc5974bd7b23f60a42c94bf7bc7d0e605cf4ef1f4068f63a1fe905bc5c74", + "sha256": "09bccc5974bd7b23f60a42c94bf7bc7d0e605cf4ef1f4068f63a1fe905bc5c74" + }, "arm64_monterey": { "cellar": ":any", "url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:dede9454bc8a665ac2b1858a0522fb77d95deebb5db7437918cfb056ff119b16", @@ -164,38 +184,87 @@ "pre-commit": { "version": "2.20.0", "bottle": { - "rebuild": 1, + "rebuild": 2, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:5270c8f90c5343d8b0e5eeccfd01d1058957f05c5da7fd2c0d4e4af1fab1ed9f", + "sha256": "5270c8f90c5343d8b0e5eeccfd01d1058957f05c5da7fd2c0d4e4af1fab1ed9f" + }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:4a480973522d0180cfd1414ec3d31f8aa284f26243a89036098dd3343ace6a96", - "sha256": "4a480973522d0180cfd1414ec3d31f8aa284f26243a89036098dd3343ace6a96" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:70cb628421bae2e6136cbc076dd620b2e3a1229ce93e47ad5592fe7739e3420b", + "sha256": "70cb628421bae2e6136cbc076dd620b2e3a1229ce93e47ad5592fe7739e3420b" }, "arm64_big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:cb061bc7f86b3149975d8bee8a209410c786d11ffa4091ad7769d6810a37ef5a", - "sha256": "cb061bc7f86b3149975d8bee8a209410c786d11ffa4091ad7769d6810a37ef5a" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:667e0b88c513b4ebc18265f3885c2fe5da0f0126f759cdf4cecaf52b5b1123b8", + "sha256": "667e0b88c513b4ebc18265f3885c2fe5da0f0126f759cdf4cecaf52b5b1123b8" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:b822f396ca2e6523195d6c17ac8bf41eb6aee2e7ceac2ac0c18fbfd708c6a3ab", - "sha256": "b822f396ca2e6523195d6c17ac8bf41eb6aee2e7ceac2ac0c18fbfd708c6a3ab" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:aff7fa28a2dacf9fbee3688cdea29c3fcf389044f791cc6284919b4f69172a5a", + "sha256": "aff7fa28a2dacf9fbee3688cdea29c3fcf389044f791cc6284919b4f69172a5a" }, "big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:40508e1e583f42c3581c2488d8fcb4b88e4138bfb775e88041166ae8385f25a3", - "sha256": "40508e1e583f42c3581c2488d8fcb4b88e4138bfb775e88041166ae8385f25a3" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:53f5ba9dca685812cf1de4a2760313fe134a5f7e5bd1eff1439e82c16129a94f", + "sha256": "53f5ba9dca685812cf1de4a2760313fe134a5f7e5bd1eff1439e82c16129a94f" }, "catalina": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:4bd415259c3ca8fe8255c8116865d88e5841cd618d9e75ddfdf04ce79c19e53d", - "sha256": "4bd415259c3ca8fe8255c8116865d88e5841cd618d9e75ddfdf04ce79c19e53d" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:0d801a89ff2c787a8c8980ff53833dc8255c885fbd1cbdf4934c27d5cd49f407", + "sha256": "0d801a89ff2c787a8c8980ff53833dc8255c885fbd1cbdf4934c27d5cd49f407" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:b08cce9e555890e9d84d0bd987ce9e9a3b87da1297c8bb6a728c17d3f59ed2c3", + "sha256": "b08cce9e555890e9d84d0bd987ce9e9a3b87da1297c8bb6a728c17d3f59ed2c3" + } + } + } + }, + "tmux": { + "version": "3.3a", + "bottle": { + "rebuild": 1, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_ventura": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:6c72c3fbce35b39cb8e4df69cb18c288cd01744f5394c912a8f72539a6700a32", + "sha256": "6c72c3fbce35b39cb8e4df69cb18c288cd01744f5394c912a8f72539a6700a32" + }, + "arm64_monterey": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:0ca53c250a3e70d97ca511edd13f2d16660e4e94a41465a8708306e03b231b76", + "sha256": "0ca53c250a3e70d97ca511edd13f2d16660e4e94a41465a8708306e03b231b76" + }, + "arm64_big_sur": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:89a9edfec5e665df5b9e2e0f47e1721c1e074725846705819042a9c691683981", + "sha256": "89a9edfec5e665df5b9e2e0f47e1721c1e074725846705819042a9c691683981" + }, + "monterey": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:c0489c25fa963b14fd5d3c53eb50f681e85bb7a5716883afe77c1efbdea7c882", + "sha256": "c0489c25fa963b14fd5d3c53eb50f681e85bb7a5716883afe77c1efbdea7c882" + }, + "big_sur": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:85eb7ec949aad04ad0a550a4a8151bc4453e229d813fda0be724f17fd8cf40e1", + "sha256": "85eb7ec949aad04ad0a550a4a8151bc4453e229d813fda0be724f17fd8cf40e1" + }, + "catalina": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:3cb3c779b9e62f0f5f5d9204309d194148ee66e3bc930480cabf7bee1b897623", + "sha256": "3cb3c779b9e62f0f5f5d9204309d194148ee66e3bc930480cabf7bee1b897623" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:95bb496c02885d65a8db70ad434fda479a99a146e0244308c9be91322b0a2dd3", - "sha256": "95bb496c02885d65a8db70ad434fda479a99a146e0244308c9be91322b0a2dd3" + "url": "https://ghcr.io/v2/homebrew/core/tmux/blobs/sha256:b2eed5059099ba7ffeb68260c3163184b5d9b6a09e3b9b80d33ab2bf007513d8", + "sha256": "b2eed5059099ba7ffeb68260c3163184b5d9b6a09e3b9b80d33ab2bf007513d8" } } } @@ -205,9 +274,9 @@ "system": { "macos": { "monterey": { - "HOMEBREW_VERSION": "3.6.5", + "HOMEBREW_VERSION": "3.6.8", "HOMEBREW_PREFIX": "/opt/homebrew", - "Homebrew/homebrew-core": "8953dee9c8266b88d45b1697cc931bdf0112342d", + "Homebrew/homebrew-core": "f0a57e9d6af030b3c8daee72b91ca541e1683543", "CLT": "14.0.0.0.1.1661618636", "Xcode": "14.0", "macOS": "12.6" diff --git a/Gemfile b/Gemfile index 5cce8ee3bad..486024d9a87 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,7 @@ gem "bundler", ">= 2" gem "cocoapods", ">= 1.9.1" gem "fastlane" gem "rest-client" +gem "tmuxinator" gem "xcpretty" eval_gemfile("fastlane/Pluginfile") diff --git a/Gemfile.lock b/Gemfile.lock index a2201a3b4a1..c54de074b4b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,6 +83,7 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) emoji_regex (3.2.3) + erubis (2.7.0) escape (0.0.4) ethon (0.15.0) ffi (>= 1.15.0) @@ -255,6 +256,11 @@ GEM terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) + thor (1.2.1) + tmuxinator (3.0.5) + erubis (~> 2.6) + thor (~> 1.2.1) + xdg (~> 2.2, >= 2.2.5) trailblazer-option (0.1.2) tty-cursor (0.7.1) tty-screen (0.8.1) @@ -282,7 +288,8 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - zeitwerk (2.6.1) + xdg (2.2.5) + zeitwerk (2.6.4) PLATFORMS ruby @@ -293,6 +300,7 @@ DEPENDENCIES fastlane fastlane-plugin-sentry rest-client + tmuxinator xcpretty BUNDLED WITH diff --git a/Makefile b/Makefile index b42715b09fb..e657c3dfc25 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,9 @@ run-test-server: cd ./test-server && swift run & .PHONY: run-test-server +test-all: run-test-server + rbenv exec bundle exec tmuxinator start + analyze: rm -rf analyzer xcodebuild analyze -workspace Sentry.xcworkspace -scheme Sentry -configuration Release CLANG_ANALYZER_OUTPUT=html CLANG_ANALYZER_OUTPUT_DIR=analyzer -destination "platform=iOS Simulator,OS=latest,name=iPhone 11" CODE_SIGNING_ALLOWED="NO" | xcpretty -t && [[ -z `find analyzer -name "*.html"` ]] diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index 75695df6b91..8d940f19322 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -1401,6 +1401,8 @@ 84A8891A28DBD28900C51DFD /* SentryDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDevice.h; path = include/SentryDevice.h; sourceTree = ""; }; 84A8891B28DBD28900C51DFD /* SentryDevice.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryDevice.mm; sourceTree = ""; }; 84A8892028DBD8D600C51DFD /* SentryDeviceTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryDeviceTests.mm; sourceTree = ""; }; + 84E4F5692914F020004C7358 /* Brewfile */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = text; path = Brewfile; sourceTree = ""; tabWidth = 2; }; + 84E4F56B2914F599004C7358 /* tmuxinator.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = tmuxinator.yml; sourceTree = ""; }; 861265F72404EC1500C4AFDE /* NSArray+SentrySanitize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "NSArray+SentrySanitize.h"; path = "include/NSArray+SentrySanitize.h"; sourceTree = ""; }; 861265F82404EC1500C4AFDE /* NSArray+SentrySanitize.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+SentrySanitize.m"; sourceTree = ""; }; 8E0551DF26A7A63C00400526 /* TestProtocolClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProtocolClient.swift; sourceTree = ""; }; @@ -1718,6 +1720,8 @@ 844DA81628246D5000E6B62E /* .gitignore */, 844DA80828246D5000E6B62E /* .gitmodules */, 844DA80328246D5000E6B62E /* .oclint */, + 84E4F56B2914F599004C7358 /* tmuxinator.yml */, + 84E4F5692914F020004C7358 /* Brewfile */, 844A3563282B3C9F00C6D1DF /* .sauce */, 844DA80B28246D5000E6B62E /* Brewfile */, 844DA81D28246DAE00E6B62E /* develop-docs */, diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 2db18626bdc..e6754712c69 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -233,7 +233,8 @@ platform :ios do run_tests( workspace: "Sentry.xcworkspace", scheme: "iOS-SwiftUI", - configuration: configuration + configuration: configuration, + ) end diff --git a/scripts/xcode-test.sh b/scripts/xcode-test.sh index b157b5918aa..436770bc0f5 100755 --- a/scripts/xcode-test.sh +++ b/scripts/xcode-test.sh @@ -10,8 +10,7 @@ set -uox pipefail PLATFORM="${1}" OS=${2:-latest} -XCODE="${3}" -REF_NAME="${4}" +REF_NAME="${3}" DESTINATION="" CONFIGURATION="" From 3be32c25cd6b1b233693cf1a7e3940618f129572 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Fri, 4 Nov 2022 00:41:45 -0800 Subject: [PATCH 2/9] updates to tests --- .github/workflows/test.yml | 2 +- .gitignore | 3 +++ Brewfile | 1 - Gemfile | 1 - Makefile | 7 ++++--- Sentry.xcodeproj/project.pbxproj | 2 -- scripts/test-all.sh | 29 +++++++++++++++++++++++++++++ scripts/xcode-test.sh | 18 ++++++++++++------ 8 files changed, 49 insertions(+), 14 deletions(-) create mode 100755 scripts/test-all.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cacc5ce9584..7918e48729d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -244,7 +244,7 @@ jobs: ui-tests: name: UI Tests for ${{matrix.target}} on Simulators runs-on: macos-12 - strategy: + strategy: matrix: target: ['ios_swift', 'ios_objc', 'tvos_swift'] diff --git a/.gitignore b/.gitignore index b23da2ff8a4..ee55cb011c7 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,6 @@ Package.resolved # Visual Studio Code .vscode/ + +Cartfile.resolved +*.log diff --git a/Brewfile b/Brewfile index f73ea974548..5834e970755 100644 --- a/Brewfile +++ b/Brewfile @@ -3,4 +3,3 @@ brew 'swiftlint' brew 'carthage' brew 'rbenv' brew 'pre-commit' -brew 'tmux' diff --git a/Gemfile b/Gemfile index 486024d9a87..5cce8ee3bad 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,6 @@ gem "bundler", ">= 2" gem "cocoapods", ">= 1.9.1" gem "fastlane" gem "rest-client" -gem "tmuxinator" gem "xcpretty" eval_gemfile("fastlane/Pluginfile") diff --git a/Makefile b/Makefile index e657c3dfc25..f446289a8cb 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,9 @@ run-test-server: cd ./test-server && swift run & .PHONY: run-test-server -test-all: run-test-server - rbenv exec bundle exec tmuxinator start +.PHONY: test-all +test-all: + ./scripts/test-all.sh analyze: rm -rf analyzer @@ -56,7 +57,7 @@ analyze: # For more info check out: https://github.com/Carthage/Carthage/releases/tag/0.38.0 build-xcframework: @echo "--> Carthage: creating Sentry xcframework" - carthage build --use-xcframeworks --no-skip-current + carthage build --use-xcframeworks --no-skip-current --project-directory . # use ditto here to avoid clobbering symlinks which exist in macOS frameworks ditto -c -k -X --rsrc --keepParent Carthage Sentry.xcframework.zip diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index 8d940f19322..d5c30adc421 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -1402,7 +1402,6 @@ 84A8891B28DBD28900C51DFD /* SentryDevice.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryDevice.mm; sourceTree = ""; }; 84A8892028DBD8D600C51DFD /* SentryDeviceTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryDeviceTests.mm; sourceTree = ""; }; 84E4F5692914F020004C7358 /* Brewfile */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = text; path = Brewfile; sourceTree = ""; tabWidth = 2; }; - 84E4F56B2914F599004C7358 /* tmuxinator.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = tmuxinator.yml; sourceTree = ""; }; 861265F72404EC1500C4AFDE /* NSArray+SentrySanitize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "NSArray+SentrySanitize.h"; path = "include/NSArray+SentrySanitize.h"; sourceTree = ""; }; 861265F82404EC1500C4AFDE /* NSArray+SentrySanitize.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+SentrySanitize.m"; sourceTree = ""; }; 8E0551DF26A7A63C00400526 /* TestProtocolClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProtocolClient.swift; sourceTree = ""; }; @@ -1720,7 +1719,6 @@ 844DA81628246D5000E6B62E /* .gitignore */, 844DA80828246D5000E6B62E /* .gitmodules */, 844DA80328246D5000E6B62E /* .oclint */, - 84E4F56B2914F599004C7358 /* tmuxinator.yml */, 84E4F5692914F020004C7358 /* Brewfile */, 844A3563282B3C9F00C6D1DF /* .sauce */, 844DA80B28246D5000E6B62E /* Brewfile */, diff --git a/scripts/test-all.sh b/scripts/test-all.sh new file mode 100755 index 00000000000..2a602f9168a --- /dev/null +++ b/scripts/test-all.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -eou pipefail + +#echo "make build-xcframework" +#make build-xcframework 2>/dev/null +# +#echo "make build-xcframework-sample" +#make build-xcframework-sample 2>/dev/null + +echo "./scripts/xcode-test.sh iOS latest" +./scripts/xcode-test.sh iOS latest local local 2>/dev/null + +echo "./scripts/xcode-test.sh macOS latest" +./scripts/xcode-test.sh macOS latest local local 2>/dev/null + +echo "./scripts/xcode-test.sh tvOS latest" +./scripts/xcode-test.sh tvOS latest local local 2>/dev/null + +echo "fastlane ui_tests_ios_swift" +rbenv exec bundle exec fastlane ui_tests_ios_swift 2>/dev/null + +echo "fastlane ui_tests_ios_objc" +rbenv exec bundle exec fastlane ui_tests_ios_objc 2>/dev/null + +echo "fastlane ui_tests_tvos_swift" +rbenv exec bundle exec fastlane ui_tests_tvos_swift 2>/dev/null + +echo "fastlane ui_tests_ios_swiftui" +rbenv exec bundle exec fastlane ui_tests_ios_swiftui 2>/dev/null diff --git a/scripts/xcode-test.sh b/scripts/xcode-test.sh index 436770bc0f5..2bebe654cdf 100755 --- a/scripts/xcode-test.sh +++ b/scripts/xcode-test.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -uox pipefail +set -uo pipefail # This is a helper script for GitHub Actions Matrix. # If we would specify the destinations in the GitHub Actions @@ -11,6 +11,7 @@ set -uox pipefail PLATFORM="${1}" OS=${2:-latest} REF_NAME="${3}" +IS_LOCAL_BUILD="${4:-ci}" DESTINATION="" CONFIGURATION="" @@ -38,8 +39,6 @@ case $PLATFORM in ;; esac -echo "REF_NAME: $REF_NAME" - case $REF_NAME in "master") CONFIGURATION="TestCI" @@ -50,7 +49,14 @@ case $REF_NAME in ;; esac -echo "CONFIGURATION: $CONFIGURATION" +case $IS_LOCAL_BUILD in + "ci") + RUBY_ENV_ARGS="" + ;; + *) + RUBY_ENV_ARGS="rbenv exec bundle exec" + ;; +esac if [ $PLATFORM == "iOS" -a $OS == "12.4" ]; then # Skip some tests that fail on iOS 12.4. @@ -59,10 +65,10 @@ if [ $PLATFORM == "iOS" -a $OS == "12.4" ]; then GCC_GENERATE_TEST_COVERAGE_FILES=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES -destination "$DESTINATION" \ -skip-testing:"SentryTests/SentrySDKTests/testMemoryFootprintOfAddingBreadcrumbs" \ -skip-testing:"SentryTests/SentrySDKTests/testMemoryFootprintOfTransactions" \ - test | tee raw-test-output.log | xcpretty -t && exit ${PIPESTATUS[0]} + test | tee raw-test-output.log | $RUBY_ENV_ARGS xcpretty -t && exit ${PIPESTATUS[0]} else env NSUnbufferedIO=YES xcodebuild -workspace Sentry.xcworkspace \ -scheme Sentry -configuration $CONFIGURATION \ GCC_GENERATE_TEST_COVERAGE_FILES=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES -destination "$DESTINATION" \ - test | tee raw-test-output.log | xcpretty -t && exit ${PIPESTATUS[0]} + test | tee raw-test-output.log | $RUBY_ENV_ARGS xcpretty -t && exit ${PIPESTATUS[0]} fi From 05e6a5f3760d5ea5dcd085f357abbd9e2e85e86d Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 17 Nov 2022 11:04:05 -0900 Subject: [PATCH 3/9] update dev tools --- Brewfile.lock.json | 31 ++++++++++++++++++++++++++++--- Gemfile.lock | 14 +++----------- scripts/xcode-test.sh | 11 ++++++++--- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/Brewfile.lock.json b/Brewfile.lock.json index c4e3174a1ac..3040a4cf859 100644 --- a/Brewfile.lock.json +++ b/Brewfile.lock.json @@ -22,6 +22,11 @@ "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:635e65e903d7509bc7b66246b33e80c2c6fa7970ae5ae976b8115346298684af", "sha256": "635e65e903d7509bc7b66246b33e80c2c6fa7970ae5ae976b8115346298684af" }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:313506ad3a59bdea702b964c76784cb280041960faff6f4ef30327a28e79107b", + "sha256": "313506ad3a59bdea702b964c76784cb280041960faff6f4ef30327a28e79107b" + }, "monterey": { "cellar": ":any_skip_relocation", "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:840020306f475284733e073f7d3d1f4c2f2e14b8e1a89d79bfa2df8d4dee2c53", @@ -75,6 +80,11 @@ "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:d983879e2d9ea075bf80e223da5adb258f01d9fab4fc6f71f83c4add80490290", "sha256": "d983879e2d9ea075bf80e223da5adb258f01d9fab4fc6f71f83c4add80490290" }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:509e34c1cfdfda9dace98481bc42cc57575c78ffe7711d381b851c330ee4d8b8", + "sha256": "509e34c1cfdfda9dace98481bc42cc57575c78ffe7711d381b851c330ee4d8b8" + }, "monterey": { "cellar": ":any_skip_relocation", "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:73a9664d8a62c7b5d506a70bf100e0289795df04ece6df12f0b77651e497d42b", @@ -109,6 +119,11 @@ "url": "https://ghcr.io/v2/homebrew/core/carthage/blobs/sha256:e9be26e66087b149d4d6ff813323fb5fa1ac0ec1a55d3d1a26fc3aafc8f8e8ec", "sha256": "e9be26e66087b149d4d6ff813323fb5fa1ac0ec1a55d3d1a26fc3aafc8f8e8ec" }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/carthage/blobs/sha256:3ce52863cb7175f47439020dabbb004b292a1a935056e6dc5bf614b285eb5d5e", + "sha256": "3ce52863cb7175f47439020dabbb004b292a1a935056e6dc5bf614b285eb5d5e" + }, "monterey": { "cellar": ":any_skip_relocation", "url": "https://ghcr.io/v2/homebrew/core/carthage/blobs/sha256:17481cd77a643af4799e2c603ae808cd09a6487e73638caab0af8cdeffc2c438", @@ -153,6 +168,11 @@ "url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:d5e6168ad6ab8843946273319fc6949b322c80f2d666a6bdda62466e256e6746", "sha256": "d5e6168ad6ab8843946273319fc6949b322c80f2d666a6bdda62466e256e6746" }, + "ventura": { + "cellar": ":any", + "url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:e654c2cf9b9966093b2d045cb9b12dbd32a7cd8926194838e13ee7d17184b1f5", + "sha256": "e654c2cf9b9966093b2d045cb9b12dbd32a7cd8926194838e13ee7d17184b1f5" + }, "monterey": { "cellar": ":any", "url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:42657e04e2d1e8bf9abb9c5f0ba50e567df95f93a2a212491f005e4bd0ad9cee", @@ -202,6 +222,11 @@ "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:667e0b88c513b4ebc18265f3885c2fe5da0f0126f759cdf4cecaf52b5b1123b8", "sha256": "667e0b88c513b4ebc18265f3885c2fe5da0f0126f759cdf4cecaf52b5b1123b8" }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:b091378b66c94fbdf5b901c4b1a8894501e7a109722b9994de794e41136f3c5d", + "sha256": "b091378b66c94fbdf5b901c4b1a8894501e7a109722b9994de794e41136f3c5d" + }, "monterey": { "cellar": ":any_skip_relocation", "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:aff7fa28a2dacf9fbee3688cdea29c3fcf389044f791cc6284919b4f69172a5a", @@ -274,11 +299,11 @@ "system": { "macos": { "monterey": { - "HOMEBREW_VERSION": "3.6.8", + "HOMEBREW_VERSION": "3.6.11", "HOMEBREW_PREFIX": "/opt/homebrew", - "Homebrew/homebrew-core": "f0a57e9d6af030b3c8daee72b91ca541e1683543", + "Homebrew/homebrew-core": "eb883958bf1c625497c8beb5836bb34b59890540", "CLT": "14.0.0.0.1.1661618636", - "Xcode": "14.0", + "Xcode": "14.1", "macOS": "12.6" } } diff --git a/Gemfile.lock b/Gemfile.lock index c54de074b4b..16f9357a92d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,7 +17,7 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.660.0) + aws-partitions (1.662.0) aws-sdk-core (3.167.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) @@ -83,9 +83,8 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) emoji_regex (3.2.3) - erubis (2.7.0) escape (0.0.4) - ethon (0.15.0) + ethon (0.16.0) ffi (>= 1.15.0) excon (0.94.0) faraday (1.10.2) @@ -256,11 +255,6 @@ GEM terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - thor (1.2.1) - tmuxinator (3.0.5) - erubis (~> 2.6) - thor (~> 1.2.1) - xdg (~> 2.2, >= 2.2.5) trailblazer-option (0.1.2) tty-cursor (0.7.1) tty-screen (0.8.1) @@ -288,8 +282,7 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - xdg (2.2.5) - zeitwerk (2.6.4) + zeitwerk (2.6.6) PLATFORMS ruby @@ -300,7 +293,6 @@ DEPENDENCIES fastlane fastlane-plugin-sentry rest-client - tmuxinator xcpretty BUNDLED WITH diff --git a/scripts/xcode-test.sh b/scripts/xcode-test.sh index 2bebe654cdf..2334307d9b9 100755 --- a/scripts/xcode-test.sh +++ b/scripts/xcode-test.sh @@ -12,7 +12,9 @@ PLATFORM="${1}" OS=${2:-latest} REF_NAME="${3}" IS_LOCAL_BUILD="${4:-ci}" +DEVICE_OVERRIDE="${5:-}" DESTINATION="" +IOS_DEVICE="iPhone 8" CONFIGURATION="" case $PLATFORM in @@ -26,15 +28,18 @@ case $PLATFORM in ;; "iOS") - DESTINATION="platform=iOS Simulator,OS=$OS,name=iPhone 8" + if [[ -n $DEVICE_OVERRIDE ]]; then + IOS_DEVICE=$DEVICE_OVERRIDE + fi + DESTINATION="platform=iOS Simulator,OS=$OS,name=$IOS_DEVICE" ;; "tvOS") DESTINATION="platform=tvOS Simulator,OS=$OS,name=Apple TV" ;; - + *) - echo "Xcode Test: Can't find destination for platform '$PLATFORM'"; + echo "Xcode Test: Can't find destination for platform '$PLATFORM'"; exit 1; ;; esac From 585eef4b51ba0da8eb9b6b8aa445b46df694b475 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 17 Nov 2022 11:07:28 -0900 Subject: [PATCH 4/9] fix xcode-test.sh after rebase --- scripts/xcode-test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/xcode-test.sh b/scripts/xcode-test.sh index 2334307d9b9..95ca03d10d2 100755 --- a/scripts/xcode-test.sh +++ b/scripts/xcode-test.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -uo pipefail +set -uox pipefail # This is a helper script for GitHub Actions Matrix. # If we would specify the destinations in the GitHub Actions @@ -11,8 +11,8 @@ set -uo pipefail PLATFORM="${1}" OS=${2:-latest} REF_NAME="${3}" -IS_LOCAL_BUILD="${4:-ci}" -DEVICE_OVERRIDE="${5:-}" +DEVICE_OVERRIDE="${4:-}" +IS_LOCAL_BUILD="${5:-ci}" DESTINATION="" IOS_DEVICE="iPhone 8" CONFIGURATION="" From ce6ffa48250a226cbd840c06c06c4843c9d424a9 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 17 Nov 2022 11:09:36 -0900 Subject: [PATCH 5/9] redirect stderrs to log files --- scripts/test-all.sh | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/scripts/test-all.sh b/scripts/test-all.sh index 2a602f9168a..0f0f1d09bfb 100755 --- a/scripts/test-all.sh +++ b/scripts/test-all.sh @@ -1,29 +1,12 @@ #!/bin/bash -set -eou pipefail - -#echo "make build-xcframework" -#make build-xcframework 2>/dev/null -# -#echo "make build-xcframework-sample" -#make build-xcframework-sample 2>/dev/null - -echo "./scripts/xcode-test.sh iOS latest" -./scripts/xcode-test.sh iOS latest local local 2>/dev/null - -echo "./scripts/xcode-test.sh macOS latest" -./scripts/xcode-test.sh macOS latest local local 2>/dev/null - -echo "./scripts/xcode-test.sh tvOS latest" -./scripts/xcode-test.sh tvOS latest local local 2>/dev/null - -echo "fastlane ui_tests_ios_swift" -rbenv exec bundle exec fastlane ui_tests_ios_swift 2>/dev/null - -echo "fastlane ui_tests_ios_objc" -rbenv exec bundle exec fastlane ui_tests_ios_objc 2>/dev/null - -echo "fastlane ui_tests_tvos_swift" -rbenv exec bundle exec fastlane ui_tests_tvos_swift 2>/dev/null - -echo "fastlane ui_tests_ios_swiftui" -rbenv exec bundle exec fastlane ui_tests_ios_swiftui 2>/dev/null +set -eoux pipefail + +make build-xcframework 2>&1 > build-xcframework_stderr.log +make build-xcframework-sample 2>&1 > build-xcframework-sample_stderr.log +./scripts/xcode-test.sh iOS latest local local 2>&1 > ios_test_stderr.log +./scripts/xcode-test.sh macOS latest local local 2>&1 > macos_test_stderr.log +./scripts/xcode-test.sh tvOS latest local local 2>&1 > tvos_test_stderr.log +rbenv exec bundle exec fastlane ui_tests_ios_swift 2>&1 > ios-swift_uitest_stderr.log +rbenv exec bundle exec fastlane ui_tests_ios_objc 2>&1 > ios-objc.log +rbenv exec bundle exec fastlane ui_tests_tvos_swift 2>&1 > tvos-swift_uitest_stderr.log +rbenv exec bundle exec fastlane ui_tests_ios_swiftui 2>&1 > ios-swiftui_uitest_stderr.log From 529c523cdbba45293748cc28c2a2cd22c0d420cc Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 17 Nov 2022 15:37:15 -0900 Subject: [PATCH 6/9] improve IS_LOCAL_BUILD default; dont provide device override option --- scripts/xcode-test.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/xcode-test.sh b/scripts/xcode-test.sh index 95ca03d10d2..19b170c0fa1 100755 --- a/scripts/xcode-test.sh +++ b/scripts/xcode-test.sh @@ -10,9 +10,8 @@ set -uox pipefail PLATFORM="${1}" OS=${2:-latest} -REF_NAME="${3}" -DEVICE_OVERRIDE="${4:-}" -IS_LOCAL_BUILD="${5:-ci}" +REF_NAME="${3-HEAD}" +IS_LOCAL_BUILD="${4:-ci}" DESTINATION="" IOS_DEVICE="iPhone 8" CONFIGURATION="" @@ -28,10 +27,7 @@ case $PLATFORM in ;; "iOS") - if [[ -n $DEVICE_OVERRIDE ]]; then - IOS_DEVICE=$DEVICE_OVERRIDE - fi - DESTINATION="platform=iOS Simulator,OS=$OS,name=$IOS_DEVICE" + DESTINATION="platform=iOS Simulator,OS=$OS,name=iPhone 8" ;; "tvOS") From a58e2f8c8bb3b2dbf2dfb1d786524b2ee34705da Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 17 Nov 2022 15:53:24 -0900 Subject: [PATCH 7/9] archive fastlane build/test logs after failures --- .github/workflows/test.yml | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7918e48729d..e05e3b7e329 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -257,14 +257,14 @@ jobs: run: for i in {1..2}; do fastlane ui_tests_${{matrix.target}} && break ; done shell: sh -# TODO: adapt matrix parameters and figure out where logs go from fastlane -# - name: Archiving Raw Test Logs -# uses: actions/upload-artifact@v3 -# if: ${{ failure() || cancelled() }} -# with: -# name: raw-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} -# path: | -# raw-test-output.log + - name: Archiving Raw Test Logs + uses: actions/upload-artifact@v3 + if: ${{ failure() || cancelled() }} + with: + name: raw-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} + path: | + ~/Library/Logs/scan/*.log + ./fastlane/test_output/** # SwiftUI only supports iOS 14+ so we run it in a separate matrix here ui-tests-swift-ui: @@ -291,14 +291,14 @@ jobs: run: for i in {1..2}; do fastlane ui_tests_ios_swiftui device:"${{matrix.device}}" && break ; done shell: sh -# TODO: adapt matrix parameters and figure out where logs go from fastlane -# - name: Archiving Raw Test Logs -# uses: actions/upload-artifact@v3 -# if: ${{ failure() || cancelled() }} -# with: -# name: raw-swiftui-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} -# path: | -# raw-test-output.log + - name: Archiving Raw Test Logs + uses: actions/upload-artifact@v3 + if: ${{ failure() || cancelled() }} + with: + name: raw-swiftui-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} + path: | + ~/Library/Logs/scan/*.log + ./fastlane/test_output/** # macos-11 doesn't have a simulator for iOS 12 ui-tests-swift-ios-12: @@ -323,14 +323,14 @@ jobs: run: for i in {1..2}; do fastlane ui_tests_${{matrix.target}} device:"iPhone 8 (12.4)" address_sanitizer:false && break ; done shell: sh -# TODO: adapt matrix parameters and figure out where logs go from fastlane -# - name: Archiving Raw Test Logs -# uses: actions/upload-artifact@v3 -# if: ${{ failure() || cancelled() }} -# with: -# name: raw-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} -# path: | -# raw-test-output.log + - name: Archiving Raw Test Logs + uses: actions/upload-artifact@v3 + if: ${{ failure() || cancelled() }} + with: + name: raw-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} + path: | + ~/Library/Logs/scan/*.log + ./fastlane/test_output/** ui-tests-address-sanitizer: name: UI Tests with Address Sanitizer @@ -345,11 +345,11 @@ jobs: run: for i in {1..2}; do fastlane ui_tests_ios_swift device:"$iPhone 8 (15.5)" address_sanitizer:true && break ; done shell: sh -# TODO: adapt matrix parameters and figure out where logs go from fastlane -# - name: Archiving Raw Test Logs -# uses: actions/upload-artifact@v3 -# if: ${{ failure() || cancelled() }} -# with: -# name: raw-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} -# path: | -# raw-test-output.log + - name: Archiving Raw Test Logs + uses: actions/upload-artifact@v3 + if: ${{ failure() || cancelled() }} + with: + name: raw-test-output-${{matrix.platform}}-xcode-${{matrix.xcode}}-os-${{matrix.test-destination-os}} + path: | + ~/Library/Logs/scan/*.log + ./fastlane/test_output/** From eff40c0f79be6b8abadcc6404b85aaf9840b750e Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 17 Nov 2022 15:55:20 -0900 Subject: [PATCH 8/9] remove test-all --- Makefile | 4 ---- scripts/test-all.sh | 12 ------------ 2 files changed, 16 deletions(-) delete mode 100755 scripts/test-all.sh diff --git a/Makefile b/Makefile index f446289a8cb..43ccf27b2de 100644 --- a/Makefile +++ b/Makefile @@ -44,10 +44,6 @@ run-test-server: cd ./test-server && swift run & .PHONY: run-test-server -.PHONY: test-all -test-all: - ./scripts/test-all.sh - analyze: rm -rf analyzer xcodebuild analyze -workspace Sentry.xcworkspace -scheme Sentry -configuration Release CLANG_ANALYZER_OUTPUT=html CLANG_ANALYZER_OUTPUT_DIR=analyzer -destination "platform=iOS Simulator,OS=latest,name=iPhone 11" CODE_SIGNING_ALLOWED="NO" | xcpretty -t && [[ -z `find analyzer -name "*.html"` ]] diff --git a/scripts/test-all.sh b/scripts/test-all.sh deleted file mode 100755 index 0f0f1d09bfb..00000000000 --- a/scripts/test-all.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eoux pipefail - -make build-xcframework 2>&1 > build-xcframework_stderr.log -make build-xcframework-sample 2>&1 > build-xcframework-sample_stderr.log -./scripts/xcode-test.sh iOS latest local local 2>&1 > ios_test_stderr.log -./scripts/xcode-test.sh macOS latest local local 2>&1 > macos_test_stderr.log -./scripts/xcode-test.sh tvOS latest local local 2>&1 > tvos_test_stderr.log -rbenv exec bundle exec fastlane ui_tests_ios_swift 2>&1 > ios-swift_uitest_stderr.log -rbenv exec bundle exec fastlane ui_tests_ios_objc 2>&1 > ios-objc.log -rbenv exec bundle exec fastlane ui_tests_tvos_swift 2>&1 > tvos-swift_uitest_stderr.log -rbenv exec bundle exec fastlane ui_tests_ios_swiftui 2>&1 > ios-swiftui_uitest_stderr.log From f95bf6f14e9a92c9e2338b836a2cb4f1871933e7 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 17 Nov 2022 16:05:16 -0900 Subject: [PATCH 9/9] cleanup --- Makefile | 2 +- fastlane/Fastfile | 3 +-- scripts/xcode-test.sh | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 43ccf27b2de..b42715b09fb 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ analyze: # For more info check out: https://github.com/Carthage/Carthage/releases/tag/0.38.0 build-xcframework: @echo "--> Carthage: creating Sentry xcframework" - carthage build --use-xcframeworks --no-skip-current --project-directory . + carthage build --use-xcframeworks --no-skip-current # use ditto here to avoid clobbering symlinks which exist in macOS frameworks ditto -c -k -X --rsrc --keepParent Carthage Sentry.xcframework.zip diff --git a/fastlane/Fastfile b/fastlane/Fastfile index e6754712c69..2db18626bdc 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -233,8 +233,7 @@ platform :ios do run_tests( workspace: "Sentry.xcworkspace", scheme: "iOS-SwiftUI", - configuration: configuration, - + configuration: configuration ) end diff --git a/scripts/xcode-test.sh b/scripts/xcode-test.sh index 19b170c0fa1..08ed9f176bf 100755 --- a/scripts/xcode-test.sh +++ b/scripts/xcode-test.sh @@ -13,7 +13,6 @@ OS=${2:-latest} REF_NAME="${3-HEAD}" IS_LOCAL_BUILD="${4:-ci}" DESTINATION="" -IOS_DEVICE="iPhone 8" CONFIGURATION="" case $PLATFORM in