Skip to content

Worker Capabilities

Vladislav Alekseev edited this page Dec 26, 2021 · 5 revisions

Worker Capabilities allows you constraint job execution onto specific subset of workers.

E.g. if some of your workers have only Xcode version A, others have only Xcode version B, and others have installed both Xcode A and B, you can schedule tests to be executed on workers that have Xcode B installed.

Capabilities have names (string) and values (string as well). But in your capabilities constraints, you can compare numeric values in values even though they are represented as strings: Emcee will attempt to interpret strings as numbers.

Xcode Version Capability

Emcee worker exposes installed Xcode versions via capabilities named emcee.dt.xcode.<Xcode_version>, e.g. emcee.dt.xcode.11_5.

As of version 15, Emcee searches for installed Xcodes inside /Applications folder. At Avito, we organize Xcodes as follows:

/Applications
            /Xcode_12_5.app
            /Xcode_13_0_b5.app

You can specify worker capability constraints in test arg file for each entry. For example, the specification below enforces availability of Xcode 11.5:

{
    "workerCapabilityRequirements": [{
        "name": "emcee.dt.xcode.11_5",
        "constraint": {
            "type": "not", "value": {"type": "absent"}
        }
    }]
}

Another example - execute tests only on workers without Xcode 11.4 installed:

{
    "workerCapabilityRequirements": [{
        "name": "emcee.dt.xcode.11_4",
        "constraint": {
            "type": "absent"
        }
    }]
}

OS version capability

These capabilities are available at Emcee version 15 and above.

Emcee worker exposes OS version via capabilities named emcee.os.version.<major|minor|patch>. For example, for macOS 12.1 the following capabilities will be exposed by worker:

  • emcee.os.version.major with value "12"
  • emcee.os.version.minor with value "1"
  • emcee.os.version.patch with value "0"

SimRuntime availability capabilities

These capabilities are available at Emcee version 15 and above.

Emcee scans the contents of /Library/Developer/CoreSimulator/Profiles/Runtimes/ for available .simruntime bundles. It exposes their bundle ids as capabilities. For example, if you have installed iOS 15 and tvOS 10.2 simulator runtimes, Emcee will expose the following capabilities:

  • com.apple.CoreSimulator.SimRuntime.tvOS-10-2 with value "tvOS 10.2"

  • com.apple.CoreSimulator.SimRuntime.iOS-15-0 with value "iOS 15.0"

You can use these capabilities to limit job execution to workers with required simruntimes installed.

More

Additional worker capabilities may be exposed later. If you need any specific capability to be exposes, let us know!

Clone this wiki locally