Skip to content

Commit 6fb713f

Browse files
committed
Add 'beta' messaging
1 parent 409c3cc commit 6fb713f

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/commands/appdistribution-distribute.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,26 @@ export const command = new Command("appdistribution:distribute <release-binary-f
5252
)
5353
.option(
5454
"--test-devices <string>",
55-
"semicolon-separated list of devices to run automated tests on, in the format 'model=<model-id>,version=<os-version-id>,locale=<locale>,orientation=<orientation>'. Run 'gcloud firebase test android|ios models list' to see available devices",
55+
"semicolon-separated list of devices to run automated tests on, in the format 'model=<model-id>,version=<os-version-id>,locale=<locale>,orientation=<orientation>'. Run 'gcloud firebase test android|ios models list' to see available devices. Note: This feature is in beta.",
5656
)
5757
.option(
5858
"--test-devices-file <string>",
59-
"path to file containing a list of semicolon- or newline-separated devices to run automated tests on, in the format 'model=<model-id>,version=<os-version-id>,locale=<locale>,orientation=<orientation>'. Run 'gcloud firebase test android|ios models list' to see available devices",
59+
"path to file containing a list of semicolon- or newline-separated devices to run automated tests on, in the format 'model=<model-id>,version=<os-version-id>,locale=<locale>,orientation=<orientation>'. Run 'gcloud firebase test android|ios models list' to see available devices. Note: This feature is in beta.",
6060
)
6161
.option("--test-username <string>", "username for automatic login")
6262
.option("--test-password <string>", "password for automatic login")
6363
.option(
6464
"--test-username-resource <string>",
65-
"resource name of the username field for automatic login",
65+
"resource name for the username field for automatic login",
6666
)
6767
.option(
6868
"--test-password-resource <string>",
69-
"resource name of the password field for automatic login",
69+
"resource name for the password field for automatic login",
70+
)
71+
.option(
72+
"--test-async",
73+
"run tests asynchronously. Visit the Firebase console for the automatic test results.",
7074
)
71-
.option("--test-async", "don't wait for automatic test results")
7275
.before(requireAuth)
7376
.action(async (file: string, options: any) => {
7477
const appName = getAppName(options);
@@ -178,7 +181,7 @@ export const command = new Command("appdistribution:distribute <release-binary-f
178181
{ exit: 1 },
179182
);
180183
}
181-
throw new FirebaseError(`failed to upload release. ${err.message}`, { exit: 1 });
184+
throw new FirebaseError(`Failed to upload release. ${err.message}`, { exit: 1 });
182185
}
183186

184187
// If this is an app bundle and the certificate was originally blank fetch the updated
@@ -204,6 +207,7 @@ export const command = new Command("appdistribution:distribute <release-binary-f
204207

205208
// Run automated tests
206209
if (testDevices) {
210+
utils.logBullet("starting automated tests (note: this feature is in beta)");
207211
const releaseTest = await requests.createReleaseTest(
208212
releaseName,
209213
testDevices,
@@ -220,7 +224,7 @@ async function awaitTestResults(
220224
requests: AppDistributionClient,
221225
): Promise<void> {
222226
for (let i = 0; i < TEST_MAX_POLLING_RETRIES; i++) {
223-
utils.logBullet("waiting for test(s) to complete…");
227+
utils.logBullet("the automated tests results are pending");
224228
await delay(TEST_POLLING_INTERVAL_MILLIS);
225229
const releaseTest = await requests.getReleaseTest(releaseTestName);
226230
if (releaseTest.deviceExecutions.every((e) => e.state === TestState.PASSED)) {
@@ -234,23 +238,25 @@ async function awaitTestResults(
234238
continue;
235239
case TestState.FAILED:
236240
throw new FirebaseError(
237-
`automated test failed for ${deviceToString(execution.device)}: ${execution.failedReason}`,
241+
`Automated test failed for ${deviceToString(execution.device)}: ${execution.failedReason}`,
238242
{ exit: 1 },
239243
);
240244
case TestState.INCONCLUSIVE:
241245
throw new FirebaseError(
242-
`automated test inconclusive for ${deviceToString(execution.device)}: ${execution.inconclusiveReason}`,
246+
`Automated test inconclusive for ${deviceToString(execution.device)}: ${execution.inconclusiveReason}`,
243247
{ exit: 1 },
244248
);
245249
default:
246250
throw new FirebaseError(
247-
`unsupported automated test state for ${deviceToString(execution.device)}: ${execution.state}`,
251+
`Unsupported automated test state for ${deviceToString(execution.device)}: ${execution.state}`,
248252
{ exit: 1 },
249253
);
250254
}
251255
}
252256
}
253-
throw new FirebaseError("tests are running for longer than expected", { exit: 1 });
257+
throw new FirebaseError("It took longer than expected to process your test, please try again.", {
258+
exit: 1,
259+
});
254260
}
255261

256262
function delay(ms: number) {

0 commit comments

Comments
 (0)