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

[Metricbeat] Testing: Allow use of different directory to test data instead of the expected one #34467

Merged
merged 25 commits into from
Feb 20, 2023
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion metricbeat/mb/testing/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ An alternative is to just run from metricbeat `mage mockedTests` to achieve the
### Available settings in `config.yml`

- `path`: (string) Path to reach the directory containing the files to read from. Default is "_meta/testdata".
- `wirtepath`: (string) Path to the directory where the expected files are going to be written. Default is "_meta/testdata".
- `writepath`: (string) Path to the directory where the expected files are going to be written. Default is "_meta/testdata".
- `datapath`: (string) Path to the directory where the data.json file is going to be written. Default is "_meta".
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please somewhere add a comment why we have data.json file and that is used/might be used for our public documentation (or link to the place where it is mentioned, but I couldn't find it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can try, but I am not sure I understand the reasoning for that file since it was already there

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking about adding smth like data.json file is used to render example events published in our official documentation
at least for me it wasn't clear at the moment of asking why we generated those files in this comment #34467 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done that! I was thinking something more complex, but as you wrote it, it makes perfect sense. I don't want to link to the line code because I would have to use one fixed commit and that might end up not making sense if we are on the branch main and are sent to a possible very old one.

- `type`: (string) The type of the test to run. At the moment, only `http` is supported.
- `url`: (string) This is the URL path that the module usually fetches to get metrics. For example, in case of Apache module this url is `/server-status?auto=`
- `suffix`: (string) The suffix that the input file has. By default `json` other common suffixes are `plain` (string) for plain text files.
Expand Down