Skip to content

Commit

Permalink
test: Add RAG and other Python UT coverage to the codecov report (#815)
Browse files Browse the repository at this point in the history
**Reason for Change**:

Add RAG and other Python code UT coverage to the codecov report to
ensure that the RAG server changes for consistency are tested and the
code coverage is reported accurately.

**Requirements**

- [ ] added unit tests and e2e tests (if applicable).

**Issue Fixed**:
<!-- If this PR fixes GitHub issue 4321, add "Fixes #4321" to the next
line. -->

**Notes for Reviewers**:

---------

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
  • Loading branch information
helayoty authored Jan 10, 2025
1 parent 5ad5cae commit b4d9a85
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/unit-tests-ragengine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ jobs:
- name: Run unit tests
run: |
make rag-service-test
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
2 changes: 2 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ jobs:
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: ${{ env.GO_VERSION }}

- name: Generate APIs
run: |
make generate
- name: Run unit tests & Generate coverage
run: |
make unit-test
Expand Down
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,24 @@ unit-test: ## Run unit tests.
.PHONY: rag-service-test
rag-service-test:
pip install -r presets/ragengine/requirements.txt
pytest -o log_cli=true -o log_cli_level=INFO presets/ragengine/tests
pip install pytest-cov
pytest --cov -o log_cli=true -o log_cli_level=INFO presets/ragengine/tests

.PHONY: tuning-metrics-server-test
tuning-metrics-server-test:
pip install -r ./presets/workspace/dependencies/requirements-test.txt
pytest -o log_cli=true -o log_cli_level=INFO presets/workspace/tuning/text-generation/metrics
pip install pytest-cov
pytest --cov -o log_cli=true -o log_cli_level=INFO presets/workspace/tuning/text-generation/metrics

## --------------------------------------
## E2E tests
## --------------------------------------

inference-api-e2e:
pip install -r ./presets/workspace/dependencies/requirements-test.txt
pytest -o log_cli=true -o log_cli_level=INFO presets/workspace/inference/vllm
pytest -o log_cli=true -o log_cli_level=INFO presets/workspace/inference/text-generation
pip install pytest-cov
pytest --cov -o log_cli=true -o log_cli_level=INFO presets/workspace/inference/vllm
pytest --cov -o log_cli=true -o log_cli_level=INFO presets/workspace/inference/text-generation

# Ginkgo configurations
GINKGO_FOCUS ?=
Expand Down Expand Up @@ -241,8 +244,8 @@ docker-build-ragengine: docker-buildx
--tag $(REGISTRY)/$(RAGENGINE_IMG_NAME):$(RAGENGINE_IMG_TAG) .

.PHONY: docker-build-rag-service
docker-build-ragservice: docker buildx
docker buildx build \
docker-build-ragservice: docker-buildx
docker buildx build \
--platform="linux/$(ARCH)" \
--output=$(OUTPUT_TYPE) \
--file ./docker/ragengine/service/Dockerfile \
Expand Down
Empty file added codecov.yml
Empty file.

0 comments on commit b4d9a85

Please sign in to comment.