Closed KfreeZ closed 1 week ago
@zhlsunshine please help to verify the coverage test result in your local environment. It might be a CI/CD issue, but I will need your guys help to dig out.
the wired thing is, the same code main branch of opea-project/GenAIInfra I make test on IDC's node,
github.com/opea-project/GenAIInfra/microservices-connector/api/v1alpha3 coverage: 0.0% of statements
github.com/opea-project/GenAIInfra/microservices-connector/cmd coverage: 0.0% of statements
ok github.com/opea-project/GenAIInfra/microservices-connector/cmd/router 0.063s coverage: 35.9% of statements
github.com/opea-project/GenAIInfra/microservices-connector/test/utils coverage: 0.0% of statements
ok github.com/opea-project/GenAIInfra/microservices-connector/internal/controller 7.732s coverage: 12.5% of statements
but on our lab machine
KUBEBUILDER_ASSETS="/root/zkf/dev/GenAIInfra/microservices-connector/bin/k8s/1.29.0-linux-amd64" go test $(go list ./... | grep -v /e2e) -coverprofile cover.out
? github.com/opea-project/GenAIInfra/microservices-connector/api/v1alpha3 [no test files]
? github.com/opea-project/GenAIInfra/microservices-connector/cmd [no test files]
ok github.com/opea-project/GenAIInfra/microservices-connector/cmd/router 0.033s coverage: 58.8% of statements
? github.com/opea-project/GenAIInfra/microservices-connector/test/utils [no test files]
ok github.com/opea-project/GenAIInfra/microservices-connector/internal/controller 7.621s coverage: 70.9% of statements
@daisy-ycguo @zhlsunshine I think I have found the root cause, our test code is trying to get the ~/.kube/config on the machine, which CI/CD might not have, the test quit from the beginning.
@daisy-ycguo @zhlsunshine I think I have found the root cause, our test code is trying to get the ~/.kube/config on the machine, which CI/CD might not have, the test quit from the beginning.
I believe the CI/CD server has ~/.kube/config on the machine.
$ ls ~/.kube/
cache config
Even I use the same script to test coverage in my local development machine, I will get a very lower coverage rate.
refer to #98 , fix is in it
the GMC controller's test code is not running as expected on github workflow, so the coverage is much lower than the local tests results (70.9%)
possible reason is the ginkgo tests is not executed in the workflow.