-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails routes being mounted counts as runtime line hits, but should be load time #543
Comments
hmmm... so runtime vs loading is triggered based on when we think the full app has been eagerly loaded... this might be different for how grape hooks into routes... Does our app have eager_loading for rails, I would assume it loads all of your grape files at that time.... I know some graphql libraries have problems where most of the graph is defining a schema and not used at run time... I don't use grape, so I might need a small sample app or PR on the coverband_rails demo app reproducing the issue for me to fix it. |
We are using In this I see a bunch of |
yeah I think there is issues with how some of the frameworks lazy load or load schemas and types... I haven't used grape for a long time so I don't know how exactly mount is loading things, but if it is lazy loading the code would end up at runtime vs loading... I have definitely seen this issue with graphql, when all the types get loaded after rails has finished initializing. A few things to check:
Folks that have graphql or graph try it out and let me know. If there is a small repo that shows this issue I can try to debug it but I don't have a small reproducible code flow that shows this problem. Let me know @harshanails or @kieran-flex |
Describe the bug
When doing
"mount API:RootAPI => '/'
at startup to mount all of our APIs in Rails (we use Grape for the actual APIs) then it cascades through all of the initialisation code in those Controllers an related code and includes them in coverage but marks it all as runtime.It then makes it really hard to tell if an API is actually used because it says lots of code is used at runtime, when really none is and it is all just load time.
How is load time versus runtime worked out? Can I force anything that happens during route mounting to be considered load time?
Screenshots below:
The text was updated successfully, but these errors were encountered: