@appland/appmap 3.21.0 → 3.23.1
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/CHANGELOG.md +36 -0
- package/built/appmap.html +1 -1
- package/built/main.js.map +1 -1
- package/built/package.json +1 -1
- package/built/src/cmds/record/action/guessTestCommands.js +26 -0
- package/built/src/cmds/record/action/guessTestCommands.js.map +1 -0
- package/built/src/cmds/record/action/printAppMapCount.js +18 -0
- package/built/src/cmds/record/action/printAppMapCount.js.map +1 -0
- package/built/src/cmds/record/action/startRecording.js +1 -1
- package/built/src/cmds/record/action/startRecording.js.map +1 -1
- package/built/src/cmds/record/action/startTestCases.js +24 -0
- package/built/src/cmds/record/action/startTestCases.js.map +1 -0
- package/built/src/cmds/record/action/stopRecording.js +1 -1
- package/built/src/cmds/record/action/stopRecording.js.map +1 -1
- package/built/src/cmds/record/configuration.js +22 -10
- package/built/src/cmds/record/configuration.js.map +1 -1
- package/built/src/cmds/record/prompt/obtainTestCommands.js +73 -0
- package/built/src/cmds/record/prompt/obtainTestCommands.js.map +1 -0
- package/built/src/cmds/record/record.js +48 -4
- package/built/src/cmds/record/record.js.map +1 -1
- package/built/src/cmds/record/state/agentNotAvailable.js +3 -3
- package/built/src/cmds/record/state/agentNotAvailable.js.map +1 -1
- package/built/src/cmds/record/state/agentProcessNotRunning.js +6 -6
- package/built/src/cmds/record/state/agentProcessNotRunning.js.map +1 -1
- package/built/src/cmds/record/state/initial.js +32 -18
- package/built/src/cmds/record/state/initial.js.map +1 -1
- package/built/src/cmds/record/state/record_remote.js +27 -0
- package/built/src/cmds/record/state/record_remote.js.map +1 -0
- package/built/src/cmds/record/state/record_test.js +20 -0
- package/built/src/cmds/record/state/record_test.js.map +1 -0
- package/built/src/cmds/record/state/testCasesComplete.js +15 -0
- package/built/src/cmds/record/state/testCasesComplete.js.map +1 -0
- package/built/src/cmds/record/state/testCasesRunning.js +13 -0
- package/built/src/cmds/record/state/testCasesRunning.js.map +1 -0
- package/built/src/cmds/record/state/testCommandsAvailable.js +14 -0
- package/built/src/cmds/record/state/testCommandsAvailable.js.map +1 -0
- package/built/src/cmds/record/state/testCommandsNeeded.js +13 -0
- package/built/src/cmds/record/state/testCommandsNeeded.js.map +1 -0
- package/built/src/cmds/record/test/areTestCommandsConfigured.js +32 -0
- package/built/src/cmds/record/test/areTestCommandsConfigured.js.map +1 -0
- package/built/src/cmds/record/test/isAgentAvailable.js +4 -3
- package/built/src/cmds/record/test/isAgentAvailable.js.map +1 -1
- package/built/src/cmds/record/testCaseRecording.js +112 -0
- package/built/src/cmds/record/testCaseRecording.js.map +1 -0
- package/built/src/cmds/userInteraction.js +9 -1
- package/built/src/cmds/userInteraction.js.map +1 -1
- package/built/src/search/findEvents.js +3 -1
- package/built/src/search/findEvents.js.map +1 -1
- package/built/src/telemetry.js.map +1 -1
- package/built/src/utils.js +1 -1
- package/built/src/utils.js.map +1 -1
- package/package.json +1 -1
package/built/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../../utils");
|
|
4
|
+
const RubyEnv = { APPMAP: 'true', DISABLE_SPRING: 'true' };
|
|
5
|
+
const TestCommands = {
|
|
6
|
+
'Gemfile/spec': {
|
|
7
|
+
env: RubyEnv,
|
|
8
|
+
command: 'bundle exec rspec',
|
|
9
|
+
},
|
|
10
|
+
'Gemfile/test': {
|
|
11
|
+
env: RubyEnv,
|
|
12
|
+
command: 'bundle exec rake test',
|
|
13
|
+
},
|
|
14
|
+
'pom.xml': {
|
|
15
|
+
command: 'mvn test',
|
|
16
|
+
env: {},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
async function guessTestCommands() {
|
|
20
|
+
const pathExists = await Promise.all(Object.keys(TestCommands).map(async (path) => await (0, utils_1.exists)(path)));
|
|
21
|
+
return Object.keys(TestCommands)
|
|
22
|
+
.filter((_, idx) => pathExists[idx])
|
|
23
|
+
.map((path) => TestCommands[path]);
|
|
24
|
+
}
|
|
25
|
+
exports.default = guessTestCommands;
|
|
26
|
+
//# sourceMappingURL=guessTestCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guessTestCommands.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/guessTestCommands.ts"],"names":[],"mappings":";;AAAA,0CAAiD;AAIjD,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC;AAE3D,MAAM,YAAY,GAAgC;IAChD,cAAc,EAAE;QACd,GAAG,EAAE,OAAO;QACZ,OAAO,EAAE,mBAAmB;KAC7B;IACD,cAAc,EAAE;QACd,GAAG,EAAE,OAAO;QACZ,OAAO,EAAE,uBAAuB;KACjC;IACD,SAAS,EAAE;QACT,OAAO,EAAE,UAAU;QACnB,GAAG,EAAE,EAAE;KACR;CACF,CAAC;AAEa,KAAK,UAAU,iBAAiB;IAG7C,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,GAAG,CAClC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC,CAClE,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;SAC7B,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;SACnC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AACvC,CAAC;AATD,oCASC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
8
|
+
async function printAppMapCount(appMapDir) {
|
|
9
|
+
let fileCount = 0;
|
|
10
|
+
// This function is too verbose to be useful in this context.
|
|
11
|
+
const v = (0, utils_1.verbose)();
|
|
12
|
+
(0, utils_1.verbose)(false);
|
|
13
|
+
await (0, utils_1.listAppMapFiles)(appMapDir, (_fileName) => (fileCount += 1));
|
|
14
|
+
(0, utils_1.verbose)(v);
|
|
15
|
+
userInteraction_1.default.progress(`There are now ${fileCount} AppMap files in directory ${appMapDir}`);
|
|
16
|
+
}
|
|
17
|
+
exports.default = printAppMapCount;
|
|
18
|
+
//# sourceMappingURL=printAppMapCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printAppMapCount.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/printAppMapCount.ts"],"names":[],"mappings":";;;;;AAAA,0CAA0D;AAC1D,4EAAuC;AAExB,KAAK,UAAU,gBAAgB,CAAC,SAAiB;IAC9D,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,6DAA6D;IAC7D,MAAM,CAAC,GAAG,IAAA,eAAO,GAAE,CAAC;IACpB,IAAA,eAAO,EAAC,KAAK,CAAC,CAAC;IACf,MAAM,IAAA,uBAAe,EAAC,SAAS,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1E,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;IAEX,yBAAE,CAAC,QAAQ,CACT,iBAAiB,SAAS,8BAA8B,SAAS,EAAE,CACpE,CAAC;AACJ,CAAC;AAZD,mCAYC"}
|
|
@@ -9,7 +9,7 @@ const remoteRecording_1 = __importDefault(require("../remoteRecording"));
|
|
|
9
9
|
async function startRecording() {
|
|
10
10
|
const ro = await (0, configuration_1.requestOptions)();
|
|
11
11
|
userInteraction_1.default.progress('');
|
|
12
|
-
await userInteraction_1.default.
|
|
12
|
+
await userInteraction_1.default.continue('Press enter to start recording');
|
|
13
13
|
const rr = new remoteRecording_1.default(ro);
|
|
14
14
|
await rr.start();
|
|
15
15
|
userInteraction_1.default.progress(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startRecording.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/startRecording.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,oDAAkD;AAClD,yEAAiD;AAElC,KAAK,UAAU,cAAc;IAC1C,MAAM,EAAE,GAAG,MAAM,IAAA,8BAAc,GAAE,CAAC;IAElC,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChB,MAAM,yBAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"startRecording.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/startRecording.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,oDAAkD;AAClD,yEAAiD;AAElC,KAAK,UAAU,cAAc;IAC1C,MAAM,EAAE,GAAG,MAAM,IAAA,8BAAc,GAAE,CAAC;IAElC,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChB,MAAM,yBAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC;IAEpD,MAAM,EAAE,GAAG,IAAI,yBAAe,CAAC,EAAE,CAAC,CAAC;IACnC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;IAEjB,yBAAE,CAAC,QAAQ,CAAC;;CAEb,CAAC,CAAC;AACH,CAAC;AAZD,iCAYC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
const testCaseRecording_1 = __importDefault(require("../testCaseRecording"));
|
|
7
|
+
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
8
|
+
const configuration_1 = require("../configuration");
|
|
9
|
+
async function startTestCases() {
|
|
10
|
+
if (Boolean(process.stdout.isTTY)) {
|
|
11
|
+
const defaultMaxTime = await (0, configuration_1.readSetting)('test_recording.max_time', 30);
|
|
12
|
+
const { maxTime } = await userInteraction_1.default.prompt({
|
|
13
|
+
type: 'input',
|
|
14
|
+
name: 'maxTime',
|
|
15
|
+
message: 'Enter the maximum time (in seconds) to allow test cases to run (-1 to run forever):',
|
|
16
|
+
default: defaultMaxTime,
|
|
17
|
+
});
|
|
18
|
+
if (maxTime !== defaultMaxTime)
|
|
19
|
+
await (0, configuration_1.writeSetting)('test_recording.max_time', maxTime);
|
|
20
|
+
}
|
|
21
|
+
await testCaseRecording_1.default.start();
|
|
22
|
+
}
|
|
23
|
+
exports.default = startTestCases;
|
|
24
|
+
//# sourceMappingURL=startTestCases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startTestCases.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/startTestCases.ts"],"names":[],"mappings":";;;;;AAAA,6EAAqD;AACrD,4EAAuC;AACvC,oDAA6D;AAE9C,KAAK,UAAU,cAAc;IAC1C,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QACjC,MAAM,cAAc,GAAG,MAAM,IAAA,2BAAW,EAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;QACxE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;YAClC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,SAAS;YACf,OAAO,EACL,qFAAqF;YACvF,OAAO,EAAE,cAAc;SACxB,CAAC,CAAC;QACH,IAAI,OAAO,KAAK,cAAc;YAC5B,MAAM,IAAA,4BAAY,EAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;KAC1D;IAED,MAAM,2BAAiB,CAAC,KAAK,EAAE,CAAC;AAClC,CAAC;AAfD,iCAeC"}
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
7
7
|
async function stopRecording() {
|
|
8
|
-
await userInteraction_1.default.
|
|
8
|
+
await userInteraction_1.default.continue('Press enter to stop recording');
|
|
9
9
|
}
|
|
10
10
|
exports.default = stopRecording;
|
|
11
11
|
//# sourceMappingURL=stopRecording.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stopRecording.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/stopRecording.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AAExB,KAAK,UAAU,aAAa;IACzC,MAAM,yBAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"stopRecording.js","sourceRoot":"","sources":["../../../../../src/cmds/record/action/stopRecording.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AAExB,KAAK,UAAU,aAAa;IACzC,MAAM,yBAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC,CAAC;AACrD,CAAC;AAFD,gCAEC"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.writeConfigOption = exports.writeSetting = exports.readConfigOption = exports.readSetting = exports.requestOptions = exports.setAppMapSettingsFilePath = exports.setAppMapConfigFilePath = void 0;
|
|
3
|
+
exports.writeConfigOption = exports.writeSetting = exports.readConfigOption = exports.readSetting = exports.requestOptions = exports.readAllSettings = exports.readConfig = exports.setAppMapSettingsFilePath = exports.setAppMapConfigFilePath = exports.TestCommand = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const promises_1 = require("fs/promises");
|
|
6
6
|
const js_yaml_1 = require("js-yaml");
|
|
7
7
|
const path_1 = require("path");
|
|
8
|
-
let AppMapConfigFilePath =
|
|
8
|
+
let AppMapConfigFilePath = 'appmap.yml';
|
|
9
9
|
let AppMapSettingsFilePath = (0, path_1.join)(process.env.HOME || '', '.appmaprc');
|
|
10
|
+
class TestCommand {
|
|
11
|
+
constructor(command, env = {}) {
|
|
12
|
+
this.command = command;
|
|
13
|
+
this.env = env;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.TestCommand = TestCommand;
|
|
10
17
|
// Returns the previous config file path.
|
|
11
18
|
function setAppMapConfigFilePath(appMapFile) {
|
|
12
19
|
const oldPath = AppMapConfigFilePath;
|
|
@@ -34,24 +41,31 @@ async function readConfig() {
|
|
|
34
41
|
}
|
|
35
42
|
return (0, js_yaml_1.load)(fileContents.toString());
|
|
36
43
|
}
|
|
44
|
+
exports.readConfig = readConfig;
|
|
45
|
+
function settingsKey() {
|
|
46
|
+
return (0, path_1.isAbsolute)(AppMapConfigFilePath)
|
|
47
|
+
? AppMapConfigFilePath
|
|
48
|
+
: (0, path_1.join)(process.cwd(), AppMapConfigFilePath);
|
|
49
|
+
}
|
|
37
50
|
async function readAllSettings() {
|
|
38
51
|
let settings;
|
|
39
52
|
try {
|
|
40
53
|
const fileContents = await (0, promises_1.readFile)(AppMapSettingsFilePath);
|
|
41
54
|
settings = (0, js_yaml_1.load)(fileContents.toString());
|
|
42
55
|
// Make sure settings is an object.
|
|
43
|
-
settings[
|
|
56
|
+
settings[settingsKey()];
|
|
44
57
|
}
|
|
45
58
|
catch (_a) {
|
|
46
59
|
settings = {};
|
|
47
60
|
}
|
|
48
|
-
if (!settings[
|
|
49
|
-
settings[
|
|
61
|
+
if (!settings[settingsKey()]) {
|
|
62
|
+
settings[settingsKey()] = {};
|
|
50
63
|
}
|
|
51
64
|
return settings;
|
|
52
65
|
}
|
|
66
|
+
exports.readAllSettings = readAllSettings;
|
|
53
67
|
async function readSettings() {
|
|
54
|
-
return (await readAllSettings())[
|
|
68
|
+
return (await readAllSettings())[settingsKey()];
|
|
55
69
|
}
|
|
56
70
|
async function writeConfig(config) {
|
|
57
71
|
await (0, promises_1.writeFile)(AppMapConfigFilePath, (0, js_yaml_1.dump)(config));
|
|
@@ -62,7 +76,7 @@ async function writeSettings(settings) {
|
|
|
62
76
|
async function requestOptions() {
|
|
63
77
|
const requestOptions = {};
|
|
64
78
|
requestOptions.hostname = (await readSetting('remote_recording.host', 'localhost')).toString();
|
|
65
|
-
requestOptions.port = await readSetting('remote_recording.port', 3000);
|
|
79
|
+
requestOptions.port = (await readSetting('remote_recording.port', 3000));
|
|
66
80
|
requestOptions.path = (await readConfigOption('remote_recording.path', '/')).toString();
|
|
67
81
|
requestOptions.protocol = (await readConfigOption('remote_recording.protocol', 'http:')).toString();
|
|
68
82
|
return requestOptions;
|
|
@@ -88,13 +102,11 @@ function findOption(data, path, defaultValue) {
|
|
|
88
102
|
return defaultValue;
|
|
89
103
|
entry = entry[token];
|
|
90
104
|
}
|
|
91
|
-
if (typeof entry === 'object')
|
|
92
|
-
return defaultValue;
|
|
93
105
|
return entry || defaultValue;
|
|
94
106
|
}
|
|
95
107
|
async function writeSetting(path, value) {
|
|
96
108
|
const allSettings = await readAllSettings();
|
|
97
|
-
const settings = allSettings[
|
|
109
|
+
const settings = allSettings[settingsKey()];
|
|
98
110
|
mergeConfigData(settings, path, value);
|
|
99
111
|
await writeSettings(allSettings);
|
|
100
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../../src/cmds/record/configuration.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../../src/cmds/record/configuration.ts"],"names":[],"mappings":";;;AAAA,2BAAgC;AAChC,0CAAkD;AAElD,qCAAqC;AACrC,+BAAwC;AAExC,IAAI,oBAAoB,GAAG,YAAY,CAAC;AACxC,IAAI,sBAAsB,GAAG,IAAA,WAAI,EAAC,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,CAAC;IAClC,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AATD,8CASC;AAED,SAAS,eAAe,CACtB,IAAS,EACT,IAAY,EACZ,KAAsC;IAEtC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,EAAG,CAAC;IAChC,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACjB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;SACnB;QACD,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;KACtB;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE;YAC9B,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;SAC1B;KACF;AACH,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
7
|
+
const configuration_1 = require("../configuration");
|
|
8
|
+
const guessTestCommands_1 = __importDefault(require("../action/guessTestCommands"));
|
|
9
|
+
const testCaseRecording_1 = __importDefault(require("../testCaseRecording"));
|
|
10
|
+
async function obtainTestCommands() {
|
|
11
|
+
userInteraction_1.default.progress(``);
|
|
12
|
+
userInteraction_1.default.progress(`In order to record test cases, you need to provide a command that I can use to run the tests. ` +
|
|
13
|
+
`If your project has many test cases, ` +
|
|
14
|
+
`enter a command that will run integration, functional, system or request tests, as opposed to unit tests. ` +
|
|
15
|
+
`Don't worry about how long the tests will take to run, you will specify a maximum runtime in an upcoming step.`);
|
|
16
|
+
userInteraction_1.default.progress(``);
|
|
17
|
+
const testCommands = (await (0, guessTestCommands_1.default)()) || [];
|
|
18
|
+
for (const testCommand of testCommands) {
|
|
19
|
+
userInteraction_1.default.progress(`Here's a suggested test command for your project:`);
|
|
20
|
+
userInteraction_1.default.progress(``);
|
|
21
|
+
// TODO: Colorize
|
|
22
|
+
userInteraction_1.default.progress(`${testCaseRecording_1.default.envString(testCommand.env)}${testCommand.command}`);
|
|
23
|
+
userInteraction_1.default.progress(``);
|
|
24
|
+
if (await userInteraction_1.default.confirm('Use this suggested test command?')) {
|
|
25
|
+
await (0, configuration_1.writeConfigOption)('test_recording.test_commands', [testCommand]);
|
|
26
|
+
userInteraction_1.default.progress(``);
|
|
27
|
+
userInteraction_1.default.progress(`I've written this test command to your AppMap configuration file (appmap.yml). ` +
|
|
28
|
+
`The next time you run this program, it will be used automatically. You can change it in the appmap.yml ` +
|
|
29
|
+
`if you want to. You can also delete it, in which case you'll be prompted again next time. And, you can also add ` +
|
|
30
|
+
`additional test commands to that file.`);
|
|
31
|
+
userInteraction_1.default.progress(``);
|
|
32
|
+
await userInteraction_1.default.continue('Press enter to continue');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
let confirmed = false;
|
|
37
|
+
while (!confirmed) {
|
|
38
|
+
const { testCommand } = await userInteraction_1.default.prompt({
|
|
39
|
+
name: 'testCommand',
|
|
40
|
+
type: 'input',
|
|
41
|
+
message: 'Test command (without env vars):',
|
|
42
|
+
});
|
|
43
|
+
const { envVars } = await userInteraction_1.default.prompt({
|
|
44
|
+
name: 'envVars',
|
|
45
|
+
type: 'input',
|
|
46
|
+
message: 'Environment variables:',
|
|
47
|
+
});
|
|
48
|
+
let env = {};
|
|
49
|
+
if (envVars.toString().trim() !== '') {
|
|
50
|
+
env = envVars
|
|
51
|
+
.toString()
|
|
52
|
+
.trim()
|
|
53
|
+
.split(/\s+/)
|
|
54
|
+
.reduce((acc, curr) => {
|
|
55
|
+
const [key, value] = curr.split('=', 2);
|
|
56
|
+
acc[key] = value;
|
|
57
|
+
return acc;
|
|
58
|
+
}, {});
|
|
59
|
+
}
|
|
60
|
+
userInteraction_1.default.progress(`To run the tests, I will run the following command:`);
|
|
61
|
+
userInteraction_1.default.progress('');
|
|
62
|
+
userInteraction_1.default.progress(`${testCaseRecording_1.default.envString(env)}${testCommand}`);
|
|
63
|
+
userInteraction_1.default.progress('');
|
|
64
|
+
confirmed = await userInteraction_1.default.confirm(`Continue with this command?`);
|
|
65
|
+
if (confirmed) {
|
|
66
|
+
await (0, configuration_1.writeConfigOption)('test_recording.test_commands', [
|
|
67
|
+
{ env, command: testCommand },
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.default = obtainTestCommands;
|
|
73
|
+
//# sourceMappingURL=obtainTestCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"obtainTestCommands.js","sourceRoot":"","sources":["../../../../../src/cmds/record/prompt/obtainTestCommands.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,oDAAqD;AACrD,oFAA4D;AAC5D,6EAAqD;AAEtC,KAAK,UAAU,kBAAkB;IAC9C,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChB,yBAAE,CAAC,QAAQ,CACT,gGAAgG;QAC9F,uCAAuC;QACvC,4GAA4G;QAC5G,gHAAgH,CACnH,CAAC;IACF,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEhB,MAAM,YAAY,GAAG,CAAC,MAAM,IAAA,2BAAiB,GAAE,CAAC,IAAI,EAAE,CAAC;IACvD,KAAK,MAAM,WAAW,IAAI,YAA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,GAAG,OAAO;iBACV,QAAQ,EAAE;iBACV,IAAI,EAAE;iBACN,KAAK,CAAC,KAAK,CAAC;iBACZ,MAAM,CAAC,CAAC,GAA2B,EAAE,IAAY,EAAE,EAAE;gBACpD,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;gBACxC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBACjB,OAAO,GAAG,CAAC;YACb,CAAC,EAAE,EAAE,CAAC,CAAC;SACV;QAED,yBAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC,CAAC;QACnE,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAChB,yBAAE,CAAC,QAAQ,CAAC,GAAG,2BAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,EAAE,CAAC,CAAC;QACjE,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAEhB,SAAS,GAAG,MAAM,yBAAE,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;QAC5D,IAAI,SAAS,EAAE;YACb,MAAM,IAAA,iCAAiB,EAAC,8BAA8B,EAAE;gBACtD,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE;aAC9B,CAAC,CAAC;SACJ;KACF;AACH,CAAC;AA1ED,qCA0EC"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
@@ -8,10 +27,20 @@ const utils_1 = require("../../utils");
|
|
|
8
27
|
const runCommand_1 = __importDefault(require("../runCommand"));
|
|
9
28
|
const showAppMap_1 = __importDefault(require("../open/showAppMap"));
|
|
10
29
|
const configuration_1 = require("./configuration");
|
|
30
|
+
const process_1 = require("process");
|
|
11
31
|
const initial_1 = __importDefault(require("./state/initial"));
|
|
12
|
-
exports.command = 'record';
|
|
32
|
+
exports.command = 'record [mode]';
|
|
13
33
|
exports.describe = 'Create an AppMap via interactive recording, aka remote recording.';
|
|
14
34
|
const builder = (args) => {
|
|
35
|
+
args.positional('mode', {
|
|
36
|
+
type: 'string',
|
|
37
|
+
choices: ['test', 'remote'],
|
|
38
|
+
});
|
|
39
|
+
args.option('directory', {
|
|
40
|
+
describe: 'Working directory for the command.',
|
|
41
|
+
type: 'string',
|
|
42
|
+
alias: 'd',
|
|
43
|
+
});
|
|
15
44
|
args.option('appmap-config', {
|
|
16
45
|
describe: 'AppMap config file to check for default options.',
|
|
17
46
|
type: 'string',
|
|
@@ -22,11 +51,26 @@ const builder = (args) => {
|
|
|
22
51
|
exports.builder = builder;
|
|
23
52
|
const handler = async (argv) => {
|
|
24
53
|
(0, utils_1.verbose)(argv.verbose);
|
|
25
|
-
if (argv.appmapConfig)
|
|
26
|
-
(0, configuration_1.setAppMapConfigFilePath)(argv.appmapConfig);
|
|
27
54
|
const commandFn = async () => {
|
|
28
|
-
|
|
55
|
+
const { directory, appmapConfig } = argv;
|
|
56
|
+
if (directory) {
|
|
57
|
+
if ((0, utils_1.verbose)())
|
|
58
|
+
console.log(`Using working directory ${directory}`);
|
|
59
|
+
(0, process_1.chdir)(directory);
|
|
60
|
+
}
|
|
61
|
+
if (appmapConfig)
|
|
62
|
+
(0, configuration_1.setAppMapConfigFilePath)(appmapConfig);
|
|
63
|
+
const { mode } = argv;
|
|
64
|
+
let state;
|
|
65
|
+
if (mode) {
|
|
66
|
+
state = (await Promise.resolve().then(() => __importStar(require(`./state/record_${mode}`)))).default;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
state = initial_1.default;
|
|
70
|
+
}
|
|
29
71
|
while (state && typeof state === 'function') {
|
|
72
|
+
if ((0, utils_1.verbose)())
|
|
73
|
+
console.warn(`Entering state: ${state.name}`);
|
|
30
74
|
const newState = await state();
|
|
31
75
|
state = newState;
|
|
32
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../../src/cmds/record/record.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../../src/cmds/record/record.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AACtC,+DAAuC;AACvC,oEAA4C;AAE5C,mDAA0D;AAG1D,qCAAgC;AAEhC,8DAAsC;AAEzB,QAAA,OAAO,GAAG,eAAe,CAAC;AAC1B,QAAA,QAAQ,GACnB,mEAAmE,CAAC;AAE/D,MAAM,OAAO,GAAG,CAAC,IAAgB,EAAE,EAAE;IAC1C,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;QACtB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;KAC5B,CAAC,C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AAE,CAAC;YAC/B,KAAK,GAAG,QAAQ,CAAC;SAClB;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,MAAM,IAAA,oBAAU,EAAC,KAAiB,CAAC,CAAC;SACrC;IACH,CAAC,CAAC;IAEF,OAAO,IAAA,oBAAU,EAAC,SAAS,CAAC,CAAC;AAC/B,CAAC,CAAC;AAhCW,QAAA,OAAO,WAgClB"}
|
|
@@ -8,7 +8,7 @@ const configureRemainingRequestOptions_1 = __importDefault(require("../action/co
|
|
|
8
8
|
const detectProcessCharacteristics_1 = __importDefault(require("../action/detectProcessCharacteristics"));
|
|
9
9
|
const isAgentAvailable_1 = __importDefault(require("../test/isAgentAvailable"));
|
|
10
10
|
const agentProcessNotRunning_1 = __importDefault(require("./agentProcessNotRunning"));
|
|
11
|
-
const
|
|
11
|
+
const record_remote_1 = __importDefault(require("./record_remote"));
|
|
12
12
|
// The agent was not reachable using the configured settings. This may be because:
|
|
13
13
|
// * The agent process isn't running.
|
|
14
14
|
// * The agent process is running, but the agent isn't reachable (e.g. security filter?).
|
|
@@ -19,7 +19,7 @@ async function agentNotAvailable() {
|
|
|
19
19
|
return agentProcessNotRunning_1.default;
|
|
20
20
|
}
|
|
21
21
|
if (await (0, isAgentAvailable_1.default)()) {
|
|
22
|
-
return
|
|
22
|
+
return record_remote_1.default;
|
|
23
23
|
}
|
|
24
24
|
userInteraction_1.default.progress(`
|
|
25
25
|
You've confirmed that your application process is running, but I'm unable to connect to the AppMap agent over HTTP. There are three common reasons for this:
|
|
@@ -35,7 +35,7 @@ For case (2), you should contact AppMap support for help with troubleshooting.
|
|
|
35
35
|
For case (3), you can configure the application URL path and protocol.
|
|
36
36
|
`);
|
|
37
37
|
await (0, configureRemainingRequestOptions_1.default)();
|
|
38
|
-
return
|
|
38
|
+
return record_remote_1.default;
|
|
39
39
|
}
|
|
40
40
|
exports.default = agentNotAvailable;
|
|
41
41
|
//# sourceMappingURL=agentNotAvailable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentNotAvailable.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/agentNotAvailable.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AAEvC,kHAA0F;AAC1F,0GAAkF;AAClF,gFAAwD;AAExD,sFAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"agentNotAvailable.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/agentNotAvailable.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AAEvC,kHAA0F;AAC1F,0GAAkF;AAClF,gFAAwD;AAExD,sFAA8D;AAC9D,oEAAsC;AAEtC,kFAAkF;AAClF,qCAAqC;AACrC,yFAAyF;AACzF,wCAAwC;AACxC,yFAAyF;AAC1E,KAAK,UAAU,iBAAiB;IAC7C,IAAI,CAAC,CAAC,MAAM,IAAA,sCAA4B,GAAE,CAAC,EAAE;QAC3C,OAAO,gCAAsB,CAAC;KAC/B;IAED,IAAI,MAAM,IAAA,0BAAgB,GAAE,EAAE;QAC5B,OAAO,uBAAO,CAAC;KAChB;IAED,yBAAE,CAAC,QAAQ,CACT;;;;;;;;;;;;CAYH,CACE,CAAC;IAEF,MAAM,IAAA,0CAAgC,GAAE,CAAC;IAEzC,OAAO,uBAAO,CAAC;AACjB,CAAC;AA5BD,oCA4BC"}
|
|
@@ -5,17 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
7
7
|
const configureHostAndPort_1 = __importDefault(require("../action/configureHostAndPort"));
|
|
8
|
-
const
|
|
8
|
+
const record_remote_1 = __importDefault(require("./record_remote"));
|
|
9
9
|
// No process could be contact on the configured host and port.
|
|
10
10
|
// Prompt the user to start the agent process, and then start over.
|
|
11
11
|
async function agentProcessNotRunning() {
|
|
12
12
|
userInteraction_1.default.progress(`It looks like you need to start your app (make sure you have the AppMap agent enabled).`);
|
|
13
13
|
userInteraction_1.default.progress(`Or maybe your app is running, but it's on a different host and/or port.`);
|
|
14
14
|
userInteraction_1.default.progress(``);
|
|
15
|
-
userInteraction_1.default.progress(`To create a recording, you need to run your app using
|
|
16
|
-
the instructions in the AppMap documentation. Choose the most suitable link here,
|
|
17
|
-
then configure and launch your app process. Once you've done that, come back to this terminal
|
|
18
|
-
and we will try again.`);
|
|
15
|
+
userInteraction_1.default.progress(`To create a recording, you need to run your app using ` +
|
|
16
|
+
`the instructions in the AppMap documentation. Choose the most suitable link here, ` +
|
|
17
|
+
`then configure and launch your app process. Once you've done that, come back to this terminal ` +
|
|
18
|
+
`and we will try again.`);
|
|
19
19
|
userInteraction_1.default.progress(`
|
|
20
20
|
Rails: https://appland.com/docs/reference/appmap-ruby.html#remote-recording
|
|
21
21
|
Django: https://appland.com/docs/reference/appmap-python.html#django
|
|
@@ -24,7 +24,7 @@ and we will try again.`);
|
|
|
24
24
|
JavaScript: https://appland.com/docs/reference/appmap-agent-js.html#remote-recording
|
|
25
25
|
`);
|
|
26
26
|
await (0, configureHostAndPort_1.default)();
|
|
27
|
-
return
|
|
27
|
+
return record_remote_1.default;
|
|
28
28
|
}
|
|
29
29
|
exports.default = agentProcessNotRunning;
|
|
30
30
|
//# sourceMappingURL=agentProcessNotRunning.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentProcessNotRunning.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/agentProcessNotRunning.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,0FAAkE;AAElE,
|
|
1
|
+
{"version":3,"file":"agentProcessNotRunning.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/agentProcessNotRunning.ts"],"names":[],"mappings":";;;;;AAAA,4EAAuC;AACvC,0FAAkE;AAElE,oEAAsC;AAEtC,+DAA+D;AAC/D,mEAAmE;AACpD,KAAK,UAAU,sBAAsB;IAClD,yBAAE,CAAC,QAAQ,CACT,yFAAyF,CAC1F,CAAC;IACF,yBAAE,CAAC,QAAQ,CACT,yEAAyE,CAC1E,CAAC;IACF,yBAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEhB,yBAAE,CAAC,QAAQ,CACT,wDAAwD;QACtD,oFAAoF;QACpF,gGAAgG;QAChG,wBAAwB,CAC3B,CAAC;IACF,yBAAE,CAAC,QAAQ,CAAC;;;;;;GAMX,CAAC,CAAC;IAEH,MAAM,IAAA,8BAAoB,GAAE,CAAC;IAE7B,OAAO,uBAAO,CAAC;AACjB,CAAC;AA1BD,yCA0BC"}
|
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
5
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const isRecordingInProgress_1 = __importDefault(require("../test/isRecordingInProgress"));
|
|
8
|
-
const agentAvailableAndReady_1 = __importDefault(require("./agentAvailableAndReady"));
|
|
9
|
-
const agentIsRecording_1 = __importDefault(require("./agentIsRecording"));
|
|
10
|
-
const agentNotAvailable_1 = __importDefault(require("./agentNotAvailable"));
|
|
11
|
-
// This is the initial state of the record command. From here, the connection to the AppMap
|
|
12
|
-
// agent must be configured and verified, and then the recording will be run.
|
|
25
|
+
const userInteraction_1 = __importDefault(require("../../userInteraction"));
|
|
13
26
|
async function initial() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
const choices = {
|
|
28
|
+
'remote recording': 'remote',
|
|
29
|
+
'test cases': 'test',
|
|
30
|
+
};
|
|
31
|
+
const { method: methodName } = await userInteraction_1.default.prompt({
|
|
32
|
+
name: 'method',
|
|
33
|
+
type: 'list',
|
|
34
|
+
message: 'Choose recording method:',
|
|
35
|
+
choices: Object.keys(choices),
|
|
36
|
+
});
|
|
37
|
+
const method = choices[methodName];
|
|
38
|
+
return (await Promise.resolve().then(() => __importStar(require(`./record_${method}`)))).default;
|
|
25
39
|
}
|
|
26
40
|
exports.default = initial;
|
|
27
41
|
//# sourceMappingURL=initial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initial.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/initial.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initial.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/initial.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,4EAAuC;AAGxB,KAAK,UAAU,OAAO;IACnC,MAAM,OAAO,GAAG;QACd,kBAAkB,EAAE,QAAQ;QAC5B,YAAY,EAAE,MAAM;KACrB,CAAC;IAEF,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,yBAAE,CAAC,MAAM,CAAC;QAC7C,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,0BAA0B;QACnC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;KAC9B,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACnC,OAAO,CAAC,wDAAa,YAAY,MAAM,EAAE,GAAC,CAAC,CAAC,OAAO,CAAC;AACtD,CAAC;AAdD,0BAcC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
const isAgentAvailable_1 = __importDefault(require("../test/isAgentAvailable"));
|
|
7
|
+
const isRecordingInProgress_1 = __importDefault(require("../test/isRecordingInProgress"));
|
|
8
|
+
const agentAvailableAndReady_1 = __importDefault(require("./agentAvailableAndReady"));
|
|
9
|
+
const agentIsRecording_1 = __importDefault(require("./agentIsRecording"));
|
|
10
|
+
const agentNotAvailable_1 = __importDefault(require("./agentNotAvailable"));
|
|
11
|
+
// This is the initial state of remote recording. From here, the connection to the AppMap
|
|
12
|
+
// agent must be configured and verified, and then the recording will be run.
|
|
13
|
+
async function remote() {
|
|
14
|
+
if (await (0, isAgentAvailable_1.default)()) {
|
|
15
|
+
if (!(await (0, isRecordingInProgress_1.default)())) {
|
|
16
|
+
return agentAvailableAndReady_1.default;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return agentIsRecording_1.default;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return agentNotAvailable_1.default;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = remote;
|
|
27
|
+
//# sourceMappingURL=record_remote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record_remote.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/record_remote.ts"],"names":[],"mappings":";;;;;AAAA,gFAAwD;AACxD,0FAAkE;AAClE,sFAA8D;AAC9D,0EAAkD;AAClD,4EAAoD;AAGpD,yFAAyF;AACzF,6EAA6E;AAC9D,KAAK,UAAU,MAAM;IAClC,IAAI,MAAM,IAAA,0BAAgB,GAAE,EAAE;QAC5B,IAAI,CAAC,CAAC,MAAM,IAAA,+BAAqB,GAAE,CAAC,EAAE;YACpC,OAAO,gCAAsB,CAAC;SAC/B;aAAM;YACL,OAAO,0BAAgB,CAAC;SACzB;KACF;SAAM;QACL,OAAO,2BAAiB,CAAC;KAC1B;AACH,CAAC;AAVD,yBAUC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
const areTestCommandsConfigured_1 = __importDefault(require("../test/areTestCommandsConfigured"));
|
|
7
|
+
const testCommandsNeeded_1 = __importDefault(require("./testCommandsNeeded"));
|
|
8
|
+
const testCommandsAvailable_1 = __importDefault(require("./testCommandsAvailable"));
|
|
9
|
+
// This is the initial state of test case recording. From here, the record command is
|
|
10
|
+
// configured by the user and executed.
|
|
11
|
+
async function test() {
|
|
12
|
+
if (await (0, areTestCommandsConfigured_1.default)()) {
|
|
13
|
+
return testCommandsAvailable_1.default;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return testCommandsNeeded_1.default;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.default = test;
|
|
20
|
+
//# sourceMappingURL=record_test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record_test.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/record_test.ts"],"names":[],"mappings":";;;;;AAAA,kGAA0E;AAE1E,8EAAsD;AACtD,oFAA4D;AAE5D,qFAAqF;AACrF,uCAAuC;AACxB,KAAK,UAAU,IAAI;IAChC,IAAI,MAAM,IAAA,mCAAyB,GAAE,EAAE;QACrC,OAAO,+BAAqB,CAAC;KAC9B;SAAM;QACL,OAAO,4BAAkB,CAAC;KAC3B;AACH,CAAC;AAND,uBAMC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
const printAppMapCount_1 = __importDefault(require("../action/printAppMapCount"));
|
|
7
|
+
const configuration_1 = require("../configuration");
|
|
8
|
+
async function testCasesComplete() {
|
|
9
|
+
var _a;
|
|
10
|
+
const appMapDir = (_a = (await (0, configuration_1.readConfig)())) === null || _a === void 0 ? void 0 : _a.appmap_dir;
|
|
11
|
+
await (0, printAppMapCount_1.default)(appMapDir || '.');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
exports.default = testCasesComplete;
|
|
15
|
+
//# sourceMappingURL=testCasesComplete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testCasesComplete.js","sourceRoot":"","sources":["../../../../../src/cmds/record/state/testCasesComplete.ts"],"names":[],"mappings":";;;;;AAAA,kFAA0D;AAC1D,oDAA8C;AAE/B,KAAK,UAAU,iBAAiB;;IAC7C,MAAM,SAAS,GAAG,MAAA,CAAC,MAAM,IAAA,0BAAU,GAAE,CAAC,0CAAE,UAAU,CAAC;IAEnD,MAAM,IAAA,0BAAgB,EAAC,SAAS,IAAI,GAAG,CAAC,CAAC;IAEzC,OAAO;AACT,CAAC;AAND,oCAMC"}
|