-
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
Coverband.configuration.store.coverage returns empty hash #548
Comments
folks use coverband on gitlab and there were a few PRs related to improvements or figuring it out in the past... I would need more specifics, but it is likely that the redis used when reporting is different when trying to retrieve the coverage. |
Do the end to end tests run in the DEV env while the report runs in TEST env? Do you have anything that tries to wipe and clear redis between tests or after test suites or after test files? |
Yes, but this is not relevant to this issue. Even without running any tests, the coverage returned is an empty hash. |
In order to reproduce the issue you could spin up a gitlab docker instance with
And then set |
@danmayer I would like to troubleshoot if the coverage is being reported to redis store at all. How can I check this with |
I see in redis logs of the application, this error but I am not sure if it is related to coverband
|
@danmayer could you point me to the correct configuration to use file_store instead of redis store? Because I have configured coverband to use Gitlab’s own redis server, it may be causing some issues. What are the limitations to using file store? Note that we are not using “coverband” to check production code coverage - although we are using it to map code paths to E2E tests on a production application |
sorry that I haven't gotten back to this. I can try to look into it more over the weekend and see if I can figure out that issue with gitlab.
|
No, this is not feasible in our use case. To be clear, coverband works. But for our use case, we need it to be part of the gitlab application and dependency on an external redis server will not pass through reviews.
Our use case is a single docker image in fact. So this shouldn't be a problem. But I am facing this error:
Here is the MR where I am trying to do that: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/170375/diffs
No, what is that? |
Ok so the error you are having with filestore is when trying to use the view tracker and i18n tracker, these build off the raw redis store... If you only need code coverage, you can likely use the filestore along with this configuration options:
If you want to track views or the other options like translations or routes, you will need redis (or I need to support them with other adapters). If you want to better debug redis, can you use a Rails command line that is easier than the redis-cli to ensure you have the right namespace and configured redis.
If you really need to use the CLI, where to look depends on a few options and which redis adapter you are using the one above or the HashRedisStore which uses LUA. for the normal adapter you can look somewhere like below which will spit out a giant JSON blob
If your redis is local to the docker you need to make sure your context either your console or whatever is the same docker and same redis or you won't find data... If you can tail your redis commands you could also look for something in tests clearing the redis as that seems like a possibility. |
After evaluating file store option, we think it doesn't serve our use case. The redis store is working in two of our build environments but just not in Context: In In order run the application as omnibus docker locally, the command is mentioned in this comment Thank you for looking into this. |
@danmayer What are the scenarios in which We changed this method call to include |
Describe the bug
We use
Coverband
to map covered file paths in Gitlab's E2E specs.In this context, we have an internal api which calls
Coverband.configuration.store.coverage
but it keeps returning {} from the api.But, from the rails console, the same call
Coverband.configuration.store.coverage
returns a non-empty coverage hash.In rails logs I do see the following:
So that means, coverband is reporting to redis but the api is just unable to fetch the coverage 🤔
To Reproduce
It is perhaps specific to Gitlab environment, but would like some help in troubleshooting further.
Expected behavior
Coverband.configuration.store.coverage should return a non-empty hash when some coverage was recorded.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: