From e67d008d108bf93f7a28c15a927fd9cf576b28de Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 19 Jun 2025 14:51:02 +1000 Subject: [PATCH 1/3] Run tests on iPhone 16 Pro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an arbitrary change, but I noticed that if I run the tests on my machine with iPhone 16, the Simulator fails to launch: ``` Test target AnalyticsTests encountered an error (Failed to clone device named 'iPhone 16'. (Underlying Error: The operation couldn’t be completed. Device was allocated but was stuck in creation state. Check CoreSimulator.log for more information.)) ``` I tried to run the tests via Fastlane's `scan` and it automatically picked up iPhone 16 Pro and succeeded to run the tests. When I changed the command to use iPhone 16 Pro on my end via vanilla `xcodebuild` like CI does, it worked. --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 4f3637d6..6f683bac 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -25,7 +25,7 @@ steps: - label: "🧪 Tests" key: tests command: | - xcodebuild test -project GravatarApp.xcodeproj -scheme GravatarApp -destination 'platform=iOS Simulator,name=iPhone 16,arch=arm64' + xcodebuild test -project GravatarApp.xcodeproj -scheme GravatarApp -destination 'platform=iOS Simulator,name=iPhone 16 Pro' notify: - github_commit_status: context: "Unit tests" From 9424a446c9a479f3a8b4bd901819c018c96fe994 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 19 Jun 2025 14:53:13 +1000 Subject: [PATCH 2/3] Move command to run tests from Buildkite pipeline to `make test` This way, if a dev wants to run the same command as CI does locally, they can do so. --- .buildkite/pipeline.yml | 2 +- Makefile | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 6f683bac..139499c9 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -25,7 +25,7 @@ steps: - label: "🧪 Tests" key: tests command: | - xcodebuild test -project GravatarApp.xcodeproj -scheme GravatarApp -destination 'platform=iOS Simulator,name=iPhone 16 Pro' + make test notify: - github_commit_status: context: "Unit tests" diff --git a/Makefile b/Makefile index d277699e..d4ed5e6d 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,9 @@ help: # Display this help. dev: # Open the package in xcode xed . +test: # Run the app unit tests + @xcodebuild test -project GravatarApp.xcodeproj -scheme GravatarApp -destination 'platform=iOS Simulator,name=iPhone 16 Pro' + swiftformat: check-docker # Automatically find and fixes lint issues @docker run --rm -v $(shell pwd):$(shell pwd) -w $(shell pwd) ghcr.io/nicklockwood/swiftformat:$(SWIFTFORMAT_VERSION) GravatarApp GravatarAppTests Packages From 30a39c1b609cb5bdf5ab5993a1284ce09992a447 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 19 Jun 2025 14:53:51 +1000 Subject: [PATCH 3/3] Add instruction in CI to fetch Swift packages from cache if available --- .buildkite/pipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 139499c9..c0e7b727 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -24,7 +24,9 @@ steps: - label: "🧪 Tests" key: tests + plugins: [$CI_TOOLKIT] command: | + install_swiftpm_dependencies make test notify: - github_commit_status: