diff --git a/README.md b/README.md index 735ad83..dc89037 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ I had some trouble during TLS communication between both of my gRPC server and c ## TODO: - [ ] Create intermediate authority to sign certificates on behalf CA to add more security. If intermediate is hacked then you can revoke from CA and generate new intermediates keeping CA isolated from beeing hacked. -- [ ] Complete tests +- ~~[x] Complete tests~~ ## Configuration If you are on `dev` environment, like I've been doing, you must create `.env` file similar as `.env.example` in this repo: @@ -59,6 +59,23 @@ Then you can just run go run main.go ``` +## tests +Just simply run make command and watch coverage results on `cover.html` within `coverage` +```shell +make test-coverage +rm -rf coverage +mkdir coverage +go test -v -coverprofile coverage/cover.out ./... +=== RUN TestCredentialsFromKeyWithPasswd +--- PASS: TestCredentialsFromKeyWithPasswd (0.37s) +=== RUN TestCredentialsFromKeyWithPasswdError +--- PASS: TestCredentialsFromKeyWithPasswdError (0.46s) +PASS +coverage: 90.9% of statements +ok gitea.urkob.com/urko/go-grpc-certificate/pkg/credentials 0.839s coverage: 90.9% of statements +go tool cover -html coverage/cover.out -o coverage/cover.html +``` + ## goreportcard ```bash make goreportcard