Skip to content

Commit 90c44e0

Browse files
committed
Add android-no-snapshot flag for cold boot support
1 parent 9c1a30f commit 90c44e0

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ inputs:
106106
maestro-chrome-onboarding:
107107
description: '[Android only] Force Maestro-based Chrome onboarding - note: this will slow your tests but can fix browser related crashes. See https://docs.devicecloud.dev/reference/chrome-onboarding for more information.'
108108
required: false
109-
109+
android-no-snapshot:
110+
description: '[Android only] Force cold boot instead of using snapshot boot. This is automatically enabled for API 35+ but can be used to force cold boot on older API levels.'
111+
required: false
110112

111113
outputs:
112114
DEVICE_CLOUD_CONSOLE_URL:

dist/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30024,7 +30024,7 @@ const getLatestDcdVersion = (...args_1) => __awaiter(void 0, [...args_1], void 0
3002430024
const run = () => __awaiter(void 0, void 0, void 0, function* () {
3002530025
var _a;
3002630026
try {
30027-
const { additionalAppBinaryIds, additionalAppFiles, androidApiLevel, androidDevice, apiKey, apiUrl, appBinaryId, appFilePath, async, config, deviceLocale, downloadArtifacts, env, excludeFlows, excludeTags, googlePlay, ignoreShaCheck, includeTags, iOSVersion, iosDevice, jsonFile, maestroVersion, name, orientation, report, retry, workspaceFolder, runnerType, debug, moropoV1ApiKey, useBeta, maestroChromeOnboarding, } = yield (0, params_1.getParameters)();
30027+
const { additionalAppBinaryIds, additionalAppFiles, androidApiLevel, androidDevice, apiKey, apiUrl, appBinaryId, appFilePath, async, config, deviceLocale, downloadArtifacts, env, excludeFlows, excludeTags, googlePlay, ignoreShaCheck, includeTags, iOSVersion, iosDevice, jsonFile, maestroVersion, name, orientation, report, retry, workspaceFolder, runnerType, debug, moropoV1ApiKey, useBeta, maestroChromeOnboarding, androidNoSnapshot, } = yield (0, params_1.getParameters)();
3002830028
const dcdVersionString = yield getLatestDcdVersion(useBeta);
3002930029
const params = {
3003030030
'additional-app-binary-ids': additionalAppBinaryIds,
@@ -30057,6 +30057,7 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
3005730057
debug,
3005830058
'moropo-v1-api-key': moropoV1ApiKey,
3005930059
'maestro-chrome-onboarding': maestroChromeOnboarding,
30060+
'android-no-snapshot': androidNoSnapshot,
3006030061
};
3006130062
let paramsString = Object.keys(params).reduce((acc, key) => {
3006230063
if (!params[key])
@@ -30292,6 +30293,7 @@ function getParameters() {
3029230293
});
3029330294
const useBeta = core.getInput('use-beta', { required: false }) === 'true';
3029430295
const maestroChromeOnboarding = core.getInput('maestro-chrome-onboarding', { required: false }) === 'true';
30296+
const androidNoSnapshot = core.getInput('android-no-snapshot', { required: false }) === 'true';
3029530297
if (!(appFilePath !== '') !== (appBinaryId !== '')) {
3029630298
throw new Error('Either app-file or app-binary-id must be used');
3029730299
}
@@ -30332,6 +30334,7 @@ function getParameters() {
3033230334
moropoV1ApiKey,
3033330335
useBeta,
3033430336
maestroChromeOnboarding,
30337+
androidNoSnapshot,
3033530338
};
3033630339
});
3033730340
}

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ const run = async (): Promise<void> => {
155155
moropoV1ApiKey,
156156
useBeta,
157157
maestroChromeOnboarding,
158+
androidNoSnapshot,
158159
} = await getParameters();
159160

160161
const dcdVersionString = await getLatestDcdVersion(useBeta);
@@ -190,6 +191,7 @@ const run = async (): Promise<void> => {
190191
debug,
191192
'moropo-v1-api-key': moropoV1ApiKey,
192193
'maestro-chrome-onboarding': maestroChromeOnboarding,
194+
'android-no-snapshot': androidNoSnapshot,
193195
};
194196

195197
let paramsString = Object.keys(params).reduce((acc, key) => {

src/methods/params.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type Params = {
3434
moropoV1ApiKey?: string;
3535
useBeta?: boolean;
3636
maestroChromeOnboarding?: boolean;
37+
androidNoSnapshot?: boolean;
3738
};
3839

3940
function getAndroidApiLevel(apiLevel?: string): number | undefined {
@@ -186,6 +187,7 @@ export async function getParameters(): Promise<Params> {
186187
const useBeta = core.getInput('use-beta', { required: false }) === 'true';
187188

188189
const maestroChromeOnboarding = core.getInput('maestro-chrome-onboarding', { required: false }) === 'true';
190+
const androidNoSnapshot = core.getInput('android-no-snapshot', { required: false }) === 'true';
189191

190192
if (!(appFilePath !== '') !== (appBinaryId !== '')) {
191193
throw new Error('Either app-file or app-binary-id must be used');
@@ -232,5 +234,6 @@ export async function getParameters(): Promise<Params> {
232234
moropoV1ApiKey,
233235
useBeta,
234236
maestroChromeOnboarding,
237+
androidNoSnapshot,
235238
};
236239
}

0 commit comments

Comments
 (0)