Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enlarge max test steps limit #117

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/editors/TestGenerationPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import { fetchApps } from '../api/llm/http';

const MAX_HISTORY_LEN = 100;
const MAX_TEST_STEPS = 40;

export class TestGenerationPanel {
public static currentPanel: TestGenerationPanel | undefined;
Expand Down Expand Up @@ -281,7 +282,7 @@
*/
private _setWebviewMessageListener(webview: Webview) {
webview.onDidReceiveMessage(
async (message: any) => {

Check warning on line 285 in src/editors/TestGenerationPanel.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type

Check warning on line 285 in src/editors/TestGenerationPanel.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
switch (message.action) {
case 'ready':
this._msgQueue.ready();
Expand Down Expand Up @@ -525,9 +526,9 @@
);
}

if (maxTestSteps < 1 || maxTestSteps > 20) {
if (maxTestSteps < 1 || maxTestSteps > MAX_TEST_STEPS) {
throw new Error(
'Invalid number of test steps. Please enter a value between 1 and 20.',
`Invalid number of test steps. Please enter a value between 1 and ${MAX_TEST_STEPS}.`,
);
}

Expand Down Expand Up @@ -595,7 +596,7 @@
}

class MessageQueue {
private _messages: any[];

Check warning on line 599 in src/editors/TestGenerationPanel.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type

Check warning on line 599 in src/editors/TestGenerationPanel.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
private _ready: boolean;
private _webview: Webview;

Expand All @@ -605,7 +606,7 @@
this._webview = webview;
}

enqueue(msg: any) {

Check warning on line 609 in src/editors/TestGenerationPanel.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type

Check warning on line 609 in src/editors/TestGenerationPanel.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
if (!this._ready) {
this._messages.push(msg);
return;
Expand Down
Loading