Skip to content

Commit

Permalink
Merge pull request #254 from ringcentral/WAT-4303
Browse files Browse the repository at this point in the history
WAT-4303
  • Loading branch information
ArtMathArt authored Jan 22, 2025
2 parents 74470de + e884be1 commit af96aa9
Show file tree
Hide file tree
Showing 8 changed files with 3,535 additions and 1,315 deletions.
1 change: 0 additions & 1 deletion core/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"dependencies": {
"@testring/browser-proxy": "0.7.0",
"@testring/cli-config": "0.7.0",
"@testring/devtool-backend": "0.7.0",
"@testring/fs-reader": "0.7.0",
"@testring/fs-store": "0.7.0",
"@testring/http-api": "0.7.0",
Expand Down
28 changes: 2 additions & 26 deletions core/cli/src/commands/runCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
BrowserProxyController,
} from '@testring/browser-proxy';
import {ICLICommand, IConfig, ITransport} from '@testring/types';
import {DevtoolServerController} from '@testring/devtool-backend';

import {FSStoreServer} from '@testring/fs-store';

Expand All @@ -23,7 +22,6 @@ class RunCommand implements ICLICommand {
private browserProxyController: BrowserProxyController;
private testRunController: TestRunController;
private httpServer: HttpServer;
private devtoolServerController: DevtoolServerController;

private fsStoreServer: FSStoreServer;

Expand Down Expand Up @@ -61,14 +59,9 @@ class RunCommand implements ICLICommand {
}

async execute() {
const devtoolEnabled = this.config.devtool;

if (devtoolEnabled) {
this.devtoolServerController = await this.initDevtoolServer();
}

const testWorker = new TestWorker(this.transport, {
waitForRelease: devtoolEnabled,
waitForRelease: false,
localWorker: this.config.workerLimit === 'local',
screenshots: this.config.screenshots,
});
Expand All @@ -81,9 +74,7 @@ class RunCommand implements ICLICommand {
this.testRunController = new TestRunController(
this.config,
testWorker,
this.devtoolServerController
? this.devtoolServerController.getRuntimeConfiguration()
: null,
null,
);

this.webApplicationController = new WebApplicationController(
Expand Down Expand Up @@ -111,7 +102,6 @@ class RunCommand implements ICLICommand {
testRunController: this.testRunController,
httpClientInstance: httpClient,
httpServer: this.httpServer,
devtool: this.devtoolServerController,
},
this.config,
);
Expand Down Expand Up @@ -147,29 +137,16 @@ class RunCommand implements ICLICommand {
}
}

async initDevtoolServer() {
this.logger.info('Recorder Server is enabled');

const devtoolServerController = new DevtoolServerController(
this.transport,
);
await devtoolServerController.init();

return devtoolServerController;
}

async shutdown() {
const httpServer = this.httpServer;
const testRunController = this.testRunController;
const browserProxyController = this.browserProxyController;
const webApplicationController = this.webApplicationController;
const devtoolServer = this.devtoolServerController;

this.httpServer = null as any;
this.testRunController = null as any;
this.browserProxyController = null as any;
this.webApplicationController = null as any;
this.devtoolServerController = null as any;

this.fsWriterQueueServer && this.fsWriterQueueServer.cleanUpTransport();
this.fsWriterQueueServer = null as any;
Expand All @@ -178,7 +155,6 @@ class RunCommand implements ICLICommand {
webApplicationController && webApplicationController.kill();
testRunController && (await testRunController.kill());
browserProxyController && (await browserProxyController.kill());
devtoolServer && (await devtoolServer.kill());
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ createField('envConfig', {
});

createField('devtool', {
describe: 'Passed to enable recorder/debug server',
describe: 'Passed to enable recorder/debug server - deprecated',
type: 'boolean',
});

Expand Down
5 changes: 0 additions & 5 deletions core/plugin-api/src/plugin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {FSReaderAPI} from './modules/fs-reader';
import {LoggerAPI} from './modules/logger';
import {TestWorkerAPI} from './modules/test-worker';
import {TestRunControllerAPI} from './modules/test-run-controller';
import {DevtoolAPI} from './modules/devtool';
import {HttpServerAPI} from './modules/http-server';
import {FSStoreServerAPI} from './modules/fs-store-server';

Expand Down Expand Up @@ -46,10 +45,6 @@ export class PluginAPI {
return this.modules.httpClientInstance;
}

getDevtool(): DevtoolAPI {
return new DevtoolAPI(this.pluginName, this.modules.devtool);
}

getFSStoreServer(): FSStoreServerAPI {
return new FSStoreServerAPI(
this.pluginName,
Expand Down
2 changes: 0 additions & 2 deletions core/types/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {IPluggableModule} from './pluggable-module';
import {IBrowserProxyController} from './browser-proxy';
import {IHttpClient} from './http-api';
import {
IDevtoolServerController,
IHttpServerController,
} from './devtool-backend';

Expand All @@ -22,6 +21,5 @@ export interface IPluginModules {
browserProxy: IBrowserProxyController & IPluggableModule;
httpClientInstance: IHttpClient;
httpServer: IHttpServerController & IPluggableModule;
devtool: IDevtoolServerController & IPluggableModule;
fsStoreServer: IPluggableModule;
}
Loading

0 comments on commit af96aa9

Please sign in to comment.