TAF is the primary test automation framework for Couchbase Server and Capella. It validates KV, NS Server, Magma storage, Fusion storage, Columnar analytics, and cross-component functionality across on-premise, dedicated, and serverless environments.
- Python 3.10+ (recommended 3.10.14)
- Couchbase Server cluster (or Capella access)
- SSH access to cluster nodes (for on-premise)
- Git submodules initialized
# Initialize submodules
git submodule init
git submodule update --init --force --remote
# Install dependencies (Python 3.10.14 required)
python -m pip install -r requirements.txtFor contributors and developers working on TAF codebase:
# Install development dependencies (linting, type checking, hooks)
python -m pip install -r requirements-dev.txt
# Install pre-commit hooks (one-time setup after clone)
pre-commit install
# Optional: Install npm tools for additional checks
npm install -g jscpd # Duplicate code detectionPre-commit hooks run automatically on commit:
- Unit tests (blocks commit on failure)
- Ruff linter (auto-fixes issues)
- Ruff formatter (checks formatting)
- Mypy type checker (informational)
- Large file detection (1MB limit)
- Merge conflict detection
- AGENTS.md validation
Manual checks:
# Run all hooks manually
pre-commit run --all-files
# Run specific hook
pre-commit run ruff --all-files
pre-commit run mypy --all-files
pre-commit run unit-test --all-files# Run from test suite configuration
python testrunner.py -i node.ini -c conf/sanity.conf -p get-cbcollect-info=True
# Run individual test
python testrunner.py -i node.ini -t epengine.basic_ops.basic_ops.test_doc_size,nodes_init=1The framework supports multiple document loading options for test data generation.
Document Loading Options:
load_docs_using=default_loader– Uses built-in Python SDK loader (default value)load_docs_using=sirius_java_sdk– Uses Sirius Java SDK for document operations via DocLoaderload_docs_using=sirius_go_sdk– Uses Sirius Go SDK for document operations via sirius submodule
Launch DocLoader within test:
# Start Java-based REST doc loader and use sirius_java_sdk for document loading
python testrunner.py -c conf/sanity.conf -i node.ini -p rerun=False,get-cbcollect-info=False,skip_cluster_reset=True,load_docs_using=sirius_java_sdk --launch_java_doc_loader --sirius_url http://localhost:<port_num>Key parameters:
load_docs_using=default_loader– Use built-in Python SDK (default, requires no additional flags)load_docs_using=sirius_java_sdk– Use Sirius Java SDK for document operations (requires--launch_java_doc_loader)load_docs_using=sirius_go_sdk– Use Sirius Go SDK for document operations via sirius submodule--launch_java_doc_loader– Flag to launch Java DocLoader process within test execution--launch_sirius_process– Flag to launch Sirius Go client process within test execution--launch_sirius_docker– Flag to launch Sirius Go client in Docker within test execution--sirius_url <url>– DocLoader or Sirius endpoint URL (e.g., http://localhost:8080)
Manual DocLoader execution (separate process):
# Start DocLoader standalone (in DocLoader directory)
cd DocLoader
mvn install
java -cp ./target/magmadocloader/magmadocloader.jar RestServer.RestApplication --server.port=<port_num>
# Then run TAF without --launch_java_doc_loader
python testrunner.py -c conf/sanity.conf -i node.ini -p load_docs_using=sirius_java_sdktestrunner.py- Main test runner with unittest framework and command-line parsingpytests/basetestcase.py- Base test case factory that selects appropriate base class
The runtype parameter determines test environment:
default: UsesOnPremBaseTest– on-premise Couchbase Servercolumnar: UsesColumnarBaseTest– Columnar analytics servicededicated: UsesProvisionedBaseTestCase– dedicated cloud clustersserverless: UsesOnCloudBaseTest– Capella serverless
pytests/ – Test implementation (all test code must go here)
basetestcase.py– Base test class selector based on runtype- Component directories:
epengine/,cbas/,security/,storage/,upgrade/, etc.
lib/ – Core framework libraries
sdk_client3.py– Python SDK client wrappercouchbase_helper/– Cluster operations, document generatorsBucketLib/– Bucket operations via REST APICbasLib/– Columnar/Analytics operationsframework_lib/– Test runner utilities and command-line parserJython_tasks/– Jython task execution frameworkSystemEventLogLib/– System event log validation
couchbase_utils/ – Feature-specific utilities
cb_server_rest_util/– Direct Couchbase REST API mappingssecurity_utils/– Security operations (TLS, encryption, certificates)bucket_utils/– Bucket management helpersupgrade_utils/,rebalance_utils/, etc.
platform_utils/ – Infrastructure utilities
ssh_util/– Paramiko-based SSH session managementerror_simulation/– Network and system error simulation
conf/ – Test suite configurations
<component>/test.conf– Test selections and parametersnode.ini– Cluster topology and credentials
py_constants/ – Test constants
cb_constants/CBServer.py– Server version mappingscb_constants/system_event_log.py– Event log schemas
TAF follows PEP8 naming conventions enforced by ruff:
- Functions/Methods:
snake_case(e.g.,test_document_crud,create_bucket) - Variables:
snake_case(e.g.,bucket_name,doc_count) - Constants:
UPPER_SNAKE_CASE(e.g.,MAX_RETRIES,DEFAULT_TIMEOUT) - Classes:
PascalCase(e.g.,OnPremBaseTest,BucketUtils) - Module names:
snake_case(e.g.,bucket_utils.py,cluster_ready_functions.py) - Private members:
_leading_underscore(e.g.,_internal_method) - Test methods:
test_prefix withsnake_case(e.g.,test_rebalance_after_failover)
Exceptions for Unittest compatibility:
setUp,tearDown,setUpClass,tearDownClassare allowed- MixedCase variables in existing code are tolerated but new code should use snake_case
- Tests must live in
pytests/directory - Inherit from appropriate base class based on component
- Use
TestInputSingleton.input.param()to access parameters - Follow PEP8 standards (see
agents/test-agent.md)
.inifiles define cluster topology and credentials.conffiles list test modules with parameters Format:module.class.test_method,param1=value1,param2=value2
# From .ini or command line
TestInputSingleton.input.test_params['get-cbcollect-info'] = True
# In test code
from TestInput import TestInputSingleton
param_value = TestInputSingleton.input.param("param_name", default_value)from sdk_client3 import SDKClient # Python SDK operations
from couchbase_utils(cb_server_rest_util) import * # REST API calls
from couchbase_utils(bucket_utils) import * # Bucket helpersBefore completion, ensure:
- Tests follow existing patterns in component directories
- No hard-coded credentials or secrets
- Proper cleanup in tearDown methods
- Runtype parameter is respected
- Test failures analyzed with root cause explanation
- Do NOT modify git submodules:
DocLoader/– Java-based document generator (maintained separately)lib/capellaAPI/– Capella REST API libraries (maintained separately)sirius/– Go-based document client framework (maintained separately)
- All test code belongs in
pytests/directories - Never hard-code cloud identities or API keys
- Test failures must include detailed analysis
agents/ is the canonical location for all agent definitions and skills:
agents/
<name>.md – feature-specific agents live directly here
skills/ – general-purpose utility skills (e.g., source-attribution)
.factory/droids/ and .factory/skills/ contain @-reference files pointing into agents/ — do not edit files there directly.
- Create
agents/<name>.mdwith YAML frontmatter:--- name: your-agent-name description: What this agent specializes in model: inherit ---
- Create
.factory/droids/<name>.mdcontaining:@agents/<name>.md
- Create
agents/skills/<name>.mdwith YAML frontmatter:--- name: your-skill-name description: What this skill does ---
- Register in
.claude/settings.jsonunderskills - Create
.factory/skills/<name>/SKILL.mdcontaining:@agents/skills/<name>.md - Add an entry to
agents/skills/AGENTS.md
See agents/AGENTS.md for the full list of agents and skills.
- Repo Inventory – Detailed component breakdown
- Build Test Matrix – Execution commands by component
- Domain Glossary – Couchbase and TAF terminology
- Troubleshooting Guide – Common issues and solutions
- Test-Agent Skill – Test writing guidance and constraints
- If asked about KV or data-service or epengine: refer to docs/agent-context/data-service/AGENTS.md
- Test coverage: pytests/epengine/AGENTS.md, pytests/castest/AGENTS.md, pytests/subdoc/AGENTS.md
- If asked about NS Server or Cluster-manager: refer to docs/agent-context/ns-server/AGENTS.md
- Test coverage: pytests/upgrade/AGENTS.md
- If asked about Couchbase REST API, REST endpoints, or cb_server_rest_util: refer to couchbase_utils/cb_server_rest_util/AGENTS.md
- If asked about couchbase_utils, bucket_utils, cluster_utils, security_utils, cb_tools, backup_utils, xdcr_utils, rebalance_utils, upgrade_utils, eventing_utils, fts_utils, index_utils, dcp_utils, cbas_utils, capella_utils, sdk_utils, storage_utils, rbac_utils, node_utils, kafka_util, nfs_utils, tpch_utils, transaction_utils, or delta_lake_util: refer to couchbase_utils/AGENTS.md
- Task framework built on top of these utils: lib/Jython_tasks/AGENTS.md
- If asked about epengine tests, KV durability, collection CRUD, bucket-level durability, CAS ops, OOO returns, rate limiting, or secondary warmup: refer to pytests/epengine/AGENTS.md
- Component background: docs/agent-context/data-service/AGENTS.md
- If asked about subdoc tests, XATTR tests, or sub-document operations: refer to pytests/subdoc/AGENTS.md
- Component background: docs/agent-context/data-service/AGENTS.md
- If asked about castest or CAS value correctness tests: refer to pytests/castest/AGENTS.md
- Component background: docs/agent-context/data-service/AGENTS.md
- If asked about upgrade tests, mixed-mode cluster, storage migration, upgrade chain, or cluster_features guards: refer to pytests/upgrade/AGENTS.md
- Component background: docs/agent-context/ns-server/AGENTS.md, couchbase_utils/AGENTS.md
- If asked about Sirius Java SDK, DocLoader, SiriusCouchbaseLoader,
java_loader_tasks.py, orload_docs_using=sirius_java_sdk: refer to lib/Jython_tasks/AGENTS.md- Utility layer: couchbase_utils/AGENTS.md