Skip to content

Commit

Permalink
skip length check for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gagik committed Dec 6, 2024
1 parent 32a4c52 commit 081be7c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/test/suite/participant/participant.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ import {
import EditDocumentCodeLensProvider from '../../../editors/editDocumentCodeLensProvider';
import PlaygroundResultProvider from '../../../editors/playgroundResultProvider';
import { CollectionTreeItem, DatabaseTreeItem } from '../../../explorer';
import type { SendMessageToParticipantOptions } from '../../../participant/participantTypes';
import type {
ParticipantRequestType,
SendMessageToParticipantOptions,
} from '../../../participant/participantTypes';
import { DocumentSource } from '../../../documentSource';

// The Copilot's model in not available in tests,
Expand Down Expand Up @@ -121,7 +124,7 @@ suite('Participant Controller Test Suite', function () {
);

const assertCommandTelemetry = (
command: string,
command: ParticipantRequestType,
chatRequest: vscode.ChatRequest,
{
expectSampleDocs = false,
Expand All @@ -144,10 +147,13 @@ suite('Participant Controller Test Suite', function () {
expect(properties.has_sample_documents).to.equal(expectSampleDocs);
expect(properties.history_size).to.equal(chatContextStub.history.length);

// Total message length includes participant as well as user prompt
expect(properties.total_message_length).to.be.greaterThan(
properties.user_input_length
);
/** For docs chatbot requests, the length of the prompt would be longer as it gets the prompt history prepended.*/
if (command !== 'docs') {
// Total message length includes participant as well as user prompt
expect(properties.total_message_length).to.be.greaterThan(
properties.user_input_length
);
}

// User prompt length should be at least equal to the supplied user prompt, but my occasionally
// be greater - e.g. when we enhance the context.
Expand Down

0 comments on commit 081be7c

Please sign in to comment.