Skip to content

Commit

Permalink
chore: delete embedded trace viewer (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt authored Nov 18, 2024
1 parent fa70d66 commit facbc06
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 875 deletions.
19 changes: 2 additions & 17 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,7 @@ export default defineConfig<WorkerOptions>({
{
name: 'default-trace',
use: {
showTrace: 'spawn',
}
},
{
name: 'default-trace-embedded',
testMatch: '*trace-viewer*.spec.ts',
use: {
showTrace: 'embedded',
showTrace: true,
}
},
{
Expand All @@ -68,15 +61,7 @@ export default defineConfig<WorkerOptions>({
name: 'legacy-trace',
use: {
overridePlaywrightVersion: 1.43,
showTrace: 'spawn',
}
},
{
name: 'legacy-trace-embedded',
testMatch: '*trace-viewer*.spec.ts',
use: {
overridePlaywrightVersion: 1.43,
showTrace: 'embedded',
showTrace: true,
}
},
]
Expand Down
280 changes: 0 additions & 280 deletions src/embeddedTraceViewer.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class Extension implements RunHooks {
},
});

this._settingsModel = new SettingsModel(vscode, this._isUnderTest, context);
this._settingsModel = new SettingsModel(vscode, context);
this._reusedBrowser = new ReusedBrowser(this._vscode, this._settingsModel, this._envProvider.bind(this));
this._debugHighlight = new DebugHighlight(vscode, this._reusedBrowser);
this._models = new TestModelCollection(vscode, {
Expand Down
31 changes: 5 additions & 26 deletions src/playwrightTestServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class PlaywrightTestServer {
private _options: PlaywrightTestOptions;
private _model: TestModel;
private _testServerPromise: Promise<TestServerConnection | null> | undefined;
private _serverUrlPrefix?: string;

constructor(vscode: vscodeTypes.VSCode, model: TestModel, options: PlaywrightTestOptions) {
this._vscode = vscode;
Expand All @@ -44,12 +43,6 @@ export class PlaywrightTestServer {
this._disposeTestServer();
}

async ensureStartedForTraceViewer() {
// ensure test server is running
await this._testServer();
return this._serverUrlPrefix;
}

async listFiles(): Promise<ConfigListFilesReport> {
const testServer = await this._testServer();
if (!testServer)
Expand Down Expand Up @@ -386,27 +379,13 @@ export class PlaywrightTestServer {
return null;
const testServer = new TestServerConnection(wsEndpoint);
testServer.onTestFilesChanged(params => this._testFilesChanged(params.testFiles));
const [serverUrlPrefix] = await Promise.all([
this._computeServerUrlPrefix(wsEndpoint),
testServer.initialize({
serializer: require.resolve('./oopReporter'),
interceptStdio: true,
closeOnDisconnect: true,
}),
]);
this._serverUrlPrefix = serverUrlPrefix;
await testServer.initialize({
serializer: require.resolve('./oopReporter'),
interceptStdio: true,
closeOnDisconnect: true,
});
return testServer;
}

private async _computeServerUrlPrefix(wsEndpoint: string) {
const serverUrl = new URL(wsEndpoint);
serverUrl.protocol = serverUrl.protocol === 'wss' ? 'https' : 'http';
if (this._vscode.env.remoteName && ['[::1]', '0.0.0.0'].includes(serverUrl.hostname))
serverUrl.hostname = 'localhost';
const serverUri = await this._vscode.env.asExternalUri(this._vscode.Uri.parse(serverUrl.origin));
return serverUri.toString().replace(/\/$/, '');
}

private async _wireTestServer(testServer: TestServerConnection, reporter: reporterTypes.ReporterV2, token: vscodeTypes.CancellationToken) {
const teleReceiver = new TeleReporterReceiver(reporter, {
mergeProjects: true,
Expand Down
Loading

0 comments on commit facbc06

Please sign in to comment.