Skip to content

Commit be3db6b

Browse files
committed
Adds README for report generator
1 parent 0259ac2 commit be3db6b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

report/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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_all`. This will download and unzip the Elasticsearch JSON API spec and the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification/) spec. The files will be downloaded to `./tmp/rest-api-spec` and `./tmp/schema.json` respectively. The `tmp` directory is added to `.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`.

0 commit comments

Comments
 (0)