kubeflow / common

Common APIs and libraries shared by other Kubeflow operator repositories.
Apache License 2.0
51 stars 73 forks source link

Refactoring common operator tests #8

Open richardsliu opened 5 years ago

richardsliu commented 5 years ago

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 commented 5 years ago

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

gaocegege commented 5 years ago

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.

merlintang commented 5 years ago

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

gaocegege commented 5 years ago

@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.

richardsliu commented 5 years ago

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