gauge-ts 0.0.4 → 0.1.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/dist/GaugeRuntime.d.ts +1 -2
- package/dist/GaugeRuntime.js +14 -34
- package/dist/RunnerServiceImpl.d.ts +48 -0
- package/dist/RunnerServiceImpl.js +225 -0
- package/dist/gen/messages_pb.d.ts +1685 -0
- package/dist/gen/messages_pb.js +12093 -0
- package/dist/gen/services_grpc_pb.d.ts +636 -0
- package/dist/gen/services_grpc_pb.js +856 -0
- package/dist/gen/services_pb.d.ts +8 -0
- package/dist/gen/services_pb.js +16 -0
- package/dist/gen/spec_pb.d.ts +1249 -0
- package/dist/gen/spec_pb.js +9341 -0
- package/dist/helpers/CodeHelper.d.ts +18 -5
- package/dist/helpers/CodeHelper.js +23 -16
- package/dist/index.d.ts +4 -2
- package/dist/index.js +5 -0
- package/dist/loaders/ImplLoader.d.ts +1 -1
- package/dist/loaders/ImplLoader.js +8 -7
- package/dist/loaders/StaticLoader.d.ts +1 -1
- package/dist/loaders/StaticLoader.js +10 -10
- package/dist/models/GlobalRegistry.d.ts +8 -0
- package/dist/{processors/IMessageProcessor.js → models/GlobalRegistry.js} +0 -0
- package/dist/models/HookMethod.d.ts +6 -5
- package/dist/models/HookMethod.js +2 -2
- package/dist/models/HookRegistry.d.ts +2 -2
- package/dist/models/HookRegistry.js +16 -12
- package/dist/models/StepRegistry.d.ts +5 -4
- package/dist/models/StepRegistry.js +21 -17
- package/dist/models/StepRegistryEntry.d.ts +6 -5
- package/dist/models/StepRegistryEntry.js +0 -1
- package/dist/processors/CacheFileProcessor.d.ts +3 -4
- package/dist/processors/CacheFileProcessor.js +21 -36
- package/dist/processors/ExecutionEndingProcessor.d.ts +4 -4
- package/dist/processors/ExecutionEndingProcessor.js +3 -3
- package/dist/processors/ExecutionProcessor.d.ts +6 -6
- package/dist/processors/ExecutionProcessor.js +11 -12
- package/dist/processors/ExecutionStartingProcessor.d.ts +5 -6
- package/dist/processors/ExecutionStartingProcessor.js +9 -9
- package/dist/processors/HookExecutionProcessor.d.ts +6 -5
- package/dist/processors/HookExecutionProcessor.js +44 -36
- package/dist/processors/RefactorProcessor.d.ts +3 -6
- package/dist/processors/RefactorProcessor.js +70 -79
- package/dist/processors/ScenarioExecutionEndingProcessor.d.ts +4 -4
- package/dist/processors/ScenarioExecutionEndingProcessor.js +8 -11
- package/dist/processors/ScenarioExecutionStartingProcessor.d.ts +4 -4
- package/dist/processors/ScenarioExecutionStartingProcessor.js +8 -11
- package/dist/processors/SpecExecutionEndingProcessor.d.ts +4 -4
- package/dist/processors/SpecExecutionEndingProcessor.js +7 -9
- package/dist/processors/SpecExecutionStartingProcessor.d.ts +4 -4
- package/dist/processors/SpecExecutionStartingProcessor.js +7 -9
- package/dist/processors/StepExecutionEndingProcessor.d.ts +4 -4
- package/dist/processors/StepExecutionEndingProcessor.js +8 -11
- package/dist/processors/StepExecutionProcessor.d.ts +3 -2
- package/dist/processors/StepExecutionProcessor.js +42 -35
- package/dist/processors/StepExecutionStartingProcessor.d.ts +4 -4
- package/dist/processors/StepExecutionStartingProcessor.js +8 -11
- package/dist/processors/StepNameProcessor.d.ts +3 -4
- package/dist/processors/StepNameProcessor.js +22 -38
- package/dist/processors/StepPositionsProcessor.d.ts +4 -4
- package/dist/processors/StepPositionsProcessor.js +22 -34
- package/dist/processors/StubImplementationCodeProcessor.d.ts +3 -5
- package/dist/processors/StubImplementationCodeProcessor.js +42 -50
- package/dist/processors/ValidationProcessor.d.ts +3 -4
- package/dist/processors/ValidationProcessor.js +25 -47
- package/dist/public/Table.d.ts +20 -0
- package/dist/public/Table.js +65 -0
- package/dist/public/TableRow.d.ts +13 -0
- package/dist/public/TableRow.js +30 -0
- package/dist/public/context/Scenario.d.ts +1 -1
- package/dist/public/context/Specification.d.ts +1 -1
- package/dist/public/decorators.d.ts +12 -1
- package/dist/public/decorators.js +31 -13
- package/dist/screenshot/Screenshot.d.ts +5 -2
- package/dist/screenshot/Screenshot.js +33 -10
- package/dist/stores/DataStore.d.ts +6 -5
- package/dist/stores/DataStore.js +3 -0
- package/dist/stores/DataStoreFactory.d.ts +0 -3
- package/dist/stores/DataStoreFactory.js +12 -6
- package/dist/stores/GlobalDataStore.d.ts +8 -0
- package/dist/stores/GlobalDataStore.js +2 -0
- package/dist/stores/MessageStore.d.ts +1 -1
- package/dist/stores/MessageStore.js +2 -2
- package/dist/stores/ScreenshotStore.d.ts +3 -3
- package/dist/stores/ScreenshotStore.js +5 -5
- package/dist/utils/Util.d.ts +9 -6
- package/dist/utils/Util.js +19 -9
- package/package.json +26 -15
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -36
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/workflows/nodejs.yml +0 -88
- package/.github/workflows/release.yml +0 -99
- package/dist/connection/GRPCHandler.d.ts +0 -18
- package/dist/connection/GRPCHandler.js +0 -115
- package/dist/connection/GaugeConnection.d.ts +0 -12
- package/dist/connection/GaugeConnection.js +0 -40
- package/dist/connection/GaugeListener.d.ts +0 -6
- package/dist/connection/GaugeListener.js +0 -28
- package/dist/processors/DataStoreInitProcessor.d.ts +0 -5
- package/dist/processors/DataStoreInitProcessor.js +0 -41
- package/dist/processors/IMessageProcessor.d.ts +0 -4
- package/dist/processors/ImplementationFileGlobPatternProcessor.d.ts +0 -5
- package/dist/processors/ImplementationFileGlobPatternProcessor.js +0 -31
- package/dist/processors/ImplementationFileListProcessor.d.ts +0 -5
- package/dist/processors/ImplementationFileListProcessor.js +0 -27
- package/dist/processors/MessageProcessorFactory.d.ts +0 -13
- package/dist/processors/MessageProcessorFactory.js +0 -100
- package/dist/processors/StepNamesProcessor.d.ts +0 -5
- package/dist/processors/StepNamesProcessor.js +0 -27
- package/update_version.py +0 -33
package/dist/GaugeRuntime.d.ts
CHANGED
package/dist/GaugeRuntime.js
CHANGED
|
@@ -1,43 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const path_1 = require("path");
|
|
15
|
-
const GaugeListener_1 = require("./connection/GaugeListener");
|
|
16
|
-
const GRPCHandler_1 = require("./connection/GRPCHandler");
|
|
3
|
+
const grpc_js_1 = require("@grpc/grpc-js");
|
|
4
|
+
const services_grpc_pb_1 = require("./gen/services_grpc_pb");
|
|
17
5
|
const StaticLoader_1 = require("./loaders/StaticLoader");
|
|
18
|
-
const
|
|
6
|
+
const RunnerServiceImpl_1 = require("./RunnerServiceImpl");
|
|
19
7
|
class GaugeRuntime {
|
|
20
|
-
constructor() {
|
|
21
|
-
this.lspProtoPath = path_1.join(__dirname, 'gen', 'lsp.proto');
|
|
22
|
-
}
|
|
23
8
|
start() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var p = server.bind("127.0.0.1:0", grpc_1.ServerCredentials.createInsecure());
|
|
34
|
-
console.log("Listening on port:" + p);
|
|
35
|
-
server.start();
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
let listener = new GaugeListener_1.GaugeListener(factory);
|
|
39
|
-
listener.pollForMessages();
|
|
9
|
+
const loader = new StaticLoader_1.StaticLoader();
|
|
10
|
+
loader.loadImplementations();
|
|
11
|
+
const server = new grpc_js_1.Server();
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
server.addService(services_grpc_pb_1.RunnerService, new RunnerServiceImpl_1.RunnerServiceImpl(server, loader));
|
|
15
|
+
server.bindAsync("127.0.0.1:0", grpc_js_1.ServerCredentials.createInsecure(), (err, port) => {
|
|
16
|
+
if (err) {
|
|
17
|
+
throw err;
|
|
40
18
|
}
|
|
19
|
+
console.log(`Listening on port:${port}`);
|
|
20
|
+
server.start();
|
|
41
21
|
});
|
|
42
22
|
}
|
|
43
23
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { sendUnaryData as sUD, Server, ServerUnaryCall as SUC } from "@grpc/grpc-js";
|
|
2
|
+
import { CacheFileRequest, Empty, ExecuteStepRequest, ExecutionEndingRequest, ExecutionStartingRequest, ExecutionStatusResponse as ESR, FileDiff, ImplementationFileGlobPatternResponse as IFGPR, ImplementationFileListResponse as IFLR, KillProcessRequest, RefactorRequest, RefactorResponse, ScenarioDataStoreInitRequest as SCDSIR, ScenarioExecutionEndingRequest as SCEER, ScenarioExecutionStartingRequest as SCESR, SpecDataStoreInitRequest as SPDSIR, SpecExecutionEndingRequest as SPEER, SpecExecutionStartingRequest as SPESR, StepExecutionEndingRequest as STEER, StepExecutionStartingRequest as STESR, StepNameRequest, StepNameResponse, StepNamesRequest, StepNamesResponse, StepPositionsRequest, StepPositionsResponse, StepValidateRequest, StepValidateResponse, StubImplementationCodeRequest, SuiteDataStoreInitRequest } from "./gen/messages_pb";
|
|
3
|
+
import { IRunnerServer } from "./gen/services_grpc_pb";
|
|
4
|
+
import { StaticLoader } from "./loaders/StaticLoader";
|
|
5
|
+
export declare class RunnerServiceImpl implements IRunnerServer {
|
|
6
|
+
private readonly _server;
|
|
7
|
+
private readonly _loader;
|
|
8
|
+
private _stepValidateRequestProcessor;
|
|
9
|
+
private _stepNameRequestProcessor;
|
|
10
|
+
private _refactorRequestProcessor;
|
|
11
|
+
private _cacheFileRequestProcessor;
|
|
12
|
+
private _stubImplementationCodeRequestProcessor;
|
|
13
|
+
private _stepPositionsRequestProcessor;
|
|
14
|
+
private _executionStartingProcessor;
|
|
15
|
+
private _executionEndingProcessor;
|
|
16
|
+
private _specExecutionStartingProcessor;
|
|
17
|
+
private _specExecutionEndingProcessor;
|
|
18
|
+
private _scenarioExecutionStartingProcessor;
|
|
19
|
+
private _scenarioExecutionEndingProcessor;
|
|
20
|
+
private _stepExecutionStartingProcessor;
|
|
21
|
+
private _stepExecutionEndingProcessor;
|
|
22
|
+
private _executeStepProcessor;
|
|
23
|
+
constructor(server: Server, loader: StaticLoader);
|
|
24
|
+
validateStep(call: SUC<StepValidateRequest, StepValidateResponse>, callback: sUD<StepValidateResponse>): void;
|
|
25
|
+
initializeSuiteDataStore(call: SUC<SuiteDataStoreInitRequest, ESR>, callback: sUD<ESR>): void;
|
|
26
|
+
startExecution(call: SUC<ExecutionStartingRequest, ESR>, callback: sUD<ESR>): void;
|
|
27
|
+
initializeSpecDataStore(call: SUC<SPDSIR, ESR>, callback: sUD<ESR>): void;
|
|
28
|
+
startSpecExecution(call: SUC<SPESR, ESR>, callback: sUD<ESR>): void;
|
|
29
|
+
initializeScenarioDataStore(call: SUC<SCDSIR, ESR>, callback: sUD<ESR>): void;
|
|
30
|
+
startScenarioExecution(call: SUC<SCESR, ESR>, callback: sUD<ESR>): void;
|
|
31
|
+
startStepExecution(call: SUC<STESR, ESR>, callback: sUD<ESR>): void;
|
|
32
|
+
executeStep(call: SUC<ExecuteStepRequest, ESR>, callback: sUD<ESR>): void;
|
|
33
|
+
finishStepExecution(call: SUC<STEER, ESR>, callback: sUD<ESR>): void;
|
|
34
|
+
finishScenarioExecution(call: SUC<SCEER, ESR>, callback: sUD<ESR>): void;
|
|
35
|
+
finishSpecExecution(call: SUC<SPEER, ESR>, callback: sUD<ESR>): void;
|
|
36
|
+
finishExecution(call: SUC<ExecutionEndingRequest, ESR>, callback: sUD<ESR>): void;
|
|
37
|
+
cacheFile(call: SUC<CacheFileRequest, Empty>, callback: sUD<Empty>): void;
|
|
38
|
+
getStepName(call: SUC<StepNameRequest, StepNameResponse>, callback: sUD<StepNameResponse>): void;
|
|
39
|
+
getGlobPatterns(call: SUC<Empty, IFGPR>, callback: sUD<IFGPR>): void;
|
|
40
|
+
getStepNames(call: SUC<StepNamesRequest, StepNamesResponse>, callback: sUD<StepNamesResponse>): void;
|
|
41
|
+
getStepPositions(call: SUC<StepPositionsRequest, StepPositionsResponse>, callback: sUD<StepPositionsResponse>): void;
|
|
42
|
+
getImplementationFiles(call: SUC<Empty, IFLR>, callback: sUD<IFLR>): void;
|
|
43
|
+
implementStub(call: SUC<StubImplementationCodeRequest, FileDiff>, callback: sUD<FileDiff>): void;
|
|
44
|
+
refactor(call: SUC<RefactorRequest, RefactorResponse>, callback: sUD<RefactorResponse>): void;
|
|
45
|
+
kill(_call: SUC<KillProcessRequest, Empty>, callback: sUD<Empty>): void;
|
|
46
|
+
private createRpcError;
|
|
47
|
+
private getEmptExecutionResponse;
|
|
48
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constants_1 = require("@grpc/grpc-js/build/src/constants");
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const os_1 = require("os");
|
|
6
|
+
const _1 = require(".");
|
|
7
|
+
const messages_pb_1 = require("./gen/messages_pb");
|
|
8
|
+
const spec_pb_1 = require("./gen/spec_pb");
|
|
9
|
+
const ImplLoader_1 = require("./loaders/ImplLoader");
|
|
10
|
+
const StepRegistry_1 = require("./models/StepRegistry");
|
|
11
|
+
const CacheFileProcessor_1 = require("./processors/CacheFileProcessor");
|
|
12
|
+
const ExecutionEndingProcessor_1 = require("./processors/ExecutionEndingProcessor");
|
|
13
|
+
const ExecutionStartingProcessor_1 = require("./processors/ExecutionStartingProcessor");
|
|
14
|
+
const RefactorProcessor_1 = require("./processors/RefactorProcessor");
|
|
15
|
+
const ScenarioExecutionEndingProcessor_1 = require("./processors/ScenarioExecutionEndingProcessor");
|
|
16
|
+
const ScenarioExecutionStartingProcessor_1 = require("./processors/ScenarioExecutionStartingProcessor");
|
|
17
|
+
const SpecExecutionEndingProcessor_1 = require("./processors/SpecExecutionEndingProcessor");
|
|
18
|
+
const SpecExecutionStartingProcessor_1 = require("./processors/SpecExecutionStartingProcessor");
|
|
19
|
+
const StepExecutionEndingProcessor_1 = require("./processors/StepExecutionEndingProcessor");
|
|
20
|
+
const StepExecutionProcessor_1 = require("./processors/StepExecutionProcessor");
|
|
21
|
+
const StepExecutionStartingProcessor_1 = require("./processors/StepExecutionStartingProcessor");
|
|
22
|
+
const StepNameProcessor_1 = require("./processors/StepNameProcessor");
|
|
23
|
+
const StepPositionsProcessor_1 = require("./processors/StepPositionsProcessor");
|
|
24
|
+
const StubImplementationCodeProcessor_1 = require("./processors/StubImplementationCodeProcessor");
|
|
25
|
+
const ValidationProcessor_1 = require("./processors/ValidationProcessor");
|
|
26
|
+
const Util_1 = require("./utils/Util");
|
|
27
|
+
class RunnerServiceImpl {
|
|
28
|
+
constructor(server, loader) {
|
|
29
|
+
this._server = server;
|
|
30
|
+
this._loader = loader;
|
|
31
|
+
this._stepValidateRequestProcessor = new ValidationProcessor_1.ValidationProcessor();
|
|
32
|
+
this._stepNameRequestProcessor = new StepNameProcessor_1.StepNameProcessor();
|
|
33
|
+
this._refactorRequestProcessor = new RefactorProcessor_1.RefactorProcessor();
|
|
34
|
+
this._cacheFileRequestProcessor = new CacheFileProcessor_1.CacheFileProcessor(this._loader);
|
|
35
|
+
this._stubImplementationCodeRequestProcessor = new StubImplementationCodeProcessor_1.StubImplementationCodeProcessor();
|
|
36
|
+
this._stepPositionsRequestProcessor = new StepPositionsProcessor_1.StepPositionsProcessor();
|
|
37
|
+
this._executionStartingProcessor = new ExecutionStartingProcessor_1.ExecutionStartingProcessor();
|
|
38
|
+
this._executionEndingProcessor = new ExecutionEndingProcessor_1.ExecutionEndingProcessor();
|
|
39
|
+
this._specExecutionStartingProcessor = new SpecExecutionStartingProcessor_1.SpecExecutionStartingProcessor();
|
|
40
|
+
this._specExecutionEndingProcessor = new SpecExecutionEndingProcessor_1.SpecExecutionEndingProcessor();
|
|
41
|
+
this._scenarioExecutionStartingProcessor = new ScenarioExecutionStartingProcessor_1.ScenarioExecutionStartingProcessor();
|
|
42
|
+
this._scenarioExecutionEndingProcessor = new ScenarioExecutionEndingProcessor_1.ScenarioExecutionEndingProcessor();
|
|
43
|
+
this._stepExecutionStartingProcessor = new StepExecutionStartingProcessor_1.StepExecutionStartingProcessor();
|
|
44
|
+
this._stepExecutionEndingProcessor = new StepExecutionEndingProcessor_1.StepExecutionEndingProcessor();
|
|
45
|
+
this._executeStepProcessor = new StepExecutionProcessor_1.StepExecutionProcessor();
|
|
46
|
+
}
|
|
47
|
+
validateStep(call, callback) {
|
|
48
|
+
try {
|
|
49
|
+
callback(null, this._stepValidateRequestProcessor.process(call.request));
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
callback(this.createRpcError(error), null);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
initializeSuiteDataStore(call, callback) {
|
|
56
|
+
try {
|
|
57
|
+
_1.DataStoreFactory.getSuiteDataStore().clear();
|
|
58
|
+
const loader = new ImplLoader_1.ImplLoader();
|
|
59
|
+
loader.loadImplementations()
|
|
60
|
+
.then(() => callback(null, this.getEmptExecutionResponse()))
|
|
61
|
+
.catch((err) => {
|
|
62
|
+
callback(this.createRpcError(err), null);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
callback(this.createRpcError(error), null);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
startExecution(call, callback) {
|
|
70
|
+
this._executionStartingProcessor.process(call.request)
|
|
71
|
+
.then((res) => callback(null, res))
|
|
72
|
+
.catch((error) => callback(this.createRpcError(error), null));
|
|
73
|
+
}
|
|
74
|
+
initializeSpecDataStore(call, callback) {
|
|
75
|
+
try {
|
|
76
|
+
_1.DataStoreFactory.getSpecDataStore().clear();
|
|
77
|
+
callback(null, this.getEmptExecutionResponse());
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
callback(this.createRpcError(error), null);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
startSpecExecution(call, callback) {
|
|
84
|
+
this._specExecutionStartingProcessor.process(call.request)
|
|
85
|
+
.then((res) => callback(null, res))
|
|
86
|
+
.catch((error) => callback(this.createRpcError(error), null));
|
|
87
|
+
}
|
|
88
|
+
initializeScenarioDataStore(call, callback) {
|
|
89
|
+
try {
|
|
90
|
+
_1.DataStoreFactory.getScenarioDataStore().clear();
|
|
91
|
+
callback(null, this.getEmptExecutionResponse());
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
callback(this.createRpcError(error), null);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
startScenarioExecution(call, callback) {
|
|
98
|
+
this._scenarioExecutionStartingProcessor.process(call.request)
|
|
99
|
+
.then((res) => callback(null, res))
|
|
100
|
+
.catch((error) => callback(this.createRpcError(error), null));
|
|
101
|
+
}
|
|
102
|
+
startStepExecution(call, callback) {
|
|
103
|
+
this._stepExecutionStartingProcessor.process(call.request)
|
|
104
|
+
.then((res) => callback(null, res))
|
|
105
|
+
.catch((error) => callback(this.createRpcError(error), null));
|
|
106
|
+
}
|
|
107
|
+
executeStep(call, callback) {
|
|
108
|
+
this._executeStepProcessor.process(call.request)
|
|
109
|
+
.then((res) => callback(null, res))
|
|
110
|
+
.catch((error) => callback(this.createRpcError(error), null));
|
|
111
|
+
}
|
|
112
|
+
finishStepExecution(call, callback) {
|
|
113
|
+
this._stepExecutionEndingProcessor.process(call.request)
|
|
114
|
+
.then((res) => callback(null, res))
|
|
115
|
+
.catch((error) => callback(this.createRpcError(error), null));
|
|
116
|
+
}
|
|
117
|
+
finishScenarioExecution(call, callback) {
|
|
118
|
+
this._scenarioExecutionEndingProcessor.process(call.request)
|
|
119
|
+
.then((res) => callback(null, res))
|
|
120
|
+
.catch((error) => callback(this.createRpcError(error), null));
|
|
121
|
+
}
|
|
122
|
+
finishSpecExecution(call, callback) {
|
|
123
|
+
this._specExecutionEndingProcessor.process(call.request)
|
|
124
|
+
.then((res) => callback(null, res))
|
|
125
|
+
.catch((error) => callback(this.createRpcError(error), null));
|
|
126
|
+
}
|
|
127
|
+
finishExecution(call, callback) {
|
|
128
|
+
this._executionEndingProcessor.process(call.request)
|
|
129
|
+
.then((res) => callback(null, res))
|
|
130
|
+
.catch((error) => callback(this.createRpcError(error), null));
|
|
131
|
+
}
|
|
132
|
+
cacheFile(call, callback) {
|
|
133
|
+
try {
|
|
134
|
+
this._cacheFileRequestProcessor.process(call.request);
|
|
135
|
+
callback(null, new messages_pb_1.Empty());
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
callback(this.createRpcError(error), null);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
getStepName(call, callback) {
|
|
142
|
+
try {
|
|
143
|
+
callback(null, this._stepNameRequestProcessor.process(call.request));
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
callback(this.createRpcError(error), null);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
getGlobPatterns(call, callback) {
|
|
150
|
+
try {
|
|
151
|
+
const patterns = Util_1.Util.getImplDirs().map((dir) => {
|
|
152
|
+
return dir.split(path_1.sep).concat(['**', '*.ts']).join('/');
|
|
153
|
+
});
|
|
154
|
+
const res = new messages_pb_1.ImplementationFileGlobPatternResponse();
|
|
155
|
+
res.setGlobpatternsList(patterns);
|
|
156
|
+
callback(null, res);
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
callback(this.createRpcError(error), null);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
getStepNames(call, callback) {
|
|
163
|
+
try {
|
|
164
|
+
const res = new messages_pb_1.StepNamesResponse();
|
|
165
|
+
res.setStepsList(StepRegistry_1.default.getStepTexts());
|
|
166
|
+
callback(null, res);
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
callback(this.createRpcError(error), null);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
getStepPositions(call, callback) {
|
|
173
|
+
try {
|
|
174
|
+
callback(null, this._stepPositionsRequestProcessor.process(call.request));
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
callback(this.createRpcError(error), null);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
getImplementationFiles(call, callback) {
|
|
181
|
+
try {
|
|
182
|
+
const res = new messages_pb_1.ImplementationFileListResponse();
|
|
183
|
+
res.setImplementationfilepathsList(Util_1.Util.getListOfFiles());
|
|
184
|
+
callback(null, res);
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
callback(this.createRpcError(error), null);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
implementStub(call, callback) {
|
|
191
|
+
try {
|
|
192
|
+
callback(null, this._stubImplementationCodeRequestProcessor.process(call.request));
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
callback(this.createRpcError(error), null);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
refactor(call, callback) {
|
|
199
|
+
try {
|
|
200
|
+
callback(null, this._refactorRequestProcessor.process(call.request));
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
callback(this.createRpcError(error), null);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
kill(_call, callback) {
|
|
207
|
+
callback(null, new messages_pb_1.Empty());
|
|
208
|
+
setTimeout(() => {
|
|
209
|
+
this._server && this._server.forceShutdown();
|
|
210
|
+
process.exit(0);
|
|
211
|
+
}, 100);
|
|
212
|
+
}
|
|
213
|
+
createRpcError(error) {
|
|
214
|
+
var _a, _b;
|
|
215
|
+
return { code: constants_1.Status.INTERNAL, message: error.message, stack: (_a = error.stack) !== null && _a !== void 0 ? _a : '', details: `${error.message}${os_1.EOL}${(_b = error.stack) !== null && _b !== void 0 ? _b : ''}` };
|
|
216
|
+
}
|
|
217
|
+
getEmptExecutionResponse() {
|
|
218
|
+
const res = new messages_pb_1.ExecutionStatusResponse();
|
|
219
|
+
const result = new spec_pb_1.ProtoExecutionResult();
|
|
220
|
+
result.setFailed(false);
|
|
221
|
+
res.setExecutionresult(result);
|
|
222
|
+
return res;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
exports.RunnerServiceImpl = RunnerServiceImpl;
|