Skip to content

Commit

Permalink
iOS test fixes (#3421)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Jan 25, 2025
1 parent f1927f4 commit 02ad938
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/actions/setup-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ runs:
shell: bash
if: runner.os == 'macOS'

- name: Install xcodesdk dependencies
- name: Install ios dependencies
run: |
# We should consider removing the dependency on ice-xcode-builder
# We should consider removing the dependency on ice-builder-xcode
brew install zeroc-ice/tap/ice-builder-xcode
shell: bash
if: (runner.os == 'macOS') && (matrix.config == 'xcodesdk')
if: (runner.os == 'macOS') && (matrix.config == 'ios')

#
# Linux
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ jobs:
test_flags: "--platform=x64 --config=Debug"
msbuild_project: "msbuild/ice.proj"

# Swift iOS
# iOS
- os: macos-15
config: "swift-ios"
working_directory: "swift"
build_flags: "PLATFORMS='macosx iphonesimulator'"
test_flags: "--platform=iphonesimulator --controller-app --rfilter=Ice/operations" # Remove rfilter once #3286 is fixed
config: "ios"
build_flags: "PLATFORMS='macosx iphonesimulator' CONFIGS='static shared' LANGUAGES='cpp swift'"
# Remove rfilter swift/Ice/operations once #3286 is fixed
# swift/Ice/udp doesn't work on CI
test_flags: "--languages='cpp,swift' --platform=iphonesimulator --controller-app --rfilter=swift/Ice/operations --rfilter=swift/Ice/udp"
build_cpp_and_python: true

# Static builds
Expand Down Expand Up @@ -126,7 +127,7 @@ jobs:

- name: Test ${{ matrix.config }} on ${{ matrix.os }}
uses: ./.github/actions/test
timeout-minutes: 30
timeout-minutes: 45
with:
working_directory: ${{ matrix.working_directory || '.' }}
flags: ${{ matrix.test_flags }}
Expand Down
7 changes: 4 additions & 3 deletions scripts/Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3696,13 +3696,14 @@ def getIOSControllerIdentity(self, current):
return "{0}/com.zeroc.Cpp-Test-Controller".format(category)

def getIOSAppFullPath(self, current):
cmd = "xcodebuild -project 'test/ios/controller/C++ Test Controller.xcodeproj' \
cmd = "xcodebuild -project '{0}/cpp/test/ios/controller/C++ Test Controller.xcodeproj' \
-scheme 'C++ Test Controller' \
-configuration {0} \
-sdk {1} \
-configuration {1} \
-sdk {2} \
-arch arm64 \
-showBuildSettings \
".format(
toplevel,
"Release" if os.environ.get("OPTIMIZE", "yes") != "no" else "Debug",
current.config.buildPlatform,
)
Expand Down
2 changes: 1 addition & 1 deletion swift/test/Ice/udp/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Client: TestHelperI {
}
try await allTests(self)

let num = restArgs.count == 4 ? Int(restArgs[3]) : 1
let num = restArgs.count == 1 ? Int(restArgs[0]) : 1
for i in 0..<(num ?? 1) {
let prx = try communicator.stringToProxy(
"control:\(getTestEndpoint(num: Int32(i), prot: "tcp"))")!
Expand Down
2 changes: 1 addition & 1 deletion swift/test/Ice/udp/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Server: TestHelperI {
defer {
communicator.destroy()
}
let num = restArgs.count == 4 ? Int32(restArgs[3]) : 1
let num = restArgs.count == 1 ? Int32(restArgs[0]) : 0
communicator.getProperties().setProperty(
key: "ControlAdapter.Endpoints",
value: getTestEndpoint(num: num ?? 0, prot: "tcp"))
Expand Down
2 changes: 1 addition & 1 deletion swift/test/TestDriver/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ do {
let testName = "\(testPath).\(exe)"

let testHelper = TestBundle.getTestHelper(name: testName)
try await testHelper.run(args: args)
try await testHelper.run(args: Array(args[3...]))

} catch {
for s in Thread.callStackSymbols {
Expand Down

0 comments on commit 02ad938

Please sign in to comment.