Skip to content

Commit

Permalink
Fix usage API docs test (#119192)
Browse files Browse the repository at this point in the history
This ensures the usage API docs tests are passing again. We achieve this
by: 1. ignoring the contents of `inference.models` because the models
might not yet have been initialized and 2. adding missing fields to the
`logsdb` usage.
  • Loading branch information
nielsbauman authored Dec 23, 2024
1 parent e96ce80 commit dac3bfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
21 changes: 9 additions & 12 deletions docs/reference/rest-api/usage.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,8 @@ GET /_xpack/usage
"inference": {
"available" : true,
"enabled" : true,
"models" : [{
"service": "elasticsearch",
"task_type": "SPARSE_EMBEDDING",
"count": 1
},
{
"service": "elasticsearch",
"task_type": "TEXT_EMBEDDING",
"count": 1
},
"models" : [
...
]
},
"logstash" : {
Expand Down Expand Up @@ -523,7 +515,10 @@ GET /_xpack/usage
"available": true,
"enabled": false,
"indices_count": 0,
"indices_with_synthetic_source": 0
"indices_with_synthetic_source": 0,
"num_docs": 0,
"size_in_bytes": 0,
"has_custom_cutoff_date": false
}
}
------------------------------------------------------------
Expand All @@ -535,6 +530,7 @@ GET /_xpack/usage
// TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
// TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
// TESTRESPONSE[s/"health_api" : \{[^\}]*\}\s*\}/"health_api" : $body.$_path/]
// TESTRESPONSE[s/"models" : \[[^\]]*\]/"models" : $body.$_path/]
// TESTRESPONSE[s/"data_streams" : \{[^\}]*\},/"data_streams" : $body.$_path,/]
// TESTRESPONSE[s/ : true/ : $body.$_path/]
// TESTRESPONSE[s/ : false/ : $body.$_path/]
Expand All @@ -551,4 +547,5 @@ GET /_xpack/usage
// 5. All of the numbers and strings on the right hand side of *every* field in
// the response are ignored. So we're really only asserting things about the
// the shape of this response, not the values in it.
// 6. Ignore the contents of data streams until the failure store is tech preview.
// 6. Ignore the contents of the `inference.models` array because the models might not yet have been initialized
// 7. Ignore the contents of data streams until the failure store is tech preview.
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ tests:
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
method: testPutE5Small_withPlatformSpecificVariant
issue: https://github.com/elastic/elasticsearch/issues/113950
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
method: test {yaml=reference/rest-api/usage/line_38}
issue: https://github.com/elastic/elasticsearch/issues/113694
- class: org.elasticsearch.xpack.remotecluster.RemoteClusterSecurityWithApmTracingRestIT
method: testTracingCrossCluster
issue: https://github.com/elastic/elasticsearch/issues/112731
Expand Down

0 comments on commit dac3bfd

Please sign in to comment.