Skip to content

Commit 5098cf9

Browse files
handle armRequired capability for espresso tests (#1084)
* handle armRequired capability for espresso tests
1 parent 144b578 commit 5098cf9

5 files changed

Lines changed: 29 additions & 0 deletions

File tree

api/saucectl.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,10 @@
10081008
"description": "The set of one or more versions of the device platform on which to run the test suite.",
10091009
"type": "array",
10101010
"minItems": 1
1011+
},
1012+
"armRequired": {
1013+
"description": "If set to true, the simulator will run on an ARM-based architecture. If set to false, the emulator will run on an Intel-based architecture.",
1014+
"type": "boolean"
10111015
}
10121016
},
10131017
"required": [

api/v1alpha/framework/espresso.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@
202202
"description": "The set of one or more versions of the device platform on which to run the test suite.",
203203
"type": "array",
204204
"minItems": 1
205+
},
206+
"armRequired": {
207+
"description": "If set to true, the simulator will run on an ARM-based architecture. If set to false, the emulator will run on an Intel-based architecture.",
208+
"type": "boolean"
205209
}
206210
},
207211
"required": [

internal/espresso/config_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ suites:
189189
- name: "Google Pixel C GoogleAPI Emulator"
190190
platformVersions:
191191
- "8.1"
192+
- name: "Google Pixel 9 GoogleAPI Emulator"
193+
platformVersions:
194+
- "8.2"
195+
armRequired: true
192196
`, fs.WithMode(0655)))
193197
defer dir.Remove()
194198

@@ -233,6 +237,14 @@ suites:
233237
PlatformVersions: []string{
234238
"8.1",
235239
},
240+
ARMRequired: false,
241+
},
242+
{
243+
Name: "Google Pixel 9 GoogleAPI Emulator",
244+
PlatformVersions: []string{
245+
"8.2",
246+
},
247+
ARMRequired: true,
236248
},
237249
}},
238250
},

internal/flags/emulator.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/csv"
55
"errors"
66
"fmt"
7+
"strconv"
78
"strings"
89

910
"github.com/saucelabs/saucectl/internal/config"
@@ -54,6 +55,11 @@ func (e *Emulator) Set(s string) error {
5455
e.Orientation = val
5556
case "platformVersion":
5657
e.PlatformVersions = []string{val}
58+
case "armRequired":
59+
e.ARMRequired, err = strconv.ParseBool(val)
60+
if err != nil {
61+
return fmt.Errorf("invalid value for armRequired: %w", err)
62+
}
5763
}
5864
}
5965

internal/saucecloud/espresso.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ func (r *EspressoRunner) newStartOptions(
255255
DeviceType: d.deviceType,
256256
DevicePrivateOnly: d.privateOnly,
257257

258+
// VMD specific settings
259+
ARMRequired: d.armRequired,
260+
258261
// Configure device settings
259262
RealDeviceKind: strings.ToLower(espresso.Android),
260263
AppSettings: job.AppSettings{

0 commit comments

Comments
 (0)