Skip to content
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

Increase Unit Test Coverage #54

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open

Conversation

ChristianAtDell
Copy link

Description

This PR includes substantial unit test coverage increase across gocsi packages.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#1707

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 80% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

opensuse154:~/git/gocsi # go test -cover -race ./...
?       github.com/dell/gocsi/middleware/serialvolume/types     [no test files]
        github.com/dell/gocsi/mock/provider             coverage: 0.0% of statements
        github.com/dell/gocsi/mock              coverage: 0.0% of statements
        github.com/dell/gocsi/mock/service              coverage: 0.0% of statements
ok      github.com/dell/gocsi   6.100s  coverage: 80.3% of statements
ok      github.com/dell/gocsi/context   1.055s  coverage: 82.1% of statements
ok      github.com/dell/gocsi/csc       1.029s
ok      github.com/dell/gocsi/csc/cmd   1.111s  coverage: 82.2% of statements
ok      github.com/dell/gocsi/middleware/logging        1.075s  coverage: 82.4% of statements
ok      github.com/dell/gocsi/middleware/requestid      1.092s  coverage: 82.8% of statements
ok      github.com/dell/gocsi/middleware/serialvolume   1.080s  coverage: 91.9% of statements
ok      github.com/dell/gocsi/middleware/serialvolume/etcd      9.454s  coverage: 80.3% of statements
ok      github.com/dell/gocsi/middleware/specvalidator  1.084s  coverage: 80.7% of statements
ok      github.com/dell/gocsi/testing   40.879s coverage: [no statements]
ok      github.com/dell/gocsi/utils     1.254s  coverage: 80.4% of statements

The only packages not at 80% or above are:

  • middleware/serialvolume/types (no functional code, only type definitions)
  • mock, mock/service, mock/provider (mock controller client/server, for testing)
  • testing (legacy gomega unit tests)

All other packages are at 80% coverage or above.

@ChristianAtDell ChristianAtDell marked this pull request as ready for review January 29, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants