CodeBeaver Pull Request example

How ScrapegraphAI is getting the benefits of Unit Tests without doing anything


At CodeBeaver, we make unit testing effortless. Just integrate CodeBeaver into your GitHub repository, and it takes care of the rest. Open a Pull Request, and CodeBeaver analyzes your code, runs existing tests, and auto-generates or updates unit tests for new changes. It’s smart, seamless, and efficient — only valid tests are committed in a clean, ready-to-merge Pull Request (example)

The Challenge: Maintaining Stability Without Sacrificing Contributions

We recently teamed up with the talented developers behind ScrapegraphAI, an open-source project with over 17,000 stars on GitHub. ScrapegraphAI is a game-changer, turning any webpage into structured data with just a single prompt. But like many open-source projects, they faced a critical bottleneck: ensuring stability while encouraging community contributions.

The problem? Contributors often skip writing unit tests — especially for complex integrations like ScrapegraphAI’s LLM models. Writing and maintaining unit tests for such scenarios is tedious and time-consuming. Even tools like Copilot or Cursor only get you halfway there. Here’s what developers typically go through:

  • Run the tests
  • Analyze failures
  • Debug and tweak
  • Repeat… and repeat again

It’s no surprise that most contributions arrive without unit tests. But without tests, maintaining code stability becomes a gamble.

ScrapegraphAI briefly considered enforcing a strict contributions policy requiring unit tests — but they knew that would discourage valuable community engagement. They needed a better solution.

The CodeBeaver Solution: Automated Testing That Works Like Magic

We introduced the ScrapegraphAI team to CodeBeaver, and they integrated it in just 30 seconds. Here’s how CodeBeaver transformed their workflow:

  1. Seamless Integration: CodeBeaver started monitoring every new Pull Request.
  2. Smart Analysis: When a Pull Request was opened, CodeBeaver analyzed the codebase and identified where new or updated unit tests were needed, aiming for 90%+ coverage.
  3. Effortless Testing: CodeBeaver mocked complex LLM API calls, ensuring tests were lightweight and cost-effective.
  4. Reliable Results: After writing the tests, CodeBeaver runs them one by one. If any of them fails, CodeBeaver determines if the test failed due to how the code was written or due to how the test was written. If it’s the test’s fault, the test is rewritten. Otherwise, it is kept
  5. Final checks CodeBeaver also runs the pre-commit hooks defined in the repository by the Scrapegraph team. CodeBeaver updates its code accordingly, just like a human would.
  6. Delivery All of the above means that only valid tests were committed, bundled in a new Pull Request, and ready for review. If any bug in the code is spotted, CodeBeaver highlights it in detail in the Pull Request description.

For ScrapegraphAI, this meant increased test coverage, faster contributions, and zero manual effort. One Pull Request alone saw 8 new unit tests and a 90.7% increase in coverage — all while keeping their LLM tests fast and cheap.

Why It Matters

With CodeBeaver, the ScrapegraphAI team no longer has to worry about balancing stability with contributions. Every line of code is backed by robust, automatically generated tests, making regressions easier to catch and resolve. Their team can now focus on what they do best: building great software.

Ready to Try It?

If you’re managing an open-source project, give CodeBeaver a try at codebeaver.ai. It’s completely free for open-source repositories. For private projects, we offer a 14-day free trial, with pricing starting at just $12/month per developer.

Let CodeBeaver handle your unit tests so you can focus on shipping great code 🚀

Table of Contents