Skip to content

Commit 185a26c

Browse files
committed
Refactors report
I changed the way things are displayed to have more granular information on what's Serverless, what's Stack, and where they're coming from. We now have a list of Stack and Serverless APIs and which ones are being tested. I also added the difference between the APIs in the Elasticsearch JSON spec that are not in the elasticsearch-specification.
1 parent d161cda commit 185a26c

File tree

2 files changed

+40
-9
lines changed

2 files changed

+40
-9
lines changed

report/reporter.rb

+15
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ def specification_apis
3131
reject_internal(apis)
3232
end
3333

34+
def stack_apis
35+
@apis[:specification].select do |api|
36+
api.dig('availability').nil? ||
37+
api.dig('availability', 'stack', 'visibility') != 'private'
38+
end
39+
end
40+
3441
def serverless_apis
3542
# The absence of an 'availability' field on a property implies that the property is
3643
# available in all flavors.
@@ -61,6 +68,14 @@ def coverage_stack
6168
@tested.count * 100 / @apis[:json].count
6269
end
6370

71+
def display_endpoint(api)
72+
if (test = find_test(api))
73+
"- [x]<span title='tested'> [#{api}](#{test[:file]})</span>"
74+
else
75+
"- [ ]<span title='not tested'> #{api}</span>"
76+
end
77+
end
78+
6479
private
6580

6681
def find_test(endpoint)

report/template.erb

+25-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11
# Tests report
22

3-
* Endpoints in JSON spec: <%= @reporter.apis[:json].count %>
4-
* Endpoints in elasticsearch-specification: <%= @reporter.apis[:specification].count %>
5-
* Endpoints in Serverless: <%= @reporter.serverless_apis.count %>
3+
Endpoints that are currently being tested are marked as done and link to the test where they're being used.
4+
5+
* [Endpoints in stack JSON spec](#endpoints-in-stack-json-spec): <%= @reporter.apis[:json].count %>
6+
* [Endpoints in elasticsearch-specification](#stack): <%= @reporter.apis[:specification].count %>
7+
* [Endpoints in Serverless](#serverless): <%= @reporter.serverless_apis.count %>
68
* [Tested](#tested): <%= @reporter.tested.count %>
79
* [Untested](#untested): <%= @reporter.untested.count %>
810
* Coverage Stack: ![](https://geps.dev/progress/<%= @reporter.coverage_stack %>)
911
* Coverage Serverless: ![](https://geps.dev/progress/<%= @reporter.coverage_serverless %>)
12+
* [APIs in JSON spec and not in elasticsearch-specification](#apis-in-json-spec-and-not-elasticsearch-specification)
13+
14+
## Endpoints in stack JSON spec
15+
<% @reporter.json_apis.each do |api| -%>
16+
<%= @reporter.display_endpoint(api) %>
17+
<% end %>
1018

11-
## Tested
19+
## Endpoints in elasticsearch-specification
1220

13-
<% @reporter.tested.each do |test| %>
14-
- [x] [<%= test[:endpoint] %>](<%= test[:file] %>)
21+
### Serverless
22+
23+
<% @reporter.serverless_apis.each do |api| -%>
24+
<%= @reporter.display_endpoint(api['name']) %>
1525
<% end %>
1626

17-
## Untested
27+
### Stack
1828

19-
<% @reporter.untested.each do |test| %>
20-
- [ ] <%= test %>
29+
<% @reporter.stack_apis.each do |api| -%>
30+
<%= @reporter.display_endpoint(api['name']) %>
2131
<% end %>
32+
33+
### APIs in JSON spec and not elasticsearch-specification
34+
35+
<% (@reporter.json_apis - @reporter.stack_apis.map { |a| a['name'] }).each do |api| -%>
36+
<%= @reporter.display_endpoint(api) %>
37+
<% end %>

0 commit comments

Comments
 (0)