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
Improve code coverage in satellite/console #6755
Comments
Change satellite/console: test update account mentions this issue. |
Looks like there's a test,
|
@wilfred-asomanii thanks for finding that |
This change adds tests to the update account endpoint. Issue: #6755 Change-Id: I77dd0100cb75aa1da07b77be0795913722ad3fe4
To get the latest coverage report it's also possible to see it in Jenkins https://build.dev.storj.tools/job/storj/job/main/cobertura. Although, looks like the tests haven't fully succeeded recently. Also note that |
@egonelbre @wilfred-asomanii already noticed that with one of the tests he looked into - |
Change satellite/console: add GetUsageReport service test mentions this issue. |
Change satellite/console: remove /account/delete endpoint mentions this issue. |
use methods which are very well tested in satellite/accounting/projectusage_test.go |
added go unit test for GetUsageReport service method Issue: #6755 Change-Id: I33554345a99fffc7c5ebccb7d4d868da00fc35e1
Remove delete account endpoint as it's not used. Issue: #6755 Change-Id: I9faa2b59e8de92b8e51d0546b15909cc57aec6b6
Ok, I managed to recently get one run https://build.dev.storj.tools/job/storj/job/main/4139/cobertura/ |
@egonelbre do you know if there is a way to view coverage of the line-by-line code from the report you shared? I'm only able to see high-level info, like what percentage of specific files are covered. I haven't figured out how to view the file itself to see which lines are covered |
@mobyvb, unfortunately that one no. I think I tried at some point using something, but the sizes were quite large for that. Maybe we can just persist the coverage as an artifact, and then people can open them up locally somehow. Not sure whether we need to fix some paths, but should be doable. |
I created https://review.dev.storj.io/c/storj/storj/+/12527 for now. There also seem to be Jenkins plugins that can show more detailed information https://plugins.jenkins.io/coverage, but currently that install failed. |
The builds now contain the compressed coverage profile https://build.dev.storj.tools/blue/organizations/jenkins/storj/detail/main/4157/artifacts/ |
This ticket is designed to be completed in one sprint by the Console team. Individual items on the checklist do not need to be converted to issues, and can simply be checked when merged.
Instructions for working on tasks:
If you want to "claim" a checklist item, please edit the issue and put your username beside it, so that no one else tries to work on the same thing.
If the function is an unused feature, remove it. Otherwise, add testing to it. After merging your changes, check the item in the list.
If the function needing testing spans across multiple packages (e.g.
consoleweb
andconsole
), it is sufficient to add a single test that covers both. It is also fine to add separate tests for each package (e.g. test important logic inconsole
and test http/api-specific stuff inconsoleweb
)Cover major edge cases, but don't worry about covering every single case for these tasks. This will be a long-term effort and we will likely make multiple passes as coverage improves.
Instructions for generating coverage report:
go test -coverprofile cover.out ./satellite/console/...
go tool cover -html=cover.out
to view an html version of the reportTasks for this body of work:
SetupAccount()
inconsole/service.go
andconsoleapi/auth.go
@mobyvbGetUsageReport()
inconsole/service.go
@VitaliiShpitalGetProjectUsage()
inconsole/service.go
@mobyvbGetBucketTotals()
inconsole/service.go
UpdateAccount()
inconsole/service.go
andconsoleapi/auth.go
@wilfred-asomaniiAttemptPayOverdueInvoices()
inconsole/service.go
@wilfred-asomaniiDeleteAccount()
inconsole/service.go
@VitaliiShpitalBillingHistory()
inconsole/service.go
andconsoleapi/payments.go
InvoiceHistory()
inconsole/service.go
andconsoleapi/payments.go
This is not an exhaustive list - do not add new items to it.
The text was updated successfully, but these errors were encountered: