<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/measuring-test-code-coverage-for-non-ruby-runners-t15luwmjz" -->

---
title: Measuring Test Code Coverage For Non-Ruby Runners
description: When using non-Ruby e2e test runners like Cypress or Playwright, Ruby code executed during those tests is typically excluded from coverage reports. This post...
canonical: https://daily.dev/posts/measuring-test-code-coverage-for-non-ruby-runners-t15luwmjz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Measuring Test Code Coverage For Non-Ruby Runners | daily.dev
og:description: When using non-Ruby e2e test runners like Cypress or Playwright, Ruby code executed during those tests is typically excluded from coverage reports. This post...
og:url: https://daily.dev/posts/measuring-test-code-coverage-for-non-ruby-runners-t15luwmjz
og:image: https://api.daily.dev/og/posts/t15lUWMJZ.png
og:image:alt: Measuring Test Code Coverage For Non-Ruby Runners
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Measuring Test Code Coverage For Non-Ruby Runners

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 7 min read · 0 upvotes · 0 comments

## Summary

When using non-Ruby e2e test runners like Cypress or Playwright, Ruby code executed during those tests is typically excluded from coverage reports. This post walks through a solution combining SimpleCov and Coverband: run Minitest with SimpleCov as usual, then run Coverband's standalone server alongside Cypress to capture coverage from the Rails server, extract that data with a custom Rake task into a JSON file, and finally merge both resultsets using SimpleCov's `collate` method. The merged report raises example coverage from ~35% (Minitest only) to ~53% (combined). A sample application with custom Rake tasks is provided on GitHub.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.fastruby.io/blog/ruby-coverage-for-non-ruby-runners.html>

## Questions this post answers

### How do I measure Ruby code coverage when my e2e tests run through Cypress instead of a Ruby test runner?

Run Coverband's standalone server (via RAILS_ENV=test rails coverband:coverage_server) alongside the Rails server that Cypress controls, since Coverband tracks execution independently of who started the server. After the Cypress run finishes, extract Coverband's data with a custom Rake task into a JSON file structured like SimpleCov's output, then merge it with the Minitest resultset using SimpleCov's collate method.

_Developers stitching together coverage across test tools can find similar deep dives on daily.dev._

### Why does adding the coverband gem cause a 'coverage measurement is not enabled' error when running Minitest?

This happens because the cypress-on-rails gem hardcodes the Rails test environment, so Coverband gets loaded even during the Minitest run where it isn't meant to be active, producing a 'coverage measurement is not enabled' runtime error at the end of the test run. Using a separate Rails environment for e2e tests would avoid this, but that isn't possible with the current cypress-on-rails setup.

_Track Rails testing gotchas like this by following coverage and CI discussions on daily.dev._

### Why does Coverband report an inflated code coverage percentage like 75% compared to SimpleCov's numbers?

Coverband calculates coverage for every Ruby file executed, including config files, test files, and other code that shouldn't count toward the real application coverage figure. SimpleCov normally excludes this noise using its 'rails' profile, but Coverband doesn't apply that filtering automatically, so its raw output looks artificially high until the results are merged and filtered with SimpleCov's collate method using the rails profile.

_Developers debugging misleading coverage metrics can dig into practical fixes like this on daily.dev._

## Similar posts on daily.dev

- [How well are the tests covering the code?](https://daily.dev/posts/how-well-are-the-tests-covering-the-code--2q0u8rt9y) · RUBYLAND · 0 upvotes · 0 comments
- [Announcing simplecov-compare](https://daily.dev/posts/announcing-simplecov-compare-s1zfijjrs) · RUBYLAND · 0 upvotes · 0 comments
- [Stop Reading AI Code. Start Measuring It. \(A Rails Playbook.\)](https://daily.dev/posts/stop-reading-ai-code-start-measuring-it-a-rails-playbook--uxiqr4ckg) · The Miners · 0 upvotes · 0 comments
- [TestProf Digest 2026.4: surprising finds from 30k specs—Martian Chronicles, Evil Martians’ team blog](https://daily.dev/posts/testprof-digest-2026-4-surprising-finds-from-30k-specs-martian-chronicles-evil-martians-team-blog-htcwll51r) · Martian Chronicles · 0 upvotes · 0 comments
- [Why I Switched from RSpec to Minitest \(Rails Default\)](https://daily.dev/posts/why-i-switched-from-rspec-to-minitest-rails-default--ccovdqo6p) · Ruby Flow · 1 upvotes · 0 comments

---

Tags: [#ruby](https://daily.dev/tags/ruby), [#cypress](https://daily.dev/tags/cypress)

[View this post on daily.dev](https://daily.dev/posts/measuring-test-code-coverage-for-non-ruby-runners-t15luwmjz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Measuring Test Code Coverage For Non-Ruby Runners","url":"https://daily.dev/posts/measuring-test-code-coverage-for-non-ruby-runners-t15luwmjz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/measuring-test-code-coverage-for-non-ruby-runners-t15luwmjz"},"datePublished":"2026-08-10T20:50:26.025Z","dateModified":"2026-09-14T08:56:21.409Z","description":"When using non-Ruby e2e test runners like Cypress or Playwright, Ruby code executed during those tests is typically excluded from coverage reports. This post...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e9104d319e1067cb001fdbdec06bc87f?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e9104d319e1067cb001fdbdec06bc87f?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"RUBYLAND","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"RUBYLAND","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rubyla","url":"https://daily.dev/sources/rubyla"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/measuring-test-code-coverage-for-non-ruby-runners-t15luwmjz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ruby,cypress","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"RUBYLAND","item":"https://daily.dev/sources/rubyla"},{"@type":"ListItem","position":3,"name":"Measuring Test Code Coverage For Non-Ruby Runners"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/measuring-test-code-coverage-for-non-ruby-runners-t15luwmjz#faq","mainEntity":[{"@type":"Question","name":"How do I measure Ruby code coverage when my e2e tests run through Cypress instead of a Ruby test runner?","acceptedAnswer":{"@type":"Answer","text":"Run Coverband's standalone server (via RAILS_ENV=test rails coverband:coverage_server) alongside the Rails server that Cypress controls, since Coverband tracks execution independently of who started the server. After the Cypress run finishes, extract Coverband's data with a custom Rake task into a JSON file structured like SimpleCov's output, then merge it with the Minitest resultset using SimpleCov's collate method. Developers stitching together coverage across test tools can find similar deep dives on daily.dev."}},{"@type":"Question","name":"Why does adding the coverband gem cause a 'coverage measurement is not enabled' error when running Minitest?","acceptedAnswer":{"@type":"Answer","text":"This happens because the cypress-on-rails gem hardcodes the Rails test environment, so Coverband gets loaded even during the Minitest run where it isn't meant to be active, producing a 'coverage measurement is not enabled' runtime error at the end of the test run. Using a separate Rails environment for e2e tests would avoid this, but that isn't possible with the current cypress-on-rails setup. Track Rails testing gotchas like this by following coverage and CI discussions on daily.dev."}},{"@type":"Question","name":"Why does Coverband report an inflated code coverage percentage like 75% compared to SimpleCov's numbers?","acceptedAnswer":{"@type":"Answer","text":"Coverband calculates coverage for every Ruby file executed, including config files, test files, and other code that shouldn't count toward the real application coverage figure. SimpleCov normally excludes this noise using its 'rails' profile, but Coverband doesn't apply that filtering automatically, so its raw output looks artificially high until the results are merged and filtered with SimpleCov's collate method using the rails profile. Developers debugging misleading coverage metrics can dig into practical fixes like this on daily.dev."}}]}
```

