@datadog/datadog-ci 2.34.0 → 2.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -9
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/dsyms/utils.js +4 -11
- package/dist/commands/dsyms/utils.js.map +1 -1
- package/dist/commands/elf-symbols/cli.d.ts +1 -0
- package/dist/commands/elf-symbols/cli.js +5 -0
- package/dist/commands/elf-symbols/cli.js.map +1 -0
- package/dist/commands/elf-symbols/elf-constants.d.ts +256 -0
- package/dist/commands/elf-symbols/elf-constants.js +462 -0
- package/dist/commands/elf-symbols/elf-constants.js.map +1 -0
- package/dist/commands/elf-symbols/elf.d.ts +103 -0
- package/dist/commands/elf-symbols/elf.js +428 -0
- package/dist/commands/elf-symbols/elf.js.map +1 -0
- package/dist/commands/elf-symbols/helpers.d.ts +4 -0
- package/dist/commands/elf-symbols/helpers.js +29 -0
- package/dist/commands/elf-symbols/helpers.js.map +1 -0
- package/dist/commands/elf-symbols/interfaces.d.ts +14 -0
- package/dist/commands/elf-symbols/interfaces.js +7 -0
- package/dist/commands/elf-symbols/interfaces.js.map +1 -0
- package/dist/commands/elf-symbols/renderer.d.ts +18 -0
- package/dist/commands/elf-symbols/renderer.js +84 -0
- package/dist/commands/elf-symbols/renderer.js.map +1 -0
- package/dist/commands/elf-symbols/upload.d.ts +25 -0
- package/dist/commands/elf-symbols/upload.js +363 -0
- package/dist/commands/elf-symbols/upload.js.map +1 -0
- package/dist/commands/git-metadata/upload.d.ts +0 -1
- package/dist/commands/git-metadata/upload.js +1 -11
- package/dist/commands/git-metadata/upload.js.map +1 -1
- package/dist/commands/synthetics/api.d.ts +7 -4
- package/dist/commands/synthetics/api.js +20 -12
- package/dist/commands/synthetics/api.js.map +1 -1
- package/dist/commands/synthetics/compatibility.d.ts +2 -0
- package/dist/commands/synthetics/compatibility.js +19 -0
- package/dist/commands/synthetics/compatibility.js.map +1 -0
- package/dist/commands/synthetics/errors.d.ts +1 -1
- package/dist/commands/synthetics/errors.js +4 -0
- package/dist/commands/synthetics/errors.js.map +1 -1
- package/dist/commands/synthetics/interfaces.d.ts +52 -2
- package/dist/commands/synthetics/interfaces.js.map +1 -1
- package/dist/commands/synthetics/mobile.d.ts +17 -25
- package/dist/commands/synthetics/mobile.js +139 -64
- package/dist/commands/synthetics/mobile.js.map +1 -1
- package/dist/commands/synthetics/reporters/constants.d.ts +6 -0
- package/dist/commands/synthetics/reporters/constants.js +14 -0
- package/dist/commands/synthetics/reporters/constants.js.map +1 -0
- package/dist/commands/synthetics/reporters/default.js +11 -15
- package/dist/commands/synthetics/reporters/default.js.map +1 -1
- package/dist/commands/synthetics/reporters/mobile/app-upload.d.ts +15 -0
- package/dist/commands/synthetics/reporters/mobile/app-upload.js +54 -0
- package/dist/commands/synthetics/reporters/mobile/app-upload.js.map +1 -0
- package/dist/commands/synthetics/run-tests-command.d.ts +1 -1
- package/dist/commands/synthetics/run-tests-command.js +8 -10
- package/dist/commands/synthetics/run-tests-command.js.map +1 -1
- package/dist/commands/synthetics/run-tests-lib.js +4 -10
- package/dist/commands/synthetics/run-tests-lib.js.map +1 -1
- package/dist/commands/synthetics/test.js +1 -1
- package/dist/commands/synthetics/test.js.map +1 -1
- package/dist/commands/synthetics/upload-application-command.js +4 -3
- package/dist/commands/synthetics/upload-application-command.js.map +1 -1
- package/dist/commands/synthetics/utils/internal.d.ts +2 -1
- package/dist/commands/synthetics/utils/internal.js +3 -1
- package/dist/commands/synthetics/utils/internal.js.map +1 -1
- package/dist/commands/synthetics/utils/public.d.ts +3 -13
- package/dist/commands/synthetics/utils/public.js +13 -19
- package/dist/commands/synthetics/utils/public.js.map +1 -1
- package/dist/commands/trace/interfaces.d.ts +1 -0
- package/dist/commands/trace/trace.d.ts +1 -0
- package/dist/commands/trace/trace.js +12 -2
- package/dist/commands/trace/trace.js.map +1 -1
- package/dist/helpers/tags.d.ts +1 -1
- package/dist/helpers/tags.js.map +1 -1
- package/dist/helpers/utils.d.ts +4 -0
- package/dist/helpers/utils.js +8 -1
- package/dist/helpers/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replaceGlobalWithDefaultTestOverrides = void 0;
|
|
4
|
+
const replaceGlobalWithDefaultTestOverrides = (config, reporter, warnDeprecatedGlobal = false) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
// The user is able to put both if they don't use the library in TS or use configuration files.
|
|
7
|
+
const isGlobalUsed = Object.keys((_a = config.global) !== null && _a !== void 0 ? _a : {}).length !== 0;
|
|
8
|
+
const isDefaultTestOverridesUsed = Object.keys((_b = config.defaultTestOverrides) !== null && _b !== void 0 ? _b : {}).length !== 0;
|
|
9
|
+
if (isGlobalUsed && warnDeprecatedGlobal) {
|
|
10
|
+
reporter === null || reporter === void 0 ? void 0 : reporter.error("The 'global' property is deprecated. Please use 'defaultTestOverrides' instead.\nIf both 'global' and 'defaultTestOverrides' properties exist, 'defaultTestOverrides' is used!\n");
|
|
11
|
+
}
|
|
12
|
+
// If both global and defaultTestOverrides exist use defaultTestOverrides
|
|
13
|
+
if (isGlobalUsed && !isDefaultTestOverridesUsed) {
|
|
14
|
+
return Object.assign(Object.assign({}, config), { defaultTestOverrides: Object.assign({}, config.global) });
|
|
15
|
+
}
|
|
16
|
+
return config;
|
|
17
|
+
};
|
|
18
|
+
exports.replaceGlobalWithDefaultTestOverrides = replaceGlobalWithDefaultTestOverrides;
|
|
19
|
+
//# sourceMappingURL=compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../../../src/commands/synthetics/compatibility.ts"],"names":[],"mappings":";;;AAEO,MAAM,qCAAqC,GAAG,CACnD,MAA6B,EAC7B,QAAuB,EACvB,oBAAoB,GAAG,KAAK,EACL,EAAE;;IACzB,+FAA+F;IAC/F,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,MAAA,MAAM,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAA;IAClE,MAAM,0BAA0B,GAAG,MAAM,CAAC,IAAI,CAAC,MAAA,MAAM,CAAC,oBAAoB,mCAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAA;IAC9F,IAAI,YAAY,IAAI,oBAAoB,EAAE;QACxC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CACb,kLAAkL,CACnL,CAAA;KACF;IAED,yEAAyE;IACzE,IAAI,YAAY,IAAI,CAAC,0BAA0B,EAAE;QAC/C,uCACK,MAAM,KACT,oBAAoB,oBAAM,MAAM,CAAC,MAAM,KACxC;KACF;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAvBY,QAAA,qCAAqC,yCAuBjD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const nonCriticalErrorCodes: readonly ["NO_TESTS_TO_RUN", "MISSING_TESTS"];
|
|
2
2
|
export type NonCriticalCiErrorCode = typeof nonCriticalErrorCodes[number];
|
|
3
|
-
declare const criticalErrorCodes: readonly ["AUTHORIZATION_ERROR", "INVALID_CONFIG", "MISSING_API_KEY", "MISSING_APP_KEY", "POLL_RESULTS_FAILED", "BATCH_TIMEOUT_RUNAWAY", "TOO_MANY_TESTS_TO_TRIGGER", "TRIGGER_TESTS_FAILED", "TUNNEL_START_FAILED", "TUNNEL_NOT_SUPPORTED", "UNAVAILABLE_TEST_CONFIG", "UNAVAILABLE_TUNNEL_CONFIG", "UPLOAD_MOBILE_APPLICATION_TESTS_FAILED", "MISSING_MOBILE_APPLICATION_PATH", "MISSING_MOBILE_APPLICATION_ID", "MISSING_MOBILE_VERSION_NAME"];
|
|
3
|
+
declare const criticalErrorCodes: readonly ["AUTHORIZATION_ERROR", "INVALID_CONFIG", "MISSING_API_KEY", "MISSING_APP_KEY", "POLL_RESULTS_FAILED", "BATCH_TIMEOUT_RUNAWAY", "TOO_MANY_TESTS_TO_TRIGGER", "TRIGGER_TESTS_FAILED", "TUNNEL_START_FAILED", "TUNNEL_NOT_SUPPORTED", "UNAVAILABLE_TEST_CONFIG", "UNAVAILABLE_TUNNEL_CONFIG", "UPLOAD_MOBILE_APPLICATION_TESTS_FAILED", "MISSING_MOBILE_APPLICATION_PATH", "MISSING_MOBILE_APPLICATION_ID", "MISSING_MOBILE_VERSION_NAME", "INVALID_MOBILE_APP", "INVALID_MOBILE_APP_UPLOAD_PARAMETERS", "MOBILE_APP_UPLOAD_TIMEOUT", "UNKNOWN_MOBILE_APP_UPLOAD_FAILURE"];
|
|
4
4
|
export type CriticalCiErrorCode = typeof criticalErrorCodes[number];
|
|
5
5
|
export type CiErrorCode = NonCriticalCiErrorCode | CriticalCiErrorCode;
|
|
6
6
|
export declare class CiError extends Error {
|
|
@@ -19,6 +19,10 @@ const criticalErrorCodes = [
|
|
|
19
19
|
'MISSING_MOBILE_APPLICATION_PATH',
|
|
20
20
|
'MISSING_MOBILE_APPLICATION_ID',
|
|
21
21
|
'MISSING_MOBILE_VERSION_NAME',
|
|
22
|
+
'INVALID_MOBILE_APP',
|
|
23
|
+
'INVALID_MOBILE_APP_UPLOAD_PARAMETERS',
|
|
24
|
+
'MOBILE_APP_UPLOAD_TIMEOUT',
|
|
25
|
+
'UNKNOWN_MOBILE_APP_UPLOAD_FAILURE',
|
|
22
26
|
];
|
|
23
27
|
class CiError extends Error {
|
|
24
28
|
constructor(code, message) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/commands/synthetics/errors.ts"],"names":[],"mappings":";;;AAAA,MAAM,qBAAqB,GAAG,CAAC,iBAAiB,EAAE,eAAe,CAAU,CAAA;AAG3E,MAAM,kBAAkB,GAAG;IACzB,qBAAqB;IACrB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,qBAAqB;IACrB,uBAAuB;IACvB,2BAA2B;IAC3B,sBAAsB;IACtB,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;IACzB,2BAA2B;IAC3B,wCAAwC;IACxC,iCAAiC;IACjC,+BAA+B;IAC/B,6BAA6B;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/commands/synthetics/errors.ts"],"names":[],"mappings":";;;AAAA,MAAM,qBAAqB,GAAG,CAAC,iBAAiB,EAAE,eAAe,CAAU,CAAA;AAG3E,MAAM,kBAAkB,GAAG;IACzB,qBAAqB;IACrB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,qBAAqB;IACrB,uBAAuB;IACvB,2BAA2B;IAC3B,sBAAsB;IACtB,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;IACzB,2BAA2B;IAC3B,wCAAwC;IACxC,iCAAiC;IACjC,+BAA+B;IAC/B,6BAA6B;IAC7B,oBAAoB;IACpB,sCAAsC;IACtC,2BAA2B;IAC3B,mCAAmC;CAC3B,CAAA;AAKV,MAAa,OAAQ,SAAQ,KAAK;IAChC,YAAmB,IAAiB,EAAE,OAAgB;QACpD,KAAK,CAAC,OAAO,CAAC,CAAA;QADG,SAAI,GAAJ,IAAI,CAAa;IAEpC,CAAC;IAEM,MAAM;QACX,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAA;IACH,CAAC;CACF;AAXD,0BAWC;AAED,MAAa,aAAc,SAAQ,OAAO;IACxC,YAAmB,IAAyB,EAAE,OAAgB;QAC5D,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QADH,SAAI,GAAJ,IAAI,CAAqB;IAE5C,CAAC;CACF;AAJD,sCAIC;AAED,MAAa,wBAAyB,SAAQ,aAAa;IACzD;QACE,KAAK,CAAC,uBAAuB,EAAE,6DAA6D,CAAC,CAAA;IAC/F,CAAC;CACF;AAJD,4DAIC"}
|
|
@@ -340,6 +340,24 @@ export interface TestPayload extends ServerConfigOverride {
|
|
|
340
340
|
executionRule?: ExecutionRule;
|
|
341
341
|
public_id: string;
|
|
342
342
|
}
|
|
343
|
+
export interface TestNotFound {
|
|
344
|
+
errorMessage: string;
|
|
345
|
+
}
|
|
346
|
+
export interface TestSkipped {
|
|
347
|
+
overriddenConfig: TestPayload;
|
|
348
|
+
}
|
|
349
|
+
export interface TestWithOverride {
|
|
350
|
+
test: Test;
|
|
351
|
+
overriddenConfig: TestPayload;
|
|
352
|
+
}
|
|
353
|
+
export interface MobileTestWithOverride extends TestWithOverride {
|
|
354
|
+
test: Test & {
|
|
355
|
+
type: 'mobile';
|
|
356
|
+
options: {
|
|
357
|
+
mobileApplication: MobileApplication;
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
}
|
|
343
361
|
export interface BasicAuthCredentials {
|
|
344
362
|
password: string;
|
|
345
363
|
username: string;
|
|
@@ -399,8 +417,9 @@ export interface RunTestsCommandConfig extends SyntheticsCIConfig {
|
|
|
399
417
|
failOnMissingTests: boolean;
|
|
400
418
|
failOnTimeout: boolean;
|
|
401
419
|
files: string[];
|
|
402
|
-
|
|
403
|
-
|
|
420
|
+
/** @deprecated This property is deprecated, please use `defaultTestOverrides` instead. */
|
|
421
|
+
global?: UserConfigOverride;
|
|
422
|
+
defaultTestOverrides?: UserConfigOverride;
|
|
404
423
|
locations: string[];
|
|
405
424
|
mobileApplicationVersionFilePath?: string;
|
|
406
425
|
pollingTimeout: number;
|
|
@@ -438,6 +457,37 @@ export interface MultipartPresignedUrlsResponse {
|
|
|
438
457
|
};
|
|
439
458
|
};
|
|
440
459
|
}
|
|
460
|
+
export type MobileApplicationNewVersionParams = {
|
|
461
|
+
originalFileName: string;
|
|
462
|
+
versionName: string;
|
|
463
|
+
isLatest: boolean;
|
|
464
|
+
};
|
|
465
|
+
export type AppUploadDetails = {
|
|
466
|
+
appId: string;
|
|
467
|
+
appPath: string;
|
|
468
|
+
versionName?: string;
|
|
469
|
+
};
|
|
470
|
+
type MobileAppValidationStatus = 'pending' | 'complete' | 'error' | 'user_error';
|
|
471
|
+
type MobileInvalidAppResult = {
|
|
472
|
+
invalid_reason: string;
|
|
473
|
+
invalid_message: string;
|
|
474
|
+
};
|
|
475
|
+
type MobileValidAppResult = {
|
|
476
|
+
extracted_metadata: Record<string, unknown>;
|
|
477
|
+
app_version_uuid: string;
|
|
478
|
+
};
|
|
479
|
+
type MobileUserErrorResult = {
|
|
480
|
+
user_error_reason: string;
|
|
481
|
+
user_error_message: string;
|
|
482
|
+
};
|
|
483
|
+
export type MobileAppUploadResult = {
|
|
484
|
+
status: MobileAppValidationStatus;
|
|
485
|
+
is_valid?: boolean;
|
|
486
|
+
org_uuid?: string;
|
|
487
|
+
invalid_app_result?: MobileInvalidAppResult;
|
|
488
|
+
valid_app_result?: MobileValidAppResult;
|
|
489
|
+
user_error_result?: MobileUserErrorResult;
|
|
490
|
+
};
|
|
441
491
|
export interface SyntheticsOrgSettings {
|
|
442
492
|
onDemandConcurrencyCap: number;
|
|
443
493
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/commands/synthetics/interfaces.ts"],"names":[],"mappings":";;;AAqRA,IAAY,QAeX;AAfD,WAAY,QAAQ;IAClB,iCAAqB,CAAA;IACrB,6CAAiC,CAAA;IACjC,qBAAS,CAAA;IACT,2BAAe,CAAA;IACf,yCAA6B,CAAA;IAC7B,yCAA6B,CAAA;IAC7B,iCAAqB,CAAA;IACrB,+CAAmC,CAAA;IACnC,iCAAqB,CAAA;IACrB,+CAAmC,CAAA;IACnC,+BAAmB,CAAA;IACnB,yCAA6B,CAAA;IAC7B,mDAAuC,CAAA;IACvC,6CAAiC,CAAA;AACnC,CAAC,EAfW,QAAQ,wBAAR,QAAQ,QAenB;
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/commands/synthetics/interfaces.ts"],"names":[],"mappings":";;;AAqRA,IAAY,QAeX;AAfD,WAAY,QAAQ;IAClB,iCAAqB,CAAA;IACrB,6CAAiC,CAAA;IACjC,qBAAS,CAAA;IACT,2BAAe,CAAA;IACf,yCAA6B,CAAA;IAC7B,yCAA6B,CAAA;IAC7B,iCAAqB,CAAA;IACrB,+CAAmC,CAAA;IACnC,iCAAqB,CAAA;IACrB,+CAAmC,CAAA;IACnC,+BAAmB,CAAA;IACnB,yCAA6B,CAAA;IAC7B,mDAAuC,CAAA;IACvC,6CAAiC,CAAA;AACnC,CAAC,EAfW,QAAQ,wBAAR,QAAQ,QAenB;AAmHD,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,8CAA6B,CAAA;IAC7B,oCAAmB,CAAA;AACrB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB"}
|
|
@@ -1,31 +1,23 @@
|
|
|
1
1
|
import { APIHelper } from './api';
|
|
2
|
-
import { MobileApplicationUploadPart,
|
|
2
|
+
import { MobileAppUploadResult, MobileApplicationUploadPart, TestPayload, UploadApplicationCommandConfig, MobileApplicationNewVersionParams, TriggerConfig, AppUploadDetails, MobileTestWithOverride } from './interfaces';
|
|
3
|
+
import { AppUploadReporter } from './reporters/mobile/app-upload';
|
|
4
|
+
export declare const APP_UPLOAD_POLLING_INTERVAL = 1000;
|
|
5
|
+
export declare const MAX_APP_UPLOAD_POLLING_TIMEOUT: number;
|
|
3
6
|
export declare const getSizeAndPartsFromFile: (filePath: string) => Promise<{
|
|
4
7
|
appSize: number;
|
|
5
8
|
parts: MobileApplicationUploadPart[];
|
|
6
9
|
}>;
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
[applicationFilePath: string]: {
|
|
10
|
-
applicationId: string;
|
|
11
|
-
fileName: string;
|
|
12
|
-
}[];
|
|
13
|
-
}) => Promise<void>;
|
|
14
|
-
export declare const overrideMobileConfig: (userConfigOverride: UserConfigOverride, overriddenTest: TestPayload, test: Test, localApplicationOverride?: {
|
|
15
|
-
applicationId: string;
|
|
10
|
+
export declare const uploadMobileApplication: (api: APIHelper, applicationPathToUpload: string, applicationId: string, newVersionParams?: MobileApplicationNewVersionParams) => Promise<{
|
|
11
|
+
appUploadResponse: MobileAppUploadResult;
|
|
16
12
|
fileName: string;
|
|
17
|
-
}
|
|
18
|
-
export declare
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}[];
|
|
29
|
-
}) => Promise<void>;
|
|
30
|
-
export declare const createNewMobileVersion: (api: APIHelper, version: MobileApplicationVersion) => Promise<MobileApplicationVersion>;
|
|
31
|
-
export declare const uploadMobileApplicationVersion: (config: UploadApplicationCommandConfig) => Promise<MobileApplicationVersion>;
|
|
13
|
+
}>;
|
|
14
|
+
export declare class AppUploadCache {
|
|
15
|
+
private cache;
|
|
16
|
+
setAppCacheKeys(triggerConfigs: TriggerConfig[], testsAndConfigsOverride: MobileTestWithOverride[]): void;
|
|
17
|
+
getAppsToUpload(): AppUploadDetails[];
|
|
18
|
+
getUploadedAppFileName(appPath: string, appId: string): string | undefined;
|
|
19
|
+
setUploadedAppFileName(appPath: string, appId: string, fileName: string): void;
|
|
20
|
+
}
|
|
21
|
+
export declare const overrideMobileConfig: (overriddenTest: TestPayload, appId: string, tempFileName?: string, mobileApplicationVersion?: string) => void;
|
|
22
|
+
export declare const uploadMobileApplicationVersion: (config: UploadApplicationCommandConfig, appUploadReporter: AppUploadReporter) => Promise<MobileAppUploadResult>;
|
|
23
|
+
export declare const uploadMobileApplicationsAndUpdateOverrideConfigs: (api: APIHelper, triggerConfigs: TriggerConfig[], testsAndConfigsOverride: MobileTestWithOverride[]) => Promise<void>;
|
|
@@ -42,12 +42,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
42
42
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.
|
|
45
|
+
exports.uploadMobileApplicationsAndUpdateOverrideConfigs = exports.uploadMobileApplicationVersion = exports.overrideMobileConfig = exports.AppUploadCache = exports.uploadMobileApplication = exports.getSizeAndPartsFromFile = exports.MAX_APP_UPLOAD_POLLING_TIMEOUT = exports.APP_UPLOAD_POLLING_INTERVAL = void 0;
|
|
46
46
|
const crypto = __importStar(require("crypto"));
|
|
47
47
|
const fs_1 = __importDefault(require("fs"));
|
|
48
48
|
const api_1 = require("./api");
|
|
49
49
|
const errors_1 = require("./errors");
|
|
50
|
+
const app_upload_1 = require("./reporters/mobile/app-upload");
|
|
51
|
+
const public_1 = require("./utils/public");
|
|
50
52
|
const UPLOAD_FILE_MAX_PART_SIZE = 10 * 1024 * 1024; // MiB
|
|
53
|
+
exports.APP_UPLOAD_POLLING_INTERVAL = 1000; // 1 second
|
|
54
|
+
exports.MAX_APP_UPLOAD_POLLING_TIMEOUT = 5 * 60 * 1000; // 5 minutes
|
|
51
55
|
const getSizeAndPartsFromFile = (filePath) => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
56
|
var _a, e_1, _b, _c;
|
|
53
57
|
const readStreamOptions = {
|
|
@@ -86,12 +90,12 @@ const getSizeAndPartsFromFile = (filePath) => __awaiter(void 0, void 0, void 0,
|
|
|
86
90
|
};
|
|
87
91
|
});
|
|
88
92
|
exports.getSizeAndPartsFromFile = getSizeAndPartsFromFile;
|
|
89
|
-
const
|
|
90
|
-
var _e, _f, _g;
|
|
93
|
+
const uploadMobileApplication = (api, applicationPathToUpload, applicationId, newVersionParams) => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
+
var _e, _f, _g, _h, _j, _k;
|
|
91
95
|
const { appSize, parts } = yield (0, exports.getSizeAndPartsFromFile)(applicationPathToUpload);
|
|
92
96
|
let multipartPresignedUrlsResponse;
|
|
93
97
|
try {
|
|
94
|
-
multipartPresignedUrlsResponse = yield api.getMobileApplicationPresignedURLs(
|
|
98
|
+
multipartPresignedUrlsResponse = yield api.getMobileApplicationPresignedURLs(applicationId, appSize, parts);
|
|
95
99
|
}
|
|
96
100
|
catch (e) {
|
|
97
101
|
throw new api_1.EndpointError(`Failed to get presigned URL: ${(0, api_1.formatBackendErrors)(e)}\n`, (_e = e.response) === null || _e === void 0 ? void 0 : _e.status);
|
|
@@ -104,72 +108,94 @@ const uploadMobileApplications = (api, applicationPathToUpload, mobileApplicatio
|
|
|
104
108
|
throw new api_1.EndpointError(`Failed to upload mobile application: ${(0, api_1.formatBackendErrors)(e)}\n`, (_f = e.response) === null || _f === void 0 ? void 0 : _f.status);
|
|
105
109
|
}
|
|
106
110
|
const { upload_id: uploadId, key } = multipartPresignedUrlsResponse.multipart_presigned_urls_params;
|
|
111
|
+
let jobId;
|
|
107
112
|
try {
|
|
108
|
-
yield api.completeMultipartMobileApplicationUpload(
|
|
113
|
+
jobId = yield api.completeMultipartMobileApplicationUpload(applicationId, uploadId, key, uploadPartResponses, newVersionParams);
|
|
109
114
|
}
|
|
110
115
|
catch (e) {
|
|
111
116
|
throw new api_1.EndpointError(`Failed to complete upload mobile application: ${(0, api_1.formatBackendErrors)(e)}\n`, (_g = e.response) === null || _g === void 0 ? void 0 : _g.status);
|
|
112
117
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
let appUploadResponse;
|
|
119
|
+
const maxPollingDate = Date.now() + exports.MAX_APP_UPLOAD_POLLING_TIMEOUT;
|
|
120
|
+
while (true) {
|
|
121
|
+
if (Date.now() >= maxPollingDate) {
|
|
122
|
+
throw new errors_1.CriticalError('MOBILE_APP_UPLOAD_TIMEOUT', 'Timeout while polling for mobile application upload');
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
appUploadResponse = yield api.pollMobileApplicationUploadResponse(jobId);
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
throw new api_1.EndpointError(`Failed to validate mobile application: ${(0, api_1.formatBackendErrors)(e)}\n`, (_h = e.response) === null || _h === void 0 ? void 0 : _h.status);
|
|
129
|
+
}
|
|
130
|
+
if (appUploadResponse.status !== 'pending') {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
yield (0, public_1.wait)(exports.APP_UPLOAD_POLLING_INTERVAL);
|
|
134
|
+
}
|
|
135
|
+
if (appUploadResponse.status === 'complete' && !appUploadResponse.is_valid) {
|
|
136
|
+
throw new errors_1.CriticalError('INVALID_MOBILE_APP', `Mobile application failed validation for reason: ${(_j = appUploadResponse.invalid_app_result) === null || _j === void 0 ? void 0 : _j.invalid_message}`);
|
|
137
|
+
}
|
|
138
|
+
if (appUploadResponse.status === 'user_error') {
|
|
139
|
+
throw new errors_1.CriticalError('INVALID_MOBILE_APP_UPLOAD_PARAMETERS', `Mobile application failed validation for reason: ${(_k = appUploadResponse.user_error_result) === null || _k === void 0 ? void 0 : _k.user_error_message}`);
|
|
140
|
+
}
|
|
141
|
+
if (appUploadResponse.status === 'error') {
|
|
142
|
+
throw new errors_1.CriticalError('UNKNOWN_MOBILE_APP_UPLOAD_FAILURE', `Unknown mobile application upload error.`);
|
|
143
|
+
}
|
|
144
|
+
return { appUploadResponse, fileName: multipartPresignedUrlsResponse.file_name };
|
|
125
145
|
});
|
|
126
|
-
exports.
|
|
127
|
-
|
|
128
|
-
|
|
146
|
+
exports.uploadMobileApplication = uploadMobileApplication;
|
|
147
|
+
class AppUploadCache {
|
|
148
|
+
constructor() {
|
|
149
|
+
this.cache = {};
|
|
150
|
+
}
|
|
151
|
+
setAppCacheKeys(triggerConfigs, testsAndConfigsOverride) {
|
|
152
|
+
for (const [index, item] of testsAndConfigsOverride.entries()) {
|
|
153
|
+
if ('test' in item && item.test.type === 'mobile' && !('errorMessage' in item)) {
|
|
154
|
+
const appId = item.test.options.mobileApplication.applicationId;
|
|
155
|
+
const userConfigOverride = triggerConfigs[index].config;
|
|
156
|
+
const appPath = userConfigOverride.mobileApplicationVersionFilePath;
|
|
157
|
+
if (appPath && (!this.cache[appPath] || !this.cache[appPath][appId])) {
|
|
158
|
+
this.cache[appPath] = Object.assign(Object.assign({}, (this.cache[appPath] || {})), { [appId]: undefined });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
getAppsToUpload() {
|
|
164
|
+
const appsToUpload = [];
|
|
165
|
+
for (const appPath of Object.keys(this.cache)) {
|
|
166
|
+
for (const appId of Object.keys(this.cache[appPath])) {
|
|
167
|
+
appsToUpload.push({ appId, appPath });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return appsToUpload;
|
|
171
|
+
}
|
|
172
|
+
getUploadedAppFileName(appPath, appId) {
|
|
173
|
+
return this.cache[appPath][appId];
|
|
174
|
+
}
|
|
175
|
+
setUploadedAppFileName(appPath, appId, fileName) {
|
|
176
|
+
this.cache[appPath][appId] = fileName;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.AppUploadCache = AppUploadCache;
|
|
180
|
+
const overrideMobileConfig = (overriddenTest, appId, tempFileName, mobileApplicationVersion) => {
|
|
181
|
+
if (tempFileName) {
|
|
129
182
|
overriddenTest.mobileApplication = {
|
|
130
|
-
applicationId:
|
|
131
|
-
referenceId:
|
|
183
|
+
applicationId: appId,
|
|
184
|
+
referenceId: tempFileName,
|
|
132
185
|
referenceType: 'temporary',
|
|
133
186
|
};
|
|
134
187
|
}
|
|
135
|
-
else if (
|
|
188
|
+
else if (mobileApplicationVersion) {
|
|
136
189
|
overriddenTest.mobileApplication = {
|
|
137
|
-
applicationId:
|
|
138
|
-
referenceId:
|
|
190
|
+
applicationId: appId,
|
|
191
|
+
referenceId: mobileApplicationVersion,
|
|
139
192
|
referenceType: 'version',
|
|
140
193
|
};
|
|
141
194
|
}
|
|
142
195
|
};
|
|
143
196
|
exports.overrideMobileConfig = overrideMobileConfig;
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
exports.shouldUploadApplication = shouldUploadApplication;
|
|
147
|
-
const uploadApplicationAndOverrideConfig = (api, test, userConfigOverride, overriddenTestsToTrigger, uploadedApplicationByPath) => __awaiter(void 0, void 0, void 0, function* () {
|
|
148
|
-
const testApplicationId = test.options.mobileApplication.applicationId;
|
|
149
|
-
if (userConfigOverride.mobileApplicationVersionFilePath &&
|
|
150
|
-
(0, exports.shouldUploadApplication)(userConfigOverride.mobileApplicationVersionFilePath, testApplicationId, uploadedApplicationByPath)) {
|
|
151
|
-
yield (0, exports.uploadApplication)(api, userConfigOverride.mobileApplicationVersionFilePath, testApplicationId, uploadedApplicationByPath);
|
|
152
|
-
}
|
|
153
|
-
const localApplicationOverride = userConfigOverride.mobileApplicationVersionFilePath
|
|
154
|
-
? uploadedApplicationByPath[userConfigOverride.mobileApplicationVersionFilePath].find(({ applicationId }) => applicationId === testApplicationId)
|
|
155
|
-
: undefined;
|
|
156
|
-
(0, exports.overrideMobileConfig)(userConfigOverride, overriddenTestsToTrigger, test, localApplicationOverride);
|
|
157
|
-
});
|
|
158
|
-
exports.uploadApplicationAndOverrideConfig = uploadApplicationAndOverrideConfig;
|
|
159
|
-
const createNewMobileVersion = (api, version) => __awaiter(void 0, void 0, void 0, function* () {
|
|
160
|
-
var _h;
|
|
161
|
-
let newVersion;
|
|
162
|
-
try {
|
|
163
|
-
newVersion = yield api.createMobileVersion(version);
|
|
164
|
-
}
|
|
165
|
-
catch (e) {
|
|
166
|
-
throw new api_1.EndpointError(`Failed create new Mobile Version: ${(0, api_1.formatBackendErrors)(e)}\n`, (_h = e.response) === null || _h === void 0 ? void 0 : _h.status);
|
|
167
|
-
}
|
|
168
|
-
return newVersion;
|
|
169
|
-
});
|
|
170
|
-
exports.createNewMobileVersion = createNewMobileVersion;
|
|
171
|
-
const uploadMobileApplicationVersion = (config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
172
|
-
var _j;
|
|
197
|
+
const uploadMobileApplicationVersion = (config, appUploadReporter) => __awaiter(void 0, void 0, void 0, function* () {
|
|
198
|
+
var _l;
|
|
173
199
|
const api = (0, api_1.getApiHelper)(config);
|
|
174
200
|
if (!config.mobileApplicationVersionFilePath) {
|
|
175
201
|
throw new errors_1.CiError('MISSING_MOBILE_APPLICATION_PATH', 'Mobile application path is required.');
|
|
@@ -180,16 +206,65 @@ const uploadMobileApplicationVersion = (config) => __awaiter(void 0, void 0, voi
|
|
|
180
206
|
if (!config.versionName) {
|
|
181
207
|
throw new errors_1.CiError('MISSING_MOBILE_VERSION_NAME', 'Version name is required');
|
|
182
208
|
}
|
|
183
|
-
config.latest = (
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
209
|
+
config.latest = (_l = config.latest) !== null && _l !== void 0 ? _l : false;
|
|
210
|
+
const newVersionParams = {
|
|
211
|
+
originalFileName: config.mobileApplicationVersionFilePath,
|
|
212
|
+
versionName: config.versionName,
|
|
213
|
+
isLatest: config.latest,
|
|
214
|
+
};
|
|
215
|
+
const appRenderingInfo = {
|
|
216
|
+
appId: config.mobileApplicationId,
|
|
217
|
+
appPath: config.mobileApplicationVersionFilePath,
|
|
218
|
+
versionName: config.versionName,
|
|
219
|
+
};
|
|
220
|
+
appUploadReporter.start([appRenderingInfo]);
|
|
221
|
+
appUploadReporter.renderProgress(1);
|
|
222
|
+
let appUploadResponse;
|
|
223
|
+
try {
|
|
224
|
+
;
|
|
225
|
+
({ appUploadResponse } = yield (0, exports.uploadMobileApplication)(api, config.mobileApplicationVersionFilePath, config.mobileApplicationId, newVersionParams));
|
|
226
|
+
appUploadReporter.reportSuccess();
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
appUploadReporter.reportFailure(appRenderingInfo);
|
|
230
|
+
throw error;
|
|
231
|
+
}
|
|
232
|
+
return appUploadResponse;
|
|
193
233
|
});
|
|
194
234
|
exports.uploadMobileApplicationVersion = uploadMobileApplicationVersion;
|
|
235
|
+
const uploadMobileApplicationsAndUpdateOverrideConfigs = (api, triggerConfigs, testsAndConfigsOverride) => __awaiter(void 0, void 0, void 0, function* () {
|
|
236
|
+
if (!testsAndConfigsOverride.length) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (!triggerConfigs.filter((config) => config.config.mobileApplicationVersionFilePath).length) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const appUploadCache = new AppUploadCache();
|
|
243
|
+
const appUploadReporter = new app_upload_1.AppUploadReporter(process);
|
|
244
|
+
appUploadCache.setAppCacheKeys(triggerConfigs, testsAndConfigsOverride);
|
|
245
|
+
const appsToUpload = appUploadCache.getAppsToUpload();
|
|
246
|
+
appUploadReporter.start(appsToUpload, true);
|
|
247
|
+
for (const [index, item] of appsToUpload.entries()) {
|
|
248
|
+
appUploadReporter.renderProgress(appsToUpload.length - index);
|
|
249
|
+
try {
|
|
250
|
+
const { fileName } = yield (0, exports.uploadMobileApplication)(api, item.appPath, item.appId);
|
|
251
|
+
appUploadCache.setUploadedAppFileName(item.appPath, item.appId, fileName);
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
appUploadReporter.reportFailure(item);
|
|
255
|
+
throw error;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
appUploadReporter.reportSuccess();
|
|
259
|
+
for (const [index, item] of testsAndConfigsOverride.entries()) {
|
|
260
|
+
if ('test' in item) {
|
|
261
|
+
const appId = item.test.options.mobileApplication.applicationId;
|
|
262
|
+
const userConfigOverride = triggerConfigs[index].config;
|
|
263
|
+
const appPath = userConfigOverride.mobileApplicationVersionFilePath;
|
|
264
|
+
const fileName = appPath && appUploadCache.getUploadedAppFileName(appPath, appId);
|
|
265
|
+
(0, exports.overrideMobileConfig)(item.overriddenConfig, appId, fileName, userConfigOverride.mobileApplicationVersion);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
exports.uploadMobileApplicationsAndUpdateOverrideConfigs = uploadMobileApplicationsAndUpdateOverrideConfigs;
|
|
195
270
|
//# sourceMappingURL=mobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile.js","sourceRoot":"","sources":["../../../src/commands/synthetics/mobile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAChC,4CAAmB;AAEnB,+BAAiF;AACjF,
|
|
1
|
+
{"version":3,"file":"mobile.js","sourceRoot":"","sources":["../../../src/commands/synthetics/mobile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAChC,4CAAmB;AAEnB,+BAAiF;AACjF,qCAA+C;AAa/C,8DAA+D;AAC/D,2CAAmC;AAEnC,MAAM,yBAAyB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA,CAAC,MAAM;AAC5C,QAAA,2BAA2B,GAAG,IAAI,CAAA,CAAC,WAAW;AAC9C,QAAA,8BAA8B,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAA,CAAC,YAAY;AAEjE,MAAM,uBAAuB,GAAG,CACrC,QAAgB,EACkD,EAAE;;IACpE,MAAM,iBAAiB,GAAG;QACxB,sCAAsC;QACtC,+CAA+C;QAC/C,aAAa,EAAE,yBAAyB;KACzC,CAAA;IACD,MAAM,UAAU,GAAG,YAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAA;IACnE,MAAM,KAAK,GAAkC,EAAE,CAAA;;QAC/C,KAA0B,eAAA,eAAA,cAAA,UAAU,CAAA,gBAAA,wFAAE;YAAZ,0BAAU;YAAV,WAAU;YAAzB,MAAM,KAAK,KAAA,CAAA;YACpB,IAAI,CA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C,MAAM,KAAK,CAAA;SACZ;KACF;IACD,iBAAiB,CAAC,aAAa,EAAE,CAAA;IAEjC,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,uBAAuB,CAAC,OAAO,EAAE,EAAE;QAC7D,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAA;YAC/D,MAAM,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAA;YACvD,MAAM,OAAO,GAAG,kBAAkB,CAAC,gCAAgC,CAAA;YACnE,MAAM,QAAQ,GAAG,OAAO,IAAI,cAAc,CAAC,sBAAsB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;YACjF,IAAA,4BAAoB,EAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE,QAAQ,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;SAC1G;KACF;AACH,CAAC,CAAA,CAAA;AAtCY,QAAA,gDAAgD,oDAsC5D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ICONS = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
exports.ICONS = {
|
|
9
|
+
FAILED: chalk_1.default.bold.red('✖'),
|
|
10
|
+
FAILED_NON_BLOCKING: chalk_1.default.bold.yellow('✖'),
|
|
11
|
+
SKIPPED: chalk_1.default.bold.yellow('⇢'),
|
|
12
|
+
SUCCESS: chalk_1.default.bold.green('✓'),
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/commands/synthetics/reporters/constants.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAEZ,QAAA,KAAK,GAAG;IACnB,MAAM,EAAE,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAC3B,mBAAmB,EAAE,eAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;IAC3C,OAAO,EAAE,eAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;IAC/B,OAAO,EAAE,eAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;CAC/B,CAAA"}
|
|
@@ -9,6 +9,7 @@ const ora_1 = __importDefault(require("ora"));
|
|
|
9
9
|
const interfaces_1 = require("../interfaces");
|
|
10
10
|
const internal_1 = require("../utils/internal");
|
|
11
11
|
const public_1 = require("../utils/public");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
12
13
|
// Step rendering
|
|
13
14
|
const renderStepDuration = (duration) => {
|
|
14
15
|
const getColor = () => {
|
|
@@ -23,20 +24,14 @@ const renderStepDuration = (duration) => {
|
|
|
23
24
|
const color = getColor();
|
|
24
25
|
return `${color(duration.toString())}ms`;
|
|
25
26
|
};
|
|
26
|
-
const ICONS = {
|
|
27
|
-
FAILED: chalk_1.default.bold.red('✖'),
|
|
28
|
-
FAILED_NON_BLOCKING: chalk_1.default.bold.yellow('✖'),
|
|
29
|
-
SKIPPED: chalk_1.default.bold.yellow('⇢'),
|
|
30
|
-
SUCCESS: chalk_1.default.bold.green('✓'),
|
|
31
|
-
};
|
|
32
27
|
const renderStepIcon = (step) => {
|
|
33
28
|
if (step.error) {
|
|
34
|
-
return ICONS.FAILED;
|
|
29
|
+
return constants_1.ICONS.FAILED;
|
|
35
30
|
}
|
|
36
31
|
if (step.skipped) {
|
|
37
|
-
return ICONS.SKIPPED;
|
|
32
|
+
return constants_1.ICONS.SKIPPED;
|
|
38
33
|
}
|
|
39
|
-
return ICONS.SUCCESS;
|
|
34
|
+
return constants_1.ICONS.SUCCESS;
|
|
40
35
|
};
|
|
41
36
|
const renderStep = (step) => {
|
|
42
37
|
const duration = renderStepDuration(step.duration);
|
|
@@ -52,7 +47,7 @@ const renderSkippedSteps = (steps) => {
|
|
|
52
47
|
if (steps.length === 1) {
|
|
53
48
|
return renderStep(steps[0]);
|
|
54
49
|
}
|
|
55
|
-
return ` ${ICONS.SKIPPED} | ${steps.length} skipped steps`;
|
|
50
|
+
return ` ${constants_1.ICONS.SKIPPED} | ${steps.length} skipped steps`;
|
|
56
51
|
};
|
|
57
52
|
const renderApiError = (errorCode, errorMessage, color) => {
|
|
58
53
|
if (errorCode === 'INCORRECT_ASSERTION') {
|
|
@@ -77,7 +72,7 @@ const renderResultOutcome = (result, test, icon, color) => {
|
|
|
77
72
|
if (result.unhealthy) {
|
|
78
73
|
const error = result.failure && result.failure.message !== 'Unknown error' ? result.failure.message : 'General Error';
|
|
79
74
|
return [
|
|
80
|
-
` ${chalk_1.default.yellow(`${ICONS.SKIPPED} | ${error}`)}`,
|
|
75
|
+
` ${chalk_1.default.yellow(`${constants_1.ICONS.SKIPPED} | ${error}`)}`,
|
|
81
76
|
` ${chalk_1.default.yellow('We had an error during the execution of this test. The result will be ignored')}`,
|
|
82
77
|
].join('\n');
|
|
83
78
|
}
|
|
@@ -184,12 +179,12 @@ const getResultIdentificationSuffix = (execution, setColor) => {
|
|
|
184
179
|
};
|
|
185
180
|
const getResultIconAndColor = (resultOutcome) => {
|
|
186
181
|
if (public_1.PASSED_RESULT_OUTCOMES.includes(resultOutcome)) {
|
|
187
|
-
return [ICONS.SUCCESS, chalk_1.default.bold.green];
|
|
182
|
+
return [constants_1.ICONS.SUCCESS, chalk_1.default.bold.green];
|
|
188
183
|
}
|
|
189
184
|
if (resultOutcome === "failed-non-blocking" /* ResultOutcome.FailedNonBlocking */) {
|
|
190
|
-
return [ICONS.FAILED_NON_BLOCKING, chalk_1.default.bold.yellow];
|
|
185
|
+
return [constants_1.ICONS.FAILED_NON_BLOCKING, chalk_1.default.bold.yellow];
|
|
191
186
|
}
|
|
192
|
-
return [ICONS.FAILED, chalk_1.default.bold.red];
|
|
187
|
+
return [constants_1.ICONS.FAILED, chalk_1.default.bold.red];
|
|
193
188
|
};
|
|
194
189
|
class DefaultReporter {
|
|
195
190
|
constructor({ context }) {
|
|
@@ -321,8 +316,9 @@ class DefaultReporter {
|
|
|
321
316
|
}
|
|
322
317
|
return `Found test "${chalk_1.default.green.bold(test.name)}"`;
|
|
323
318
|
};
|
|
319
|
+
// TODO SYNTH-12972: Rename "config override" to "test override" in the code AND the reported message
|
|
324
320
|
const getConfigOverridesPart = () => {
|
|
325
|
-
const nbConfigsOverridden =
|
|
321
|
+
const nbConfigsOverridden = (0, public_1.getTestOverridesCount)(config);
|
|
326
322
|
if (nbConfigsOverridden === 0 || executionRule === interfaces_1.ExecutionRule.SKIPPED) {
|
|
327
323
|
return '';
|
|
328
324
|
}
|