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

[Fleet] Add validation test for openApi files #121544

Merged
merged 4 commits into from
Dec 21, 2021

Conversation

criamico
Copy link
Contributor

Summary

Adds a test to jest to validating openApi docs. It uses swagger-parser which is the library used by swagger-cli.

Repro steps

  • I'm simply adding a test to jest as it takes few seconds to validate our specs
  • To test that it returns an error when the specs are invalid, change an indentation or modify a path on any of the specs, then run node scripts/jest -c x-pack/plugins/fleet/jest.config.js -i x-pack/plugins/fleet/common/openapi/validate_docs.test.ts. The test should fail.

For maintainers

@criamico criamico added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team auto-backport Deprecated - use backport:version if exact versions are needed v8.1.0 labels Dec 17, 2021
@criamico criamico self-assigned this Dec 17, 2021
@criamico criamico requested a review from a team as a code owner December 17, 2021 15:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@juliaElastic
Copy link
Contributor

nice improvement!

@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico criamico requested a review from a team as a code owner December 20, 2021 15:17
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @criamico

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Awesome - thanks for this!

@criamico criamico merged commit f2162f1 into elastic:main Dec 21, 2021
@criamico criamico deleted the jest_validate_openapi branch December 21, 2021 14:37
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Dec 21, 2021
* [Fleet] Add validation test for openApi files

* Fix missing types declaration

* Fix licence issue

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
8.0

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Dec 21, 2021
* [Fleet] Add validation test for openApi files

* Fix missing types declaration

* Fix licence issue

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Cristina Amico <criamico@users.noreply.github.com>
gbamparop pushed a commit to gbamparop/kibana that referenced this pull request Jan 12, 2022
* [Fleet] Add validation test for openApi files

* Fix missing types declaration

* Fix licence issue

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
azasypkin added a commit to azasypkin/kibana that referenced this pull request Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants