Skip to content

Commit c9c1eeb

Browse files
committed
Adds README for report generator
1 parent df6c6f0 commit c9c1eeb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

report/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Test report
2+
3+
This is a Ruby script that generates the [`../apis_report.md`](../apis_report.md) file.
4+
5+
## Usage:
6+
7+
### Download artifacts
8+
9+
Download the necessary files with `rake download`. This will download and unzip the Elasticsearch JSON API spec to know which API endpoints are available. The files are in `./tmp/rest-api-spec`. The `tmp` directory is in `.gitignore`.
10+
11+
### Generate report
12+
13+
Run `rake report` to check the available endpoints and which ones have been tested. At the time of writing this, the script checks the `../tests` folder for ocurrences of each endpoint name. The script will generate a Markdown file in `../apis_report.md`.
14+
15+
There are three main files: `reporter.rb`, `Rakefile` and `template.erb`. The first one has the code for the `Elastic::Reporter` class. When it is initialized, it gathers all the API names from the spec (excluding names starting with `_` like `_common` and `_internal`). Then it checks for each API endpoint name, if it's being used in any of the yml files in `./tests`. The reporter is initialized in the `report` task in the Rakefile and the result is passed to the ERB template to generate the markdown file and write it to `./apis_report.md`.
16+
17+
18+
TO-DO:
19+
- [ ] GitHub Action
20+
- [ ] Make `STACK_VERSION` a variable

0 commit comments

Comments
 (0)