Skip to content
Merged
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
2 changes: 2 additions & 0 deletions docs/cookbooks/batch-evaluation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ def find_failures(results: List[EvalTask]) -> List[Dict]:

### Generating Reports

> **Tip:** For pytest-based batch runs, you can use the built-in `--fe-output` flag to export results as JSON or HTML without writing custom reporting code. See [Output Collectors](/docs/advanced/output-collectors) for details.

```python
# reporting.py
import json
Expand Down
28 changes: 27 additions & 1 deletion docs/core-concepts/pytest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ sidebar:
anchor: running-tests
- title: Understanding Output
anchor: understanding-output
- title: Exporting Results
anchor: exporting-results
- title: Fixtures
anchor: fixtures
- title: CI/CD Integration
Expand Down Expand Up @@ -74,6 +76,23 @@ Evaluation Results:
be perceived as unhelpful or rude.
```

### Exporting Results

You can export evaluation results to JSON or HTML, or print a summary table to the console:

```bash
# Export as JSON
pytest tests/ --fe-output json:results.json

# Export as HTML report
pytest tests/ --fe-output html:report.html

# Print a summary table after the run
pytest tests/ --fe-summary
```

For full details on output formats, custom reporters, and programmatic access, see [Output Collectors](/docs/advanced/output-collectors).

## Configuration

### Using pyproject.toml (Recommended)
Expand Down Expand Up @@ -202,7 +221,14 @@ jobs:
- name: Run evaluations
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: pytest tests/ -v --tb=short
run: pytest tests/ -v --tb=short --fe-output json:results.json --fe-summary

- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: evaluation-results
path: results.json
```

### Separating Fast and Slow Tests
Expand Down
1 change: 1 addition & 0 deletions docs/getting-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,5 @@ You've got the fundamentals down. Here's where to go deeper:
- **Evaluate RAG pipelines** — [RAG Metrics](/docs/rag-metrics/faithfulness)
- **Build custom metrics** — [Custom Metrics](/docs/advanced/custom-metrics)
- **Set up CI/CD** — [CI/CD Setup](/docs/cookbooks/ci-cd-setup)
- **Export results** — [Output Collectors](/docs/advanced/output-collectors) for JSON, HTML reports, and custom formats
- **Monitor production** — [fasteval-observe](/docs/plugins/observe/overview)
Loading