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: add keploy integration #6197

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

charankamarapu
Copy link

@charankamarapu charankamarapu commented Mar 28, 2024

Description

This Pull request is majorly to integrate Keploy(an E2E testing tool) with TYK. By using Keploy, developers need not write any code to create E2E test files, all they have to do is hit some API requests to the running application(TYK) and the test cases will be created automatically. For more information regarding keploy please visit the website.

To install and run keploy please follow the installation guide

I have recorded few test cases like

  1. Hitting unknown API to the TYK gateway
  2. Registering API to the gateway
  3. Hitting reload API
  4. Hitting the API which was added

I have then ran the recorded test cases, below are the coverage reports.

keploy tests coverage

Screenshot 2024-04-01 at 12 51 26 PM

With just 4 api calls keploy has achieved 10% coverage and tested the E2E flow.

NOTE :

  1. Keploy supports redis but keploy currently doesn't support the file system calls. As TYK is using file system that is nothing but /apps folder where the API configuration is added, to run keploy please make sure that while testing the /apps folder is same as what it is been before recording to maintain the same environment for testing.
  2. Rather than using reload API try to use restarting server for better testing experience

Related Issue

#5945

Motivation and Context

This feature makes it easy to create E2E test case and run them with ease. It gives huge coverage in just 5-10 API calls instead of writing 100 unit tests which are unreliable.

How This Has Been Tested

This feature itself is about adding a testing tool . This tool is internally tested by the Keploy team.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning why it's required
  • I would like a code coverage CI quality gate exception and have explained why

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
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.

None yet

1 participant