skills/vvvv-testing/SKILL.md
Set up and run automated tests for vvvv gamma packages and C# nodes -- VL.TestFramework with NUnit for library/package authors (CI-ready), test .vl patches with assertion nodes, and lightweight agent-driven test workflows. Use when writing tests for vvvv packages, setting up test infrastructure, creating test patches, running automated compilation checks, or integrating vvvv tests into CI/CD.
npx skillsauth add tebjan/vvvv-skills vvvv-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Approach | Use Case | Setup | |----------|----------|-------| | VL.TestFramework (NUnit) | Package/library authors, CI integration | .csproj test project with NUnit | | Agent test workflow | Quick verification, ad-hoc debugging | Create test .vl patch, launch vvvv, check results |
Create a test .csproj referencing VL.TestFramework:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="4.*" />
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\path\to\VL.TestFramework.csproj" />
<!-- OR if using installed vvvv: -->
<!-- Reference VL.TestFramework.dll from vvvv install dir -->
</ItemGroup>
</Project>
using NUnit.Framework;
using VL.TestFramework;
[TestFixture]
public class MyPackageTests
{
TestEnvironment testEnvironment;
// Important: Don't use async Task here (NUnit sync context issue)
[OneTimeSetUp]
public void Setup()
{
var assemblyPath = typeof(MyPackageTests).Assembly.Location;
var searchPaths = new[] { "path/to/your/package" };
testEnvironment = TestEnvironmentLoader.Load(assemblyPath, searchPaths);
}
[OneTimeTearDown]
public void TearDown()
{
testEnvironment?.Dispose();
testEnvironment = null;
}
[Test]
public async Task MyPatchCompilesWithoutErrors()
{
await testEnvironment.LoadAndTestAsync("path/to/MyPatch.vl");
}
[Test]
public async Task MyPatchCompilesAndRuns()
{
await testEnvironment.LoadAndTestAsync(
"path/to/MyPatch.vl",
runEntryPoint: true);
}
}
TestEnvironmentLoader.Load(assemblyPath, searchPaths) -- Create test environment. One per test class (expensive).testEnvironment.LoadAndTestAsync(filePath) -- Load .vl document, check for compilation errors.testEnvironment.LoadAndTestAsync(filePath, runEntryPoint: true) -- Also execute the entry point (Create + Update + Dispose).testEnvironment.GetPackages() -- Discover all packages and their source/help/test files.testEnvironment.Host.LoadAndCompileAsync(filePath) -- Load and compile without running (for custom assertions).testEnvironment.Host.GetTargetCompilationAsync(filePath) -- Get the C# compilation for inspection.For the full API reference, see test-framework-reference.md.
The VL.TestFramework automatically discovers tests:
.vl files in tests/ folders under package directories.vl files in help/ folders (tested for compilation only)Test or Tests within test documents are individually compiled and executedFile discovery pattern:
VL.MyPackage/
tests/
MyFeatureTest.vl <-- auto-discovered test document
IntegrationTests.vl <-- auto-discovered test document
help/
HowTo Use Feature.vl <-- tested for compilation errors
# Run all tests
dotnet test
# Run specific test
dotnet test --filter "MyPatchCompilesWithoutErrors"
# Via Nuke build system (if available)
./build.ps1 --target Test
Use these nodes inside .vl test patches to assert behavior. Available under VL.Lib.Basics.Test.TestNodes:
// In VL patches, these are available as nodes:
TestNodes.Assert(condition, "message") // General assertion
TestNodes.AreEqual(expected, actual) // Value equality
TestNodes.AreNotEqual(expected, actual) // Value inequality
TestNodes.IsNotNull(input) // Null check
TestNodes.AreSequenceEqual(expected, actual) // Collection equality
TestNodes.AssertElementHasError(elementGuid) // Verify element has compile error
TestNodes.AssertElementHasNoError(elementGuid) // Verify element has no compile error
Assertions throw AssertionException on failure, which the test runner catches and reports.
For quick verification without a full NUnit project:
Create a .vl file that exercises the feature under test. Include TestNodes for assertions. Name it with a Test suffix for auto-discovery. To understand the .vl XML file structure (document hierarchy, element IDs, node references, pins, pads, links), consult the vvvv-fileformat skill.
Write a minimal C# script or test that loads and compiles the patch:
var env = TestEnvironmentLoader.Load(assemblyPath, searchPaths);
await env.LoadAndTestAsync("path/to/MyTest.vl", runEntryPoint: true);
env.Dispose();
Use the vvvv-debugging skill to set up a launch configuration that opens the test patch:
vvvv.exe --stoppedonstartup --debug --log -o "path/to/MyTest.vl"
--stoppedonstartup pauses runtime so you can inspect initial state--log enables logging to %USERPROFILE%\Documents\vvvv\gamma\vvvv.logAfter vvvv exits, check:
ERROR or EXCEPTION entriesAssertionException in the outputMost vvvv repos use Nuke. The test target:
Target Test => _ => _
.Executes(() =>
{
DotNetTest(_ => _
.SetProjectFile(Solution)
.SetConfiguration(Configuration));
});
Run with: ./build.ps1 or ./build.sh (defaults to Publish target; use --target Test for tests).
- name: Run vvvv tests
run: dotnet test --configuration Release --logger "trx"
TestEnvironment per test class ([OneTimeSetUp]), not per testpreCompilePackages: false (default) for faster test iterationpreCompilePackages: true for production-fidelity testingdata-ai
Diagnoses and fixes common vvvv gamma errors in C# nodes, SDSL shaders, and runtime behavior. Use when encountering errors, exceptions, crashes, red nodes, shader compilation failures, missing nodes in the browser, performance issues, or unexpected behavior.
testing
Covers launching vvvv gamma from the command line or programmatically -- normal startup, opening specific .vl patches, command-line arguments, package repositories, and key filesystem paths (install directory, user data, sketches, exports, packages). Use when starting vvvv, configuring launch arguments, setting up package repositories, or finding vvvv's data directories.
development
Helps write code using vvvv gamma's Spread<T> immutable collection type and SpreadBuilder<T>. Use when working with Spreads, SpreadBuilder, collections, arrays, iteration, mapping, filtering, zipping, accumulating, or converting between Span and Spread. Trigger whenever the user writes collection-processing C# code in vvvv — even if they say 'list', 'array', or 'IEnumerable' instead of Spread, this skill likely applies.
development
Helps write SDSL shaders for Stride and vvvv gamma — TextureFX, shader mixins, compute shaders, and ShaderFX composition. SDSL is a superset of HLSL, so use this skill when writing or debugging .sdsl shader files, GPU shaders, visual effects, HLSL code for vvvv, working with the Stride rendering pipeline, composing shader mixins, or any GPU/compute work. Trigger even if the user says 'HLSL', 'shader', 'GPU effect', 'render pass', or 'compute' in a vvvv context.