ergo-services / ergo

An actor-based Framework with network transparency for creating event-driven architecture in Golang. Inspired by Erlang. Zero dependencies.
https://ergo.services
MIT License
3.5k stars 138 forks source link

Increase test coverage to 80% #159

Open Nezteb opened 1 year ago

Nezteb commented 1 year ago

Describe the bug As part of adding ergo to awesome-go, the repo needs to have at least 80% test coverage, which it currently does not.

Current test coverage: coverage.zip

❯ cat coverage.html | grep '<option value="file' | sed -E 's/.*>(.*) \((.*)%\)<.*/\2 \1/' | sort -rn

89.2 github.com/ergo-services/ergo/etf/encode.go
65.8 github.com/ergo-services/ergo/etf/etf.go
56.2 github.com/ergo-services/ergo/lib/mpsc.go
51.0 github.com/ergo-services/ergo/etf/decode.go
43.8 github.com/ergo-services/ergo/etf/cache.go
12.7 github.com/ergo-services/ergo/proto/dist/proto.go
8.3 github.com/ergo-services/ergo/lib/tools.go
0.0 github.com/ergo-services/ergo/proto/dist/registrar.go
0.0 github.com/ergo-services/ergo/proto/dist/handshake.go
0.0 github.com/ergo-services/ergo/proto/dist/flusher.go
0.0 github.com/ergo-services/ergo/proto/dist/epmd.go
0.0 github.com/ergo-services/ergo/lib/cert.go
halturin commented 1 year ago

Thanks for the report. I had no plan to reach this level of coverage, especially for the 2. version. But in 3. I'm expecting to improve it. (3.0 version is planned to release this fall)

Nezteb commented 1 year ago

Yeah 80% is a lot, especially for a long-existing project to suddenly achieve. I only posted this to track the progress, as awesome-go is pretty strict about the 80% coverage mark. 😅