From 9db053bdfc3e060b48c3bce3d47c528742e1b9c8 Mon Sep 17 00:00:00 2001 From: carlory Date: Mon, 18 Aug 2025 11:18:34 +0800 Subject: [PATCH] Add test coverage to test-unit Makefile target Signed-off-by: carlory --- .github/workflows/ci-pr-checks.yaml | 10 ++++++++++ Makefile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-pr-checks.yaml b/.github/workflows/ci-pr-checks.yaml index b86c806c..6c07ca43 100644 --- a/.github/workflows/ci-pr-checks.yaml +++ b/.github/workflows/ci-pr-checks.yaml @@ -47,6 +47,16 @@ jobs: run: | make test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 + with: + fail_ci_if_error: true + files: go-test-coverage.out + name: codecov-llm-d-inference-scheduler + verbose: true + # https://github.com/codecov/codecov-action/issues/1594#issuecomment-2394913029 + use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }} + - name: Run make build shell: bash run: | diff --git a/Makefile b/Makefile index f84aa367..e7911025 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ test: test-unit .PHONY: test-unit test-unit: download-tokenizer download-zmq @printf "\033[33;1m==== Running Unit Tests ====\033[0m\n" - go test -ldflags="$(LDFLAGS)" -v ./... + go test -ldflags="$(LDFLAGS)" -v -covermode=atomic -coverprofile=go-test-coverage.out ./... .PHONY: test-integration test-integration: download-tokenizer download-zmq