Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report #36

Merged
merged 7 commits into from
Mar 12, 2024
Merged

Report #36

merged 7 commits into from
Mar 12, 2024

Conversation

picandocodigo
Copy link
Member

@picandocodigo picandocodigo commented Feb 12, 2024

Test report

This is a Ruby script that generates the ../apis_report.md file.

Usage:

Download artifacts

Download the necessary files with rake download_all. This will download and unzip the Elasticsearch JSON API spec and the 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.

Generate report

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.

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.

TO-DO:

  • GitHub Action
  • Make STACK_VERSION a variable

@picandocodigo
Copy link
Member Author

picandocodigo commented Feb 12, 2024

@picandocodigo
Copy link
Member Author

picandocodigo commented Feb 12, 2024

Not sure if the GitHub Action will work 🤔 (Update: it seems to be working fine, there's just no changes on the report)

It should run for every Pull Request and automatically add a commit to the Pull Request if the report has any changes, or open a new Pull Request if there's a push to main that would change the report (which shouldn't happen if we never push directly to main).

@picandocodigo picandocodigo force-pushed the report branch 4 times, most recently from cb69368 to 04c3e81 Compare February 12, 2024 18:18
@picandocodigo
Copy link
Member Author

I updated it so that every endpoint that is listed as "tested" includes a link to the test file where it's being tested.

Copy link
Contributor

@ezimuel ezimuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, LGTM!

@picandocodigo picandocodigo merged commit be3db6b into main Mar 12, 2024
2 checks passed
@picandocodigo picandocodigo deleted the report branch March 12, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants