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

feat: OAS break test, API contract test, load test, security test. #134

Open
wants to merge 89 commits into
base: main
Choose a base branch
from

Conversation

battlebyte
Copy link

Adds OAS contract breaking change detection using oasdiff.
Adds API contract testing with Schemathesis based on OAS spec.
Adds load testing with K6 based on the OAS spec.
Adds security testing with ZAP Proxy based on OAS spec.
Chose deployment target (Konnect, EE or KIC) via environment variable.
Adds Kong configuration linting.

README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

@battlebyte I think this will cause resources to delete and re-create in the PRD environment I run. Did you run an oas conversion with the insomnia compatible flag and then commit this change?

Copy link
Author

Choose a reason for hiding this comment

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

I don't think I changed at all the flags on the openapi2kong.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not commit any changes to this file. Unless I've forgotten, it's generated and then committed back by the CICD flow.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@battlebyte what's the purpose of this gitignore change? I typically don't commit env files so this helps them not accidentally get committed.

Copy link
Author

Choose a reason for hiding this comment

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

That .env file informs the variable FLIGHT_SVC_ENDPOINT which is necessary for the booking service to contact the flight service. During the workflow the services are started during contract testing, load testing and security testing. If this variable is not informed, some of those test fail because the booking service is unable to contact flight service.

@@ -10,12 +10,20 @@ info:
title: Customer Information Service

servers:
- url: https://api.kong-air.com
- url: http://localhost:8083
Copy link
Collaborator

Choose a reason for hiding this comment

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

@battlebyte are you re-patching these url changes somewhere? If we change this, then the URLs in the developer portal are not helpful for consumers of the API SDK pages. For example: https://portal.kong-air.com/spec/451019f3-bd60-4938-a0b5-84e52b4eebbb/2f1404fa-73bf-4a0d-9795-8bf13bc95acf

Copy link
Author

Choose a reason for hiding this comment

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

Good point. I changed those so that contract testing / load testing / security testing use the server url. I will patch them before the tests during pipeline execution only.

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