padrino / padrino-framework

Padrino is a full-stack ruby framework built upon Sinatra.
http://www.padrinorb.com
MIT License
3.37k stars 509 forks source link

Line coverage not getting recorded for controllers #2274

Open vs37559 opened 1 year ago

vs37559 commented 1 year ago

Do you want to request a feature or report a bug?

Not sure if it's a bug but this is something I have came across when checking for line coverage in my Padrino application.

What is the current behavior?

I am using Ruby's Coverage module via coverband gem to check Line coverage for my application. Whatever lines of code I have in my controller(s) seems to report zero coverage. The API is working absolutely fine and the consecutive methods resting under 'lib' directory are showing accurate coverage. It's just the lines within the controller, that are showing zero coverage.

During my debugging attempts, I found that Padrino uses Mustermann as routes' handler. Does that have something to do with it? It's wild guess, though!

What is the expected behavior?

When an API route is hit, the lines of code in the controller block (which is actually being executed) should show the coverage as per the default behavior of Ruby's Coverage module.

Which versions of Ruby, Padrino, Sinatra, Rack, OS are you using?

Ruby: v2.7.3 Padrino: v0.15.3 Sinatra: v2.2.4 Rack: v2.2.7 ActiveRecord: v5.1.1 OS: Ubuntu Linux