Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

(root) Improve test coverage (goal: 80%) #1489

Closed
15 tasks done
vramakrishnan opened this issue Aug 10, 2020 · 0 comments · Fixed by #1555, #1506, #1607, #1755 or #1773
Closed
15 tasks done

(root) Improve test coverage (goal: 80%) #1489

vramakrishnan opened this issue Aug 10, 2020 · 0 comments · Fixed by #1555, #1506, #1607, #1755 or #1773
Labels
area/tests Related to tests size/M 7 days (~1.5 week)
Milestone

Comments

@michelleN michelleN added this to the v0.3.0 milestone Aug 10, 2020
@shashankram 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
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>
@draychev draychev reopened this Aug 24, 2020
@draychev draychev changed the title Improve go test coverage Improve test coverage Sep 15, 2020
@draychev draychev changed the title Improve test coverage Improve test coverage (goal: 80%) Sep 15, 2020
@michelleN michelleN removed this from the v0.3.0 milestone Sep 17, 2020
@draychev draychev added the root label Jun 30, 2021
@draychev draychev changed the title Improve test coverage (goal: 80%) (root) Improve test coverage (goal: 80%) Jun 30, 2021
@draychev draychev modified the milestones: v0.10.0, v1.0.0 Aug 23, 2021
@draychev draychev removed this from the v1.0.0 milestone Aug 31, 2021
@draychev draychev added this to the v1.0.0 milestone Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.