Skip to content

Enumeration

TestKind

Runs unit and UI tests.

enum TestKind

Overview

  • iOS: Uses xcodebuild test. Supports running against one or more destinations in a single invocation, aggregating pass/fail/skip counts.

  • Android: Uses ./gradlew test (JVM unit tests) or connectedAndroidTest (instrumented on-device tests).

When multiple destinations are provided (iOS), ShipIt runs a separate xcodebuild test pass for each destination, aggregating pass/fail/skip counts across all runs.

If destinations is empty or nil and no destination fallback is provided (iOS), the action throws ShipItError.invalidConfiguration rather than inventing a simulator name that may not exist on the current machine. Use DestinationDiscovery to enumerate valid destinations before configuring this action.

Usage

// iOS
let result = try await TestAction().run(
    with: .init(
        scheme: "MyApp",
        destinations: ["platform=iOS Simulator,name=iPhone 16 Pro,OS=18.2"],
        enableCodeCoverage: true
    ),
    context: context
)
print("Passed: \(result.passCount), Failed: \(result.failCount), Skipped: \(result.skipCount)")

// Android
let result = try await TestAction().run(
    with: .init(kind: .unit, scope: .module, module: "app"),
    context: androidContext
)
print("Passed: \(result.passCount), Failed: \(result.failCount)")

What category of test is being run.

This drives whether ShipIt needs to orchestrate devices before executing.

  • unit: JVM/host tests — no device needed.

  • instrumented: Tests requiring the Android framework (emulator or physical device).

  • e2e: Full user-journey tests via an external tool (Maestro, Detox, etc.) — reserved for future use.

Topics

Relationships

Conforms To

  • Swift.CaseIterable
  • Swift.Decodable
  • Swift.Encodable
  • Swift.Equatable
  • Swift.Hashable
  • Swift.RawRepresentable
  • Swift.Sendable
  • Swift.SendableMetatype