Sequoia is a scalable Docker-based testing framework for Couchbase server components. It provisions infrastructure via Docker containers and runs integration tests across various Couchbase services (Analytics, Eventing, FTS, N1QL, Views, XDCR, SDK, Mobile, and more).
Build the sequoia binary:
go mod tidy
go build -o sequoiaRun a test:
./sequoiaRun with custom scope/test:
./sequoia -scope tests/simple/scope_medium.yml -test tests/simple/test_views.ymlBuild Docker containers:
./build.sh # builds all framework containersBuild specific container:
docker build -t sequoiatools/testrunner containers/testrunnerRun with Docker network (experimental):
./sequoia -scope tests/simple/scope_medium.yml -test tests/simple/test_views.yml --network cblrun.go- CLI entry point (package main, imports fromlib/)lib/- Core Go framework (package sequoia)test.go- Test runner and action executionscope.go- Infrastructure provisioning and configurationprovider.go- Docker/File/Dev/Swarm provider implementationsspec.go- YAML spec structures for servers, buckets, users, actionscontainer.go- Docker container lifecycle managementrest.go- REST API client for Couchbase servicestemplate.go- Template rendering for test YAMLflags.go- CLI flag definitionshostserializer.go- Host serialization tohosts.jsoncommon.go- Shared utilities
containers/- Docker test frameworkstestrunner/- Python-based test framework (submodule: github.com/couchbase/testrunner)perfrunner/- Performance testing frameworkcouchbase/,couchbase-cli/- Couchbase server and CLI toolsftsindexmanager/- FTS and vector search utilities (Go and Python loaders)- Service-specific containers:
eventing/,analytics/,xdcr/,sgw/,gideon/,pillowfight/,catapult/, etc.
tests/- YAML test definitions organized by servicesimple/- Basic examples (scope_.yml, test_.yml, suite.yml)templates/- Reusable test snippets (kv.yml, n1ql.yml, fts.yml, etc.)- Service directories:
analytics/,eventing/,fts/,n1ql/,view/,xdcr/,mobile/,2i/,integration/, etc.
config.yml- Default configuration (client endpoint, provider, scope/test defaults)local/- Local override files (scope_local.yml,test_local.yml) for dev usebuild.sh- Container build script
Configuration:
- Use YAML files for infrastructure (
scope_*.yml) and test actions (test_*.yml) config.ymldefines provider type (docker/file/dev) and Docker client endpoint- Support for multiple providers: docker (default), file (remote servers), dev (cluster-run)
Test Structure:
- Scope files define infrastructure (servers, buckets, users, sync gateways, clusters)
- Test files define actions to run against the infrastructure
- Templates allow reusable test sections (e.g.,
kv.ymlfor common KV operations) - Suites combine multiple tests with their scopes
Provider Selection:
- Docker provider spins up containers dynamically
- File provider connects to pre-existing remote servers
- Swarm provider for Docker Swarm environments
Scaling:
scaleparameter in config.yml (default: 1) multiplies workload sizes- Support for concurrent test execution and collection iteration
Container Management:
- Containers can be started with
wait: trueto block until ready - Support for conditional waits, retries, and duration-based tests
- Automatic cleanup via
skip_teardownflag
- Go version: 1.24.0 (see
go.mod) - Docker: Required for the default docker provider; ensure daemon is running
- Linting:
golangci-lint— config in.golangci.yml- Enabled linters:
govet,staticcheck,errcheck,ineffassign,unused,gocritic,misspell - Formatters:
gofmt,goimports(local prefix:github.com/couchbaselabs/sequoia) - Run:
golangci-lint run
- Enabled linters:
- Pre-commit hooks:
.pre-commit-config.yaml— install withpre-commit install
Code Changes:
- Go code: Ensure
go build -o sequoiasucceeds without errors - Linting: Run
golangci-lint runand resolve any reported issues - Docker containers: Verify container builds with
docker buildor./build.sh - Test YAML: Validate YAML syntax and spec structure
Testing:
- Run a simple test:
./sequoiashould complete successfully - Verify container provisioning and cleanup work correctly
- Check logs in
logs/directory for test results and debug output
Security:
- Review Docker client endpoint configuration (ensure proper TLS certs for HTTPS)
- Check for hardcoded credentials in test files (passwords, API keys)
- Verify no sensitive data in
hosts.json,.gitignorecovers generated files
Credentials:
- Test files often contain default credentials (e.g.,
password: password,rest_username: Administrator) - Docker client endpoints may expose container daemon if misconfigured
- Avoid committing production credentials or API keys
Generated Files:
logs/- Test execution logs and results.tap4jhosts.json- Generated host mappings during tests.idea/- IDE config (already gitignored)
Network Access:
- Docker provider requires access to Docker daemon (check TLS configuration)
- Remote servers (file provider) may need VPN/proxy access
Resource Usage:
- Tests can spawn multiple containers; check disk space and memory limits
- Long-running tests may accumulate resources if cleanup fails
- Repo Inventory - Languages, tools, directories, and build commands
- Build/Test Matrix - Build and validation commands by component
- Domain Glossary - Couchbase services, framework terms, and test environments
- Troubleshooting - Common issues, log locations, and recovery steps
- Architecture - System flows, provider patterns, and component boundaries
- No Go unit test files in the repo (integration tests only, via Docker)
- No CI/CD pipelines detected (no .github/, .gitlab-ci.yml, etc.)
- Documentation wiki referenced (Test Syntax, Providers) exists externally, not in this repo
- Specific version compatibility matrix for Couchbase releases not documented locally