common icon indicating copy to clipboard operation
common copied to clipboard

Refactoring common operator tests

Open richardsliu opened this issue 5 years ago • 5 comments

There are common Python test code in: https://github.com/kubeflow/pytorch-operator/tree/master/test https://github.com/kubeflow/tf-operator/tree/master/test

Consider how these can be refactored to reduce duplication.

richardsliu avatar Apr 04 '19 22:04 richardsliu

/cc @johnugeorge /cc @terrytangyuan /cc @jian-he

richardsliu avatar Apr 04 '19 22:04 richardsliu

Could we add more unit test in common operator? I think it is hard to import integration test or system test since the operator is not a real k8s operator.

gaocegege avatar Apr 15 '19 06:04 gaocegege

I would be better that we can refactor the test case, and provide the dev document for running test.

merlintang avatar Apr 18 '19 09:04 merlintang

@richardsliu Can we make TestJob a real CRD, then mock the kube-apiserver to run tests in job_controller?

The code coverage is too low. If we do not have a real CRD, we cannot test some logic of the common operator.

gaocegege avatar Apr 24 '19 09:04 gaocegege

That is the plan. We can add e2e tests with the TestJob as well.

richardsliu avatar Apr 24 '19 17:04 richardsliu