You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to improve our test coverage while working on making code refactorable. At this current stage, there are a lot of dependencies that make testing and finding bugs harder.
Currently, we have a lot of integration tests rather than unit tests. Integration tests allow us to check whether our code is functioning correctly, but it doesn't provide us with whether our code is healthy. This is a part of the job of unit tests, but we don't have enough of them and can't have them easily due to the architectural restrictions of the current codebase.
As of today (Feb. 13, 2022), here is our test coverage:
github.com/grafana/xk6-browser/tests 22.545s coverage: 53.8% of statements
github.com/grafana/xk6-browser/common 0.478s coverage: 10.8% of statements
github.com/grafana/xk6-browser/chromium 0.214s coverage: 0.6% of statements
So, our average test coverage is around 22%. However, if we only count the common package our coverage becomes a staggering ~10%. The common package is a critical package that owns almost every logic. So I argue that our current coverage is ~10%.
# All tests
go test -cover -coverpkg=./... -coverprofile=cover.out ./...
# Unit tests (without /tests)
go test -coverprofile=cover.out ./common ./chromium ./keyboardlayout .
We need to improve our test coverage while working on making code refactorable. At this current stage, there are a lot of dependencies that make testing and finding bugs harder.
Currently, we have a lot of integration tests rather than unit tests. Integration tests allow us to check whether our code is functioning correctly, but it doesn't provide us with whether our code is healthy. This is a part of the job of unit tests, but we don't have enough of them and can't have them easily due to the architectural restrictions of the current codebase.
As of today (Feb. 13, 2022), here is our test coverage:
So, our average test coverage is around 22%. However, if we only count the common package our coverage becomes a staggering ~10%. The common package is a critical package that owns almost every logic. So I argue that our current coverage is ~10%.
Heatmaps
All tests
Unit tests
Here's our test coverage by functions:
Update the coverage
Related: #231, #241, #233
The text was updated successfully, but these errors were encountered: