Skip to content

Commit 91dcae5

Browse files
[9.0] Fixing - Failing test: Stateful Observability - Deployment-agnostic A… (elastic#213530) (elastic#213603)
# Backport This will backport the following commits from `main` to `9.0`: - [Fixing - Failing test: Stateful Observability - Deployment-agnostic A… (elastic#213530)](elastic#213530) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Arturo Lidueña","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-03-07T16:10:09Z","message":"Fixing - Failing test: Stateful Observability - Deployment-agnostic A… (elastic#213530)\n\nCloses [elastic#213209](https://github.com/elastic/kibana/issues/213209)\n\n### Ordering Issue\n- The instruction about `retrieve_elastic_doc` appears before the\n`get_dataset_info` instruction.\n- The content is the same, but the order of instructions has changed,\ncausing a failure in an exact string match.\n### Minor Formatting Differences\n- Even slight variations in spacing, newlines, or indentations can cause\na test failure.\n\n## Solution\nuse `systemMessageSorted` - order of instructions can vary, so we sort to compare them","sha":"5d0e0f48adc176d95a223116e1767eedf324740b","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Obs AI Assistant","backport:version","v9.1.0","v8.19.0"],"title":"Fixing - Failing test: Stateful Observability - Deployment-agnostic A…","number":213530,"url":"https://github.com/elastic/kibana/pull/213530","mergeCommit":{"message":"Fixing - Failing test: Stateful Observability - Deployment-agnostic A… (elastic#213530)\n\nCloses [elastic#213209](https://github.com/elastic/kibana/issues/213209)\n\n### Ordering Issue\n- The instruction about `retrieve_elastic_doc` appears before the\n`get_dataset_info` instruction.\n- The content is the same, but the order of instructions has changed,\ncausing a failure in an exact string match.\n### Minor Formatting Differences\n- Even slight variations in spacing, newlines, or indentations can cause\na test failure.\n\n## Solution\nuse `systemMessageSorted` - order of instructions can vary, so we sort to compare them","sha":"5d0e0f48adc176d95a223116e1767eedf324740b"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213530","number":213530,"mergeCommit":{"message":"Fixing - Failing test: Stateful Observability - Deployment-agnostic A… (elastic#213530)\n\nCloses [elastic#213209](https://github.com/elastic/kibana/issues/213209)\n\n### Ordering Issue\n- The instruction about `retrieve_elastic_doc` appears before the\n`get_dataset_info` instruction.\n- The content is the same, but the order of instructions has changed,\ncausing a failure in an exact string match.\n### Minor Formatting Differences\n- Even slight variations in spacing, newlines, or indentations can cause\na test failure.\n\n## Solution\nuse `systemMessageSorted` - order of instructions can vary, so we sort to compare them","sha":"5d0e0f48adc176d95a223116e1767eedf324740b"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Arturo Lidueña <[email protected]>
1 parent aa224bb commit 91dcae5

File tree

1 file changed

+4
-1
lines changed
  • x-pack/test/api_integration/deployment_agnostic/apis/observability/ai_assistant/complete

1 file changed

+4
-1
lines changed

x-pack/test/api_integration/deployment_agnostic/apis/observability/ai_assistant/complete/complete.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { decodeEvents, getConversationCreatedEvent } from '../helpers';
2626
import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context';
2727
import { SupertestWithRoleScope } from '../../../../services/role_scoped_supertest';
2828
import { clearConversations } from '../knowledge_base/helpers';
29+
import { systemMessageSorted } from './functions/helpers';
2930

3031
export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) {
3132
const log = getService('log');
@@ -247,7 +248,9 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon
247248
const simulator = await simulatorPromise;
248249
const requestData = simulator.requestBody;
249250
expect(requestData.messages[0].role).to.eql('system');
250-
expect(requestData.messages[0].content).to.eql(systemMessage);
251+
expect(systemMessageSorted(requestData.messages[0].content as string)).to.eql(
252+
systemMessageSorted(systemMessage)
253+
);
251254
});
252255
});
253256

0 commit comments

Comments
 (0)