This directory contains a configurable test batch system for running NEsper regression tests efficiently and managing test organization.
- test-batches.json - Configuration file defining test batches, timeouts, and known issues
- run-test-batches.ps1 - PowerShell script to execute tests according to configuration
- TEST-BATCHES-README.md - This documentation file
.\run-test-batches.ps1 -Summary.\run-test-batches.ps1.\run-test-batches.ps1 -BatchName "EPL-Database".\run-test-batches.ps1 -BatchName "Event" -Verbose.\run-test-batches.ps1 -IsolatedOnly.\run-test-batches.ps1 -Framework "net8.0"Global settings for test execution:
{
"configuration": {
"defaultTimeout": 600000,
"defaultFramework": "net9.0",
"runSettingsPath": "NEsper.runsettings",
"testProjectPath": "tst/NEsper.Regression.Runner",
"parallelBatches": false,
"stopOnFirstFailure": false
}
}Array of test batch definitions:
{
"batches": [
{
"name": "EPL-Database",
"filter": "TestEPLDatabase",
"enabled": true,
"timeout": 300000,
"description": "Database integration tests"
}
]
}Batch Properties:
name- Unique identifier for the batchfilter- NUnit test filter (e.g., "TestEPLDatabase" or "FullyQualifiedName~WithMethod")enabled- Boolean to enable/disable batchtimeout- Timeout in millisecondsdescription- Human-readable description
Tests that should run separately due to state pollution:
{
"isolatedTests": {
"tests": [
{
"name": "WithParameterInjectionCallback-Isolated",
"filter": "FullyQualifiedName~WithParameterInjectionCallback",
"enabled": false,
"timeout": 120000,
"reason": "Fails when run with other dataflow tests"
}
]
}
}Documentation of known test failures:
{
"knownFailures": {
"failures": [
{
"test": "TestEventXMLSchemaEventObservationDOM.WithCreateSchema",
"reason": "XPath property 'mytags[1].ID' assertion failure",
"issue": "XML-001"
}
]
}
}- Edit
test-batches.json - Add a new entry to the
batchesarray:
{
"name": "MyNewBatch",
"filter": "TestMyNewFeature",
"enabled": true,
"timeout": 300000,
"description": "Tests for my new feature"
}- Run:
.\run-test-batches.ps1 -Summaryto verify - Execute:
.\run-test-batches.ps1 -BatchName "MyNewBatch"
If a batch is too large or times out:
- Identify sub-groups using test names (e.g.,
TestEPLOtherhas many sub-tests) - Create multiple smaller batches with more specific filters:
{
"name": "EPL-Other-Part1",
"filter": "TestEPLOtherIStreamRStream",
"enabled": true,
"timeout": 300000,
"description": "EPL Other - IStream/RStream tests"
},
{
"name": "EPL-Other-Part2",
"filter": "TestEPLOtherStaticFunc",
"enabled": true,
"timeout": 300000,
"description": "EPL Other - Static function tests"
}Based on test execution results, adjust timeouts:
{
"name": "EPL-Join",
"timeout": 600000, // Increased from 300000 due to slow execution
"description": "Join tests - complex queries"
}Temporarily disable a batch while investigating:
{
"name": "Event",
"enabled": false, // Changed from true
"description": "Disabled due to XML XPath failures under investigation"
}- Run fast batches first to catch obvious issues:
.\run-test-batches.ps1 -BatchName "Client"- Run related batches:
.\run-test-batches.ps1 -BatchName "EPL-Database"- Run full suite:
.\run-test-batches.ps1- Move test to isolated tests section in config
- Run multiple times:
for ($i=1; $i -le 10; $i++) {
Write-Host "Run $i"
.\run-test-batches.ps1 -IsolatedOnly
}For focused testing, create temporary batch configurations:
# Copy config
Copy-Item test-batches.json test-batches-custom.json
# Edit custom config to enable only needed batches
# Run with custom config
.\run-test-batches.ps1 -ConfigFile test-batches-custom.jsonThe filter property uses NUnit's test filter syntax:
"TestEPLDatabase" # All tests in TestEPLDatabase class
"FullyQualifiedName~WithParam" # Tests with "WithParam" in fully qualified name
"TestCategory=Integration" # Tests with Integration category
"TestName=TestFoo|TestName=TestBar" # TestFoo OR TestBar
To see available test names:
cd tst/NEsper.Regression.Runner
dotnet test --list-tests --framework net9.0- Increase timeout in configuration:
"timeout": 900000 // 15 minutes- Or split into smaller batches
If tests pass in isolation but fail in batch:
- Add to
isolatedTestssection - Enable isolated test
- Disable from main batch or use more specific filter to exclude
Ensure you're running from the repository root:
cd D:\src\Espertech\NEsper-8.9.x
.\run-test-batches.ps1Based on latest run (2025-12-30):
- Total Regression Tests: 3,801
- Overall Pass Rate: 99.87%
- Intermittent Failures: 4 (pass when run in isolation)
- Known Consistent Failures: 4 (XML XPath issues)
- name: Run NEsper Test Batches
run: |
pwsh ./run-test-batches.ps1
working-directory: ${{ github.workspace }}- task: PowerShell@2
inputs:
filePath: 'run-test-batches.ps1'
workingDirectory: '$(Build.SourcesDirectory)'
displayName: 'Run NEsper Test Batches'- Keep batches focused: Group related tests together
- Reasonable timeouts: Start with 5-10 minutes, adjust based on results
- Document known issues: Use
knownFailuressection - Regular updates: Adjust configuration based on test results
- Version control: Commit configuration changes with code changes
- Test locally first: Run batches locally before CI/CD
For questions or issues with the batch configuration system, see:
- CLAUDE.md - General NEsper development guide
- NEsper.runsettings - Test runner configuration
- This file - Batch system documentation