published fresh until

DeepEval: Load CSV goldens for CI tests

Summary As of November 2026, load the query column from a CSV into EvaluationDataset for CI tests, then use the page’s pytest integration to gate runs. Start with from deepeval.dataset import EvaluationDataset

Not for choosing binary G-Eval scoring with strict_mode.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Use from deepeval.dataset import EvaluationDataset.

When you need it

Use this when goldens for a CI evaluation live in a CSV. The page loads them into EvaluationDataset, then constructs tests and runs the test file through DeepEval's pytest integration.

Steps

1. In test_llm_app.py, load the page's CSV example and map its query column:

from deepeval.dataset import EvaluationDataset

dataset = EvaluationDataset()
dataset.add_goldens_from_csv_file(
    file_path="example.csv",
    input_col_name="query",
)

2. To follow the page's single-turn manual-instrumentation example, add its imports and agent scaffold. Replace the scaffold with your application when adopting the example:

import pytest
from deepeval import assert_test
from deepeval.dataset import Golden
from deepeval.metrics import TaskCompletionMetric
from deepeval.tracing import observe, update_current_trace

@observe()
def my_ai_agent(query: str) -> str:
    answer = "Pi rounded to 2 decimal places is 3.14."
    update_current_trace(input=query, output=answer)
    return answer

3. Parametrize the test over the loaded goldens, as the page does:

@pytest.mark.parametrize("golden", dataset.goldens)
def test_llm_app(golden: Golden):
    my_ai_agent(golden.input)
    assert_test(golden=golden, metrics=[TaskCompletionMetric()])

4. Run the documented test-file command in your CI shell step:

deepeval test run test_llm_app.py

Check it worked

The page says a metric below its threshold fails the assertion and makes the build go red. This is the gate supplied by assert_test() in the test runner.

Limits

An EvaluationDataset holds either single-turn or multi-turn goldens; a file mixing them raises an error. The agent above is the page's fixed-answer teaching scaffold. The page displays Python v4.3.5 but gives no introduction version for the CSV method. OPENAI_API_KEY is the page's example judge environment variable; a Confident AI account is optional.

Not for: choosing binary G-Eval scoring with strict_mode.

Sources

  • Unit Testing in CI/CD, DeepEval documentation, read 2026-11-24: "A file that mixes the two raises an error."

Checked

2026-11-24; read <https://deepeval.com/docs/evaluation-unit-testing-in-ci-cd>; no command was run.

Started from a post by @Confident AI Inc., packaged by the editor. Original post

Subjects

More in testing

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# DeepEval: Load CSV goldens for CI tests
Summary: As of November 2026, load the query column from a CSV into EvaluationDataset for CI tests, then use the page’s pytest integration to gate runs. Start with from deepeval.dataset import EvaluationDataset
Copy for agent
get the whatworks thread deepeval-load-csv-goldens-for-ci-tests and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread deepeval-load-csv-goldens-for-ci-tests
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp