redis-vl-dotnet
Testing
This section captures the current validation commands and docs publishing requirements.
Local validation
Build the Antora site from the repository root:
npm install
npm run docs:validate
The generated static site is written to build/site.
Build every example project from the repository root:
npm run examples:build
This sweep restores and builds each examples/*.csproj entry so docs-linked samples fail fast when they drift from the current library surface.
Running the .NET test suite
The unit and integration tests live in tests/RedisVL.Tests. Run them from the repository root:
dotnet test redis-vl-dotnet.sln
Pure unit tests (parsers, command builders, mappers) run with no external dependencies. The integration tests require a running Redis with the Query Engine (RediSearch) and are gated behind environment variables — when a variable is unset the corresponding tests are skipped, not failed, so dotnet test stays green even when nothing integration-level actually ran.
Redis for integration tests
Start a pinned Redis (matching CI) with the bundled compose file:
docker compose -f docker-compose.integration.yml up -d
export REDIS_VL_REDIS_URL=localhost:6379
dotnet test redis-vl-dotnet.sln
Native FT.HYBRID tests additionally require Redis 8.4+; against an older server they capability-skip (rather than fail) after probing the RediSearch module version.
Environment variables
| Variable | Purpose |
|---|---|
|
Connection string for the standalone Redis used by the search integration tests. Unset ⇒ all search integration tests skip. |
|
RESP protocol for integration tests ( |
|
Comma-separated cluster endpoints for the Redis Cluster integration tests. Unset ⇒ cluster tests skip. |
|
Optional auth and TLS for the cluster connection. |
|
Local ONNX embedding model + tokenizer paths for the ONNX vectorizer smoke tests. |
|
Local ONNX cross-encoder model + tokenizer paths for the ONNX reranker smoke tests. |
|
Live OpenAI vectorizer smoke tests. |
|
Live Cohere vectorizer and reranker smoke tests. |
|
Live Hugging Face vectorizer smoke tests. |
Useful invocations
# a single target framework
dotnet test redis-vl-dotnet.sln --framework net9.0
# a subset by name
dotnet test tests/RedisVL.Tests/RedisVL.Tests.csproj --filter "FullyQualifiedName~Parser"
# with a TRX report and code coverage (as CI does)
dotnet test redis-vl-dotnet.sln \
--collect "XPlat Code Coverage" \
--logger "trx;LogFileName=results.trx" \
--results-directory ./test-results
CI validation
.github/workflows/ci.yml runs the same repository-root commands used locally:
-
npm run docs:validate -
npm run examples:build
Because Antora exits on broken navigation or missing page references, the docs validation job blocks CI on docs-site drift. Because the example sweep builds every sample project, CI also blocks merges when a documented example stops compiling.
The build-and-test job additionally:
-
runs
dotnet testacrossnet8.0/net9.0/net10.0under both RESP2 and RESP3 against a pinned Redis service (redis:8.4.0), so evidence is reproducible; -
enforces a test execution floor — each run emits a TRX and the build fails if any leg executed fewer than a minimum number of tests, so a green build with the integration suite silently skipped is caught;
-
collects code coverage (
XPlat Code Coverage) and uploads it as a build artifact.
GitHub Actions publishing
GitHub Pages publishing is defined in .github/workflows/docs-pages.yml.
The workflow:
-
runs on pushes to
mainand on manual dispatch -
installs the repository Node.js dependencies with
npm ci -
builds the Antora site with
npm run docs:validate -
uploads
build/siteas the Pages artifact -
deploys only after the build job succeeds
Because the deploy job depends on the build job, a failed docs build blocks publishing.