Skip to content

potpie-ai/momentum-core

Repository files navigation

Momentum logo Momentum Logo light


pypi package Apache 2.0

The open-source integration testing tool for your backend code

From git push to production-ready: See the unseen, test the untested


Get started in a single click!

Explore the docs

Report Bug · Request Feature · Join Our Discord · Roadmap · X

Open in Gitpod

Momentum is an open-source tool designed to generate and understand powerful insights into your codebase. It helps you understand changes and their impacts, generate test behaviours and integration test code and much more.

Table of Contents

Introduction

momentum analyses your codebase and understands intended code behavior and tests it at every git push to ensure the code is ready for production. It generates visualisation and precise context for test plans and test cases for all entry points detected in the system.

What is a behavior?

A behavior is defined as a task or functionality you were trying to create using your code. Examples could be deleting a document using a deleting API or creating a new user in the database. Behaviors can also be more complex sometimes where third-party dependencies are associated for example fetching data from a payment API to check the status. Behaviours must be independently executable tasks.

Here's how momentum can help you!

blast radius
  • Blast Radius: This will be a list of endpoints that could potentially be affected by the changes you made in your code. This will also be a starting point to decide what parts of your code need to be tested before shipping to production..
dependency visualisation
  • Dependency Visualization: Visualize code dependencies and relationships.
behaviour detection
  • Behaviour identification: Automatically identify behaviors written in your code and generate a plan to test their functionality
code generation
  • Code generation to test functionality: Generate code to test all behaviors identified and run it in your local environment through momentum

    code run
  • Run code in local dev environment: No need for yet another yaml, our cli works with your existing dev environment to run code.

    code debugging
  • Debug code: Based on the stacktrace of the run, momentum can diagnose and propose a solution

Installation

To get started with Momentum, follow these steps:

Steps

  1. Clone the repository:

    git clone https://github.com/getmomentum/momentum-core.git
    cd momentum-core
  2. Set up the virtual environment:

    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
  3. Setup keys and .env: You will have to setup keys for services like firebase auth, github app, Open AI, portkey among others. Follow the detailed instructions here

  4. Start the application:

    ./start_momentum.sh

Note: You might need to make it an executable, do it by running chmod +x start_momentum.sh

Usage

After installation, you can access Momentum at http://localhost:8001. Key functionalities include:

  • User Authentication
  • Parsing Codebase
  • Listing Parsed Projects and Branches
  • Generating Blast Radius
  • Visualizing Dependencies and Flow Graphs
  • Setting Preferences for Endpoints
  • Generating and Setting Up Test Plans

For detailed usage instructions, visit the Momentum Documentation.

Contributing

We welcome contributions from the community. Contributions can be of the form:

  1. Documentation : Help improve our docs! If you fixed a problem, chances are others faced it too.
  2. Code : Help us make improvements to existing features and build new features for momentum.
  3. Tests : Help us make momentum resilient by contributing tests.

To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a Pull Request.

Refer to the Contributing Guide for more details.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

💪 Thanks To All Contributors

Thanks a lot for spending your time helping build momentum. Keep rocking 🥂

Contributors