Skip to content

Conversation

@arturoliduena
Copy link
Contributor

@arturoliduena arturoliduena commented Mar 7, 2025

Closes #213209

Ordering Issue

  • The instruction about retrieve_elastic_doc appears before the get_dataset_info instruction.
  • The content is the same, but the order of instructions has changed, causing a failure in an exact string match.

Minor Formatting Differences

  • Even slight variations in spacing, newlines, or indentations can cause a test failure.

Solution

Update the test assertion to check for content inclusion rather than exact string equality. order of the instructions doesn’t matter

@arturoliduena arturoliduena added release_note:fix v9.0.0 Team:Obs AI Assistant Observability AI Assistant backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Mar 7, 2025
@arturoliduena arturoliduena requested a review from a team as a code owner March 7, 2025 10:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sorenlouv added a function to sort the system message:

function sortSystemMessage(message: string) {
return message
.split('\n\n')
.map((line) => line.trim())
.sort();
}

Will that help here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @viduni94, I've moved sortSystemMessage to a helpers file and updated the complete test to use it

…PI Integration Tests.x-pack/test/api_integration/deployment_agnostic/apis/observability/ai_assistant/complete/complete·spec·ts
@arturoliduena arturoliduena force-pushed the fix-failing-test-Deployment-agnostic-API-Integration-obs-ai-assistant-chat-complete branch from fc1d200 to 066ed68 Compare March 7, 2025 14:10
@arturoliduena arturoliduena enabled auto-merge (squash) March 7, 2025 14:12
@arturoliduena arturoliduena merged commit 5d0e0f4 into elastic:main Mar 7, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 7, 2025
elastic#213530)

Closes [elastic#213209](elastic#213209)

### Ordering Issue
- The instruction about `retrieve_elastic_doc` appears before the
`get_dataset_info` instruction.
- The content is the same, but the order of instructions has changed,
causing a failure in an exact string match.
### Minor Formatting Differences
- Even slight variations in spacing, newlines, or indentations can cause
a test failure.

## Solution
use `systemMessageSorted` - order of instructions can vary, so we sort to compare them

(cherry picked from commit 5d0e0f4)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 7, 2025
elastic#213530)

Closes [elastic#213209](elastic#213209)

### Ordering Issue
- The instruction about `retrieve_elastic_doc` appears before the
`get_dataset_info` instruction.
- The content is the same, but the order of instructions has changed,
causing a failure in an exact string match.
### Minor Formatting Differences
- Even slight variations in spacing, newlines, or indentations can cause
a test failure.

## Solution
use `systemMessageSorted` - order of instructions can vary, so we sort to compare them

(cherry picked from commit 5d0e0f4)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Mar 7, 2025
…stic A… (#213530) (#213603)

# Backport

This will backport the following commits from `main` to `9.0`:
- [Fixing - Failing test: Stateful Observability - Deployment-agnostic
A… (#213530)](#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…
(#213530)\n\nCloses
[#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…
(#213530)\n\nCloses
[#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…
(#213530)\n\nCloses
[#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]>
kibanamachine added a commit that referenced this pull request Mar 7, 2025
…stic A… (#213530) (#213601)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Fixing - Failing test: Stateful Observability - Deployment-agnostic
A… (#213530)](#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…
(#213530)\n\nCloses
[#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…
(#213530)\n\nCloses
[#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…
(#213530)\n\nCloses
[#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]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
elastic#213530)

Closes [elastic#213209](elastic#213209)

### Ordering Issue
- The instruction about `retrieve_elastic_doc` appears before the
`get_dataset_info` instruction.
- The content is the same, but the order of instructions has changed,
causing a failure in an exact string match.
### Minor Formatting Differences
- Even slight variations in spacing, newlines, or indentations can cause
a test failure.

## Solution
use `systemMessageSorted` - order of instructions can vary, so we sort to compare them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment