Skip to content

Commit 83a8314

Browse files
committed
Fix usage API docs test
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.
1 parent 3ab612f commit 83a8314

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

docs/reference/rest-api/usage.asciidoc

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,8 @@ GET /_xpack/usage
207207
"inference": {
208208
"available" : true,
209209
"enabled" : true,
210-
"models" : [{
211-
"service": "elasticsearch",
212-
"task_type": "SPARSE_EMBEDDING",
213-
"count": 1
214-
},
215-
{
216-
"service": "elasticsearch",
217-
"task_type": "TEXT_EMBEDDING",
218-
"count": 1
219-
},
210+
"models" : [
211+
...
220212
]
221213
},
222214
"logstash" : {
@@ -523,7 +515,10 @@ GET /_xpack/usage
523515
"available": true,
524516
"enabled": false,
525517
"indices_count": 0,
526-
"indices_with_synthetic_source": 0
518+
"indices_with_synthetic_source": 0,
519+
"num_docs": 0,
520+
"size_in_bytes": 0,
521+
"has_custom_cutoff_date": false
527522
}
528523
}
529524
------------------------------------------------------------
@@ -535,6 +530,7 @@ GET /_xpack/usage
535530
// TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
536531
// TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
537532
// TESTRESPONSE[s/"health_api" : \{[^\}]*\}\s*\}/"health_api" : $body.$_path/]
533+
// TESTRESPONSE[s/"models" : \[[^\]]*\]/"models" : $body.$_path/]
538534
// TESTRESPONSE[s/"data_streams" : \{[^\}]*\},/"data_streams" : $body.$_path,/]
539535
// TESTRESPONSE[s/ : true/ : $body.$_path/]
540536
// TESTRESPONSE[s/ : false/ : $body.$_path/]
@@ -551,4 +547,5 @@ GET /_xpack/usage
551547
// 5. All of the numbers and strings on the right hand side of *every* field in
552548
// the response are ignored. So we're really only asserting things about the
553549
// the shape of this response, not the values in it.
554-
// 6. Ignore the contents of data streams until the failure store is tech preview.
550+
// 6. Ignore the contents of the `inference.models` array because the models might not yet have been initialized
551+
// 7. Ignore the contents of data streams until the failure store is tech preview.

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ tests:
6464
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
6565
method: testPutE5Small_withPlatformSpecificVariant
6666
issue: https://github.com/elastic/elasticsearch/issues/113950
67-
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
68-
method: test {yaml=reference/rest-api/usage/line_38}
69-
issue: https://github.com/elastic/elasticsearch/issues/113694
7067
- class: org.elasticsearch.xpack.remotecluster.RemoteClusterSecurityWithApmTracingRestIT
7168
method: testTracingCrossCluster
7269
issue: https://github.com/elastic/elasticsearch/issues/112731

0 commit comments

Comments
 (0)