NeMo-Agent-Toolkit / nat-tests
Cursor rule2.7k starsChanged 16 months agoApache-2.0View on GitHub
Follow these rules when the user's request involves writing, creating, or modifying integration tests for NeMo Agent Toolkit workflows
- Reads credentials
Trending
Quiet since August.about the whole repository
Who's talking about NVIDIA/NeMo-Agent-Toolkit
- awslabs/agentcore-samples“02-use-cases - TypeError: _patch_asyncio.<locals>.run() got an unexpected keyword argument 'loop_factory'”GitHub · Sep 29, 2025 · 3 reactions
- NVIDIA-AI-Blueprints/deep-researcher-agent“feat: add exa_web_search data source”GitHub · Apr 14, 2026 · 2 reactions
- astral-sh/uv“Stabilize conflicting modules warning”GitHub · Aug 18, 2025 · 1 reactions
- olga-mir/experiments“68 moaar agents and design canvas”GitHub · Aug 23, 2026
- LennyMalcolm0/langchain“ChatOpenAI/ChatAnthropic: request_timeout=None (default) disables SDK timeout, causing infinite hangs”GitHub · Jul 17, 2026
The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 15
Talked about on GitHub (15 times).
On GitHub · 15
- Sep 29, 202502-use-cases - TypeError: _patch_asyncio.<locals>.run() got an unexpected keyword argument 'loop_factory' — awslabs/agentcore-samples3 reactions · 5 comments
- Apr 14, 2026feat: add exa_web_search data source — NVIDIA-AI-Blueprints/deep-researcher-agent2 reactions · 7 comments
- Aug 18, 2025Stabilize conflicting modules warning — astral-sh/uv1 reaction · 2 comments
- Aug 23, 202668 moaar agents and design canvas — olga-mir/experiments0 reactions
- Jul 17, 2026ChatOpenAI/ChatAnthropic: request_timeout=None (default) disables SDK timeout, causing infinite hangs — LennyMalcolm0/langchain0 reactions
10 more on GitHub
- Jun 3, 2026ChatNVIDIA forwards verify_ssl into chat completion payload — langchain-ai/langchain-nvidia0 reactions
- May 22, 2026[BUZZOK-30879] streaming memory agent plugin — datarobot-oss/datarobot-genai0 reactions · 1 comment
- May 2, 2026feat(learning): add expected-output assertions + accuracy scoring to batch-runner (NeMo parity) — subinium/CrowClaw0 reactions · 1 comment
- Apr 14, 2026[Question] when an A2A server has OAuth enabled, how does the A2A client know how to generate the corresponding token? — a2aproject/A2A0 reactions · 4 comments
- Apr 2, 2026Enable eager authentication — NVIDIA/NeMo-Agent-Toolkit-UI0 reactions · 5 comments
- Apr 2, 2026Enable redirect-based OAuth flow — NVIDIA/NeMo-Agent-Toolkit-UI0 reactions · 3 comments
- Mar 6, 2026ChatOpenAI/ChatAnthropic: request_timeout=None (default) disables SDK timeout, causing infinite hangs — langchain-ai/langchain0 reactions · 8 comments
- Mar 6, 2026Add agent thought process outputs — NVIDIA/NeMo-Agent-Toolkit-UI0 reactions · 4 comments
- Jan 29, 2026Add sandbox agent example with Docker and Daytona support — NVIDIA/NeMo-Agent-Toolkit-Examples0 reactions · 16 comments
- Oct 24, 2025Add support for exporting telemetry to DBNL — dbnlAI/NeMo-Agent-Toolkit0 reactions
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository38 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/nat-agent-configuration/references/agents.mdAGENTS.md
- .cursor/rules/cursor-rules.mdcCursor rule
- .cursor/rules/documentation/capitalization.mdcCursor rule
- .cursor/rules/documentation/categories.mdcCursor rule
- .cursor/rules/documentation/formatting.mdcCursor rule
- .cursor/rules/documentation/general.mdcCursor rule
- .cursor/rules/documentation/latinisms.mdcCursor rule
- .cursor/rules/documentation/lists-and-tables.mdcCursor rule
- .cursor/rules/documentation/numbers-and-dates.mdcCursor rule
- .cursor/rules/documentation/punctuation.mdcCursor rule
- .cursor/rules/documentation/voice-and-tone.mdcCursor rule
- .cursor/rules/documentation/writing-process.mdcCursor rule
- .cursor/rules/general.mdcCursor rule
- .cursor/rules/nat-agents/general.mdcCursor rule
- .cursor/rules/nat-cli/general.mdcCursor rule
- .cursor/rules/nat-cli/nat-eval.mdcCursor rule
- .cursor/rules/nat-cli/nat-info.mdcCursor rule
- .cursor/rules/nat-cli/nat-run-serve.mdcCursor rule
- .cursor/rules/nat-cli/nat-workflow.mdcCursor rule
- .cursor/rules/nat-setup/general.mdcCursor rule
- .cursor/rules/nat-setup/nat-toolkit-installation.mdcCursor rule
- .cursor/rules/nat-tests/general.mdcCursor rule
- .cursor/rules/nat-tests/nat-test-llm.mdcCursor rule
- .cursor/rules/nat-workflows/add-functions.mdcCursor rule
- .cursor/rules/nat-workflows/add-tools.mdcCursor rule
- .cursor/rules/nat-workflows/general.mdcCursor rule
- nat-agent-configurationSkill
- nat-evaluationSkill
- nat-installationSkill
- nat-mcp-and-servingSkill
- nat-optimizationSkill
- nat-path-checksSkill
- nat-telemetrySkill
- nat-tools-and-functionsSkill
- nat-user-rulesSkill
- nat-workflow-creationSkill
- skill-evolutionSkill
The file
Show its rules and text
We split this integration-tests.mdc into the rules it gives an agent
17 rules. About 0 are common, 9 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Follow these rules when writing integration tests for NeMo Agent Toolkit workflows.
- Distinctive: line 13
Every integration test MUST include the decorators:
- Very specific: line 150
Use scope="session" for service fixtures
- Very specific: line 154
Add new services to tests/test_data/docker-compose.services.yml
- Very specific: line 160
Use @pytest.mark.integration decorator, and optionally the @pytest.mark.slow decorator for slow tests
- Very specific: line 161
Use @pytest.mark.usefixtures() for required API keys
- Very specific: line 162
Use locate_example_config() for workflows with config classes
- Very specific: line 163
Use run_workflow() for consistent test execution
- Distinctive: line 164
Use simple, predictable questions and expected answers
- Distinctive: line 166
Import test utilities within test functions (not module level)
- Distinctive: line 168
Use session-scoped fixtures for services
- Distinctive: line 169
Use lazy imports in fixtures for optional dependencies
- Distinctive: line 174
Use complex questions with unpredictable LLM responses
- Distinctive: line 175
Import third-party service libraries at module level in fixtures
- Distinctive: line 176
Use function scope for service fixtures (use session scope)
- Very specific: line 178
Add @pytest.mark.asyncio decorator - async tests are automatically detected and run by the async runner
- Very specific: line 198
Test utilities and fixtures: packages/nvidia_nat_test/src/nat/test/plugin.py
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: Follow these rules when the user's request involves writing, creating, or modifying integration tests for NeMo Agent Toolkit workflows
globs:
alwaysApply: false
---
# Integration Testing Guidelines
Follow these rules when writing integration tests for NeMo Agent Toolkit workflows.
## Required Test Structure
Every integration test MUST include the decorators:
```python
@pytest.mark.integration
async def test_workflow():
from nat.test.utils import locate_example_config, run_workflow
from workflow_package.register import WorkflowConfig
config_file = locate_example_config(WorkflowConfig)
await run_workflow(config_file=config_file, question="test", expected_answer="answer")
```
### Decorator Purposes
- `@pytest.mark.slow` - Tests taking longer than 30 seconds
- `@pytest.mark.integration` - Tests requiring external services or API keys
- `@pytest.mark.usefixtures(...)` - Ensures required fixtures are available
## API Key Fixtures
Available from `nvidia-nat-test` package:
- `nvidia_api_key`, `openai_api_key`, `tavily_api_key`
- `mem0_api_key`, `azure_openai_api_key`
- `serp_api_key`, `serperdev_api_key`
Multiple fixtures: `@pytest.mark.usefixtures("nvidia_api_key", "tavily_api_key")`
## Test Utility Functions
### locate_example_config()
Locates configuration files relative to workflow configuration class:
```python
from nat.test.utils import locate_example_config
config_file = locate_example_config(WorkflowConfig) # finds config.yml
config_file = locate_example_config(WorkflowConfig, "config-alt.yml")
```
### run_workflow()
Runs workflow and validates expected answer:
```python
from nat.test.utils import run_workflow
# Basic usage - case-insensitive matching
await run_workflow(
config_file=config_file,
question="What are LLMs?",
expected_answer="Large Language Model"
)
# Custom validation
result = await run_workflow(
config_file=config_file,
question="What are LLMs?",
expected_answer="",
assert_expected_answer=False
)
assert "large language model" in result.lower()
# Using config object instead of file
from nat.runtime.loader import load_config
config = load_config(config_file)
config.retrievers['retriever'].uri = HttpUrl(url=service_uri)
await run_workflow(config=config, question="...", expected_answer="...")
```
## Workflows Without Configuration Classes
For YAML-only workflows:
```python
from pathlib import Path
config_file = Path(__file__).parent / "configs/config.yml"
await run_workflow(config_file=config_file, question="...", expected_answer="...")
```
## Service Fixtures
Available service fixtures that ensure services are running:
- `milvus_uri`, `etcd_url`, `redis_url`
- `mysql_connection_info`, `opensearch_url`
- `phoenix_url`, `minio_client`
Example:
```python
@pytest.mark.slow
@pytest.mark.integration
@pytest.mark.usefixtures("nvidia_api_key")
async def test_workflow(milvus_uri: str):
from pydantic import HttpUrl
from nat.runtime.loader import load_config
from nat.test.utils import locate_example_config, run_workflow
config_file = locate_example_config(WorkflowConfig)
config = load_config(config_file)
config.retrievers['retriever'].uri = HttpUrl(url=milvus_uri)
await run_workflow(config=config, question="test", expected_answer="answer")
```
## Creating Custom Service Fixtures
Pattern for new service fixtures:
```python
import os
import pytest
@pytest.fixture(name="service_uri", scope="session")
def service_uri_fixture(fail_missing: bool = False) -> str:
"""Ensure service is running and provide connection URI."""
host = os.getenv("NAT_CI_SERVICE_HOST", "localhost")
port = os.getenv("NAT_CI_SERVICE_PORT", "1234")
uri = f"http://{host}:{port}"
try:
# Lazy import - optional dependency
from service_library import ServiceClient
ServiceClient(uri=uri).ping()
return uri
except Exception:
reason = f"Unable to connect to Service at {uri}"
if fail_missing:
raise RuntimeError(reason)
pytest.skip(reason=reason)
```
Key practices:
- Use `scope="session"` for service fixtures
- Lazy import service libraries inside fixture
- Allow configuration via environment variables, prefixed with `NAT_CI_`
- Skip tests if service unavailable (unless `--fail_missing`)
- Add new services to `tests/test_data/docker-compose.services.yml`
## Best Practices
### DO
- Use `@pytest.mark.integration` decorator, and optionally the `@pytest.mark.slow` decorator for slow tests
- Use `@pytest.mark.usefixtures()` for required API keys
- Use `locate_example_config()` for workflows with config classes
- Use `run_workflow()` for consistent test execution
- Use simple, predictable questions and expected answers
- Override config values to use test service URIs from fixtures
- Import test utilities within test functions (not module level)
- Make tests async with `async def`
- Use session-scoped fixtures for services
- Use lazy imports in fixtures for optional dependencies
### DON'T
- Hard-code service URLs (use fixtures instead)
- Use complex questions with unpredictable LLM responses
- Import third-party service libraries at module level in fixtures
- Use function scope for service fixtures (use session scope)
- Fail tests when services are unavailable (skip them instead)
- Add `@pytest.mark.asyncio` decorator - async tests are automatically detected and run by the async runner
## Running Integration Tests
```bash
# Set API keys
export NVIDIA_API_KEY=<key>
# Start services
docker compose -f tests/test_data/docker-compose.services.yml up -d
# Run tests
pytest --run_slow --run_integration
# Clean up
docker compose -f tests/test_data/docker-compose.services.yml down
```
## Reference
- Test utilities and fixtures: `packages/nvidia_nat_test/src/nat/test/plugin.py`
- Docker Compose services: `tests/test_data/docker-compose.services.yml`
- Full documentation: [Running Tests](mdc:docs/source/resources/running-tests.md)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

