Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code coverage check pipeline #3344

Open
lowang-bh opened this issue Mar 9, 2024 · 8 comments
Open

Add code coverage check pipeline #3344

lowang-bh opened this issue Mar 9, 2024 · 8 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@lowang-bh
Copy link
Member

What would you like to be added:

Please add a github pipeline to check code coverage.

Why is this needed:

Make sure a commit has necessary UTs and UTs are effective to cover its relative changes。

@lowang-bh lowang-bh added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 9, 2024
@lowang-bh
Copy link
Member Author

lowang-bh commented Mar 9, 2024

/assign @william-wang @Monokaix

@Monokaix
Copy link
Member

It's a good idea, but this may increase the threshold for contributors to submit PR.

@lowang-bh
Copy link
Member Author

lowang-bh commented Mar 12, 2024

It's a good idea, but this may increase the threshold for contributors to submit PR.

Write relative UTs is the basic skill for a developer. And sometimes new PR will break old fixes without UTs.

@VasuDevrani
Copy link

@lowang-bh It seems no one working on this, can I take this up?

@lowang-bh
Copy link
Member Author

@lowang-bh It seems no one working on this, can I take this up?

Of couse. You are welcome.

/assign @VasuDevrani

@VasuDevrani
Copy link

VasuDevrani commented May 16, 2024

so i was working on this and for the step to run test

- name: Run tests and generate coverage report
        run: |
          make unit-test
          go test ./... -coverprofile=coverage.out
          go tool cover -func=coverage.out > coverage.txt

the ci is failing with some kind of Kubeconfig error [here]:

E0516 02:53:19.986663   39759 utils.go:43] init kubeclient in 4pdvgpu failed: stat /home/runner/.kube/config: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x16d78bd]

goroutine 1 [running]:
volcano.sh/apis/pkg/client/clientset/versioned.NewForConfig(0x0?)
	/home/runner/go/pkg/mod/volcano.sh/apis@v1.9.0/pkg/client/clientset/versioned/clientset.go:92 +0x1d
volcano.sh/apis/pkg/client/clientset/versioned.NewForConfigOrDie(...)
	/home/runner/go/pkg/mod/volcano.sh/apis@v1.9.0/pkg/client/clientset/versioned/clientset.go:153
volcano.sh/volcano/test/e2e/jobp.TestMain(0x1c51e00?)
	/home/runner/work/volcano/volcano/test/e2e/jobp/main_test.go:35 +0x67
main.main()
	_testmain.go:83 +0x1e6
FAIL	volcano.sh/volcano/test/e2e/jobp	0.023s
E0516 02:53:19.986155   39760 utils.go:43] init kubeclient in 4pdvgpu failed: stat /home/runner/.kube/config: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1643a3d]

this does not happen when tests are run locally, do i need to add some config secret/file? what do you think?

@lowang-bh
Copy link
Member Author

lowang-bh commented May 16, 2024

I think we can intall Codecov Report App as karmada do in pr karmada-io/karmada#4950.

@Monokaix @william-wang

To install the app: https://github.com/apps/codecov/installations/select_target

@lowang-bh
Copy link
Member Author

this does not happen when tests are run locally, do i need to add some config secret/file? what do you think?

I think this is a issue. We'd better not to use a kubeconfig file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants