Skip to content

test: add unit tests for evaluation metrics module#250

Open
YASHBHIWANIA wants to merge 2 commits intoThe-OpenROAD-Project:masterfrom
YASHBHIWANIA:feat/add-evaluation-metrics-tests
Open

test: add unit tests for evaluation metrics module#250
YASHBHIWANIA wants to merge 2 commits intoThe-OpenROAD-Project:masterfrom
YASHBHIWANIA:feat/add-evaluation-metrics-tests

Conversation

@YASHBHIWANIA
Copy link

Summary

The evaluation metrics module (auto_evaluation/src/metrics/) had
zero test coverage. This PR adds a comprehensive unit test suite
covering all metric factory functions.

Changes

  • Added evaluation/auto_evaluation/tests/test_metrics.py with
    30 unit tests covering:
    • retrieval.py — contextual precision, recall, hallucination
      metrics + NotImplementedError cases for protobuf-incompatible
      metrics
    • content.py — answer relevancy, bias, toxicity metrics
    • geval.py — correctness GEval metric
    • Threshold constant validation (all values in [0.0, 1.0] range)
  • Added evaluation/auto_evaluation/tests/conftest.py to configure
    correct Python path for test discovery

Test Results

30 passed in 0.15s

Why this matters

These tests document expected behavior of metric factory functions,
catch regressions when upgrading deepeval, and explicitly document
two known broken metrics (ContextualRelevancy and Faithfulness)
due to protobuf incompatibility.

Relates to #248

Signed-off-by: YASHBHIWANIA <yashbhiwania772@gmail.com>
@YASHBHIWANIA YASHBHIWANIA force-pushed the feat/add-evaluation-metrics-tests branch from 5381d1b to c4a2d47 Compare March 18, 2026 18:50
Signed-off-by: YASHBHIWANIA <yashbhiwania772@gmail.com>
@YASHBHIWANIA YASHBHIWANIA force-pushed the feat/add-evaluation-metrics-tests branch from c4a2d47 to b0883c1 Compare March 18, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant