This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 276
(root) Improve test coverage (goal: 80%) #1489
Closed
15 tasks done
Labels
Milestone
Comments
shashankram
added
good first issue
Good for newcomers
area/tests
Related to tests
labels
Aug 11, 2020
shashankram
added a commit
that referenced
this issue
Aug 11, 2020
This change adds adds tests for EDS. It improves the test coverage from 0% to 80%. A subsequent change will refactor the code further to make the existing code mor unit testable. Part of #1489
This was referenced Aug 11, 2020
shashankram
added a commit
that referenced
this issue
Aug 13, 2020
…rted (#1517) Previously we added type assertions for kubernetes resources in their caches. These type assertions can only result from bugs in the code if there is a mismatch between the resource type in the informer and the code that asserts for the resource type in the informer cache. Such a scenario is not possible to test if the code is correct (as is the case now), and the code must be buggy for a potential unit test to even be able to test such mismatches. This change removes such checks in the informer caches since its not possible to even unit test the need for such code. It also simplifies the return values of some functions that were only returning an error for these scenarios. Part of #1489
shashankram
added a commit
to shashankram/osm
that referenced
this issue
Aug 13, 2020
The SMI client has a lot of code but no tests. `github.com/openservicemesh/osm/pkg/smi coverage: 0.0% of statements` This change uses fake kubernetes clients to test all the functions that implement the MeshSpec interface. It also removes dead code. It helps improve the code coverage from 0.0% to 74.6%. `github.com/openservicemesh/osm/pkg/smi coverage: 74.6% of statements`. Due to some limitations of fake kubernetes clients such as not being able to enforce label selector semantics with client informers and caches, a few code paths repeated in each function are not testable. Part of openservicemesh#1489 Signed-off-by: Shashank Ram <shashank08@gmail.com>
shashankram
added a commit
that referenced
this issue
Aug 13, 2020
The SMI client has a lot of code but no tests. `github.com/openservicemesh/osm/pkg/smi coverage: 0.0% of statements` This change uses fake kubernetes clients to test all the functions that implement the MeshSpec interface. It also removes dead code. It helps improve the code coverage from 0.0% to 74.6%. `github.com/openservicemesh/osm/pkg/smi coverage: 74.6% of statements`. Due to some limitations of fake kubernetes clients such as not being able to enforce label selector semantics with client informers and caches, a few code paths repeated in each function are not testable. Part of #1489 Signed-off-by: Shashank Ram <shashank08@gmail.com>
This was
linked to
pull requests
Aug 18, 2020
This was referenced Aug 24, 2020
This was referenced May 25, 2021
Closed
Closed
draychev
changed the title
Improve test coverage (goal: 80%)
(root) Improve test coverage (goal: 80%)
Jun 30, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The current go test coverage is low for many modules as shown below.
Filing this issue for tracking the test coverage improvement.
The text was updated successfully, but these errors were encountered: