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

Improve test coverage #62

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

Conversation

jethrodaniel
Copy link

@jethrodaniel jethrodaniel commented Dec 15, 2024

Was digging into thruster's source, figured I'd contribute a bit while I was there.

Thanks for this project!


Viewing coverage locally like so:

go test -v -coverprofile cover.out ./... && go tool cover -html cover.out -o cover.html && open cover.html
internal/config.go

Before:

image

After: 100%

internal/proxy_handler.go

Before:

image

After: 100%

internal/upstream_process.go

Before:
image

After: 100%

Total coverage changes

Before: (77.2%)

$ go test -coverprofile cover.out ./... && go tool cover -func=cover.out|rg total
        github.com/basecamp/thruster/cmd/thrust         coverage: 0.0% of statements
ok      github.com/basecamp/thruster/internal   0.022s  coverage: 78.7% of statements
total:                                                                  (statements)                    77.2%

After: (79.6%)

go test -coverprofile cover.out ./... && go tool cover -func=cover.out|rg total
        github.com/basecamp/thruster/cmd/thrust         coverage: 0.0% of statements
ok      github.com/basecamp/thruster/internal   0.024s  coverage: 81.1% of statements
total:                                                                  (statements)                    79.6%

@jethrodaniel jethrodaniel changed the title improve test coverage Improve test coverage Dec 15, 2024
@jethrodaniel jethrodaniel marked this pull request as ready for review December 15, 2024 19:53
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.

1 participant