Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
codecov:
require_ci_to_pass: true

coverage:
precision: 2
round: down
range: "50...70"

status:
project:
default:
informational: true
target: auto
threshold: 1%
patch:
default:
informational: true
target: 70%

comment:
layout: "reach,diff,flags,files,footer"
behavior: default
require_changes: false
require_base: false
require_head: true
show_carryforward_flags: true

flags:
python-unit:
paths:
- sdk/python/feast/
carryforward: true
go-feature-server:
paths:
- go/
carryforward: true

ignore:
- "sdk/python/tests/**"
- "**/*_pb2.py"
- "**/*_pb2_grpc.py"
- "sdk/python/feast/protos/**"
- "sdk/python/feast/embedded_go/**"
- "protos/**"
- "docs/**"
- "ui/**"
- "java/**"
- "infra/feast-operator/test/**"
59 changes: 59 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,68 @@ jobs:
fi

make test-python-unit
- name: Upload Python coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
file: ./coverage.xml
flags: python-unit
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Minimize uv cache
run: uv cache prune --ci

unit-test-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: x64
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y make protobuf-compiler libsqlite3-dev
- name: Install Go proto plugins
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- name: Compile Go protobufs
run: make compile-protos-go
- name: Create virtual environment
run: |
uv venv
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH
- name: Install feast locally
run: make install-feast-locally
- name: Run Go tests with coverage
run: |
CGO_ENABLED=1 go test \
-coverprofile=go/coverage.out \
-covermode=atomic \
-skip "TestGetOnlineFeatures|TestSqliteOnlineRead" \
./go/...
- name: Upload Go coverage to Codecov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
file: ./go/coverage.out
flags: go-feature-server
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

unit-test-ui:
runs-on: ubuntu-latest
env:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ benchmark-python-local: ## Run integration + benchmark tests for Python (local d

test-python-unit: ## Run Python unit tests (use pattern=<pattern> to filter tests, e.g., pattern=milvus, pattern=test_online_retrieval.py, pattern=test_online_retrieval.py::test_get_online_features_milvus)
uv run python -m pytest -n 8 --color=yes $(if $(pattern),-k "$(pattern)") \
--cov=feast \
--cov-report=xml \
--cov-report=term-missing \
sdk/python/tests/unit

# Fast unit tests only
Expand Down
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ dbt = ["dbt-artifacts-parser"]
test = [
"pytest>=6.0.0,<8",
"pytest-xdist>=3.8.0",
"pytest-cov>=5.0.0",
"pytest-timeout==1.4.2",
"pytest-lazy-fixture==0.6.3",
"pytest-ordering~=0.6.0",
Expand Down Expand Up @@ -335,3 +336,28 @@ test-ci = { cmd = "python -m pytest -n auto --dist loadgroup --integration sdk/p
duckdb-tests = ["py310", "duckdb-tests"]
ray-tests = ["py310", "ray-tests"]
registration-tests = ["py310", "registration-tests"]

[tool.coverage.run]
branch = true
source = ["feast"]
omit = [
"*/tests/*",
"*/protos/*",
"*_pb2.py",
"*_pb2_grpc.py",
"feast/embedded_go/*",
]

[tool.coverage.report]
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"pass$",
]

[tool.coverage.xml]
output = "coverage.xml"
Loading