Giter Site home page Giter Site logo

Comments (1)

gouravkrosx avatar gouravkrosx commented on September 20, 2024

Basic Testing:

  • Start by testing the core functions of Keploy, like verifying if the provided commands are correct and detecting errors in the user's command, such as port conflicts or non-zero exit commands.

Advanced Testing:

  • Move on to more advanced testing, focusing on the "record and test" feature, which is the heart of Keploy.

Method:

  • Begin by recording test cases and mocks for your application.
  • Test the "keploy record" command with the "keploy test" command. It looks like this: keploy record -c "keploy test -c './sampleApp'". The "keploy record" tool records the same APIs that "keploy test" uses with the sample application.
  • When your sample app makes an external call, "keploy record" captures the mocks sent by "keploy test." "Keploy test" reads the recorded mocks and sends them back. This way, no database is needed while testing the record feature of Keploy.

Initial Challenges:

  • "Keploy record" couldn't run the "keploy test" command initially due to issues with environment variables. This was fixed by explicitly setting the environment for the command.
  • Managing test epbf hooks was a bit tricky, but it's crucial to note that the hooks are executed in the order they were loaded, with record hooks running before test hooks.
  • It's important to filter out the PID of the "keploy test" binary in "keploy record" to avoid capturing external calls made by "keploy test".
  • Adjust the redirect mechanism so that the flow goes through "keploy record proxy" before "keploy test proxy." Initially, it was going directly to "keploy test proxy," preventing proper recording of tests and mocks. This issue was resolved by adding checks in the ebpf hooks.

This approach allows us to make significant advancements in our testing framework

from keploy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.