This directory contains integration tests for the FlinkDotNet Learning Course tutorials.
All LearningCourse integration tests MUST be run through LearningCourse/IntegrationTests.sln using the dedicated LearningCourse test infrastructure.
# Run ALL integration tests (LearningCourse)
dotnet test LearningCourse/IntegrationTests.sln --configuration Release
# Run ONLY Day01 tests
dotnet test LearningCourse/IntegrationTests.sln --configuration Release --filter "FullyQualifiedName~Day01"
# Run ONLY Day02 tests
dotnet test LearningCourse/IntegrationTests.sln --configuration Release --filter "FullyQualifiedName~Day02"
# Run specific test
dotnet test LearningCourse/IntegrationTests.sln --configuration Release --filter "FullyQualifiedName~UppercaseTransform"WARNING: Running all 15 days of tests sequentially can take 3+ hours to complete. It's recommended to run tests day by day as needed.
# Day 01 - Kafka-Flink Data Pipeline
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day01Tests"
# Day 02 - Flink 2.1.0 Fundamentals
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day02Tests"
# Day 03 - State Management & Checkpointing
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day03Tests"
# Day 04 - Event Time & Watermarks
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day04Tests"
# Day 05 - Advanced Transformations & Aggregations
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day05Tests"
# Day 06 - Complex Event Processing (CEP)
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day06Tests"
# Day 07 - Advanced Windows & Joins
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day07Tests"
# Day 08 - Stress Testing
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day08Tests"
# Day 09 - Exactly-Once Semantics
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day09Tests"
# Day 10 - Performance Optimization & Scaling
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day10Tests"
# Day 11 - Security, Privacy & Compliance
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day11Tests"
# Day 12 - Disaster Recovery & Multi-Region
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day12Tests"
# Day 13 - Advanced Streaming Patterns
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day13Tests"
# Day 14 - Advanced Testing & Chaos Engineering
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day14Tests"
# Day 15 - Capstone Project
dotnet test LearningCourse/LearningCourse.IntegrationTests/LearningCourse.IntegrationTests.csproj --filter "FullyQualifiedName~Day15Tests"Note: Each day's tests can take 10-30 minutes depending on test complexity and system resources.
LearningCourse has its own dedicated solution file for integration tests:
- Dedicated Infrastructure: LearningCourse tests use their own infrastructure setup via
LearningCourseTestBase - Independent Testing: Each Day can be tested independently without LocalTesting infrastructure
- Simpler Setup: No dependency on LocalTesting.sln, cleaner separation of concerns
Using LearningCourse solution (correct):
# ✅ This uses the dedicated LearningCourse solution
dotnet test LearningCourse/IntegrationTests.slnBenefits:
- Clean separation between LearningCourse and LocalTesting tests
- Each solution manages its own infrastructure
- All tests work reliably
- No cross-solution dependencies
The LearningCourse/IntegrationTests.sln includes:
- LearningCourse.IntegrationTests - Base test infrastructure with
LearningCourseTestBase - LearningCourse.Common - Common utilities for learning course
- Day01.IntegrationTests - Kafka-Flink pipeline learning course tests
- Day02.IntegrationTests - Flink 2.1.0 fundamentals learning course tests
- Exercise Solutions - All exercise solution projects for each day
Located in LearningCourse/Day01-Kafka-Flink-Data-Pipeline/Day01.IntegrationTests/
Tests:
Exercise1_StringCapitalize_ShouldExecuteSuccessfully- Tests string stream processing with capitalize transformationExercise2_BackupAggregator_ShouldExecuteSuccessfully- Tests custom objects and backup aggregation with time windows
Key Point: Day01 tests inherit from LearningCourseTestBase and rely on the shared infrastructure.
Located in LearningCourse/Day02-Flink21-Fundamentals/Day02.IntegrationTests/
Tests:
Exercise1_InfrastructureValidation_ShouldExecuteSuccessfully- Tests production infrastructure validationExercise2_ProductionApp_ShouldExecuteSuccessfully- Tests enterprise-grade streaming applicationExercise3_ObservabilityDashboard_ShouldExecuteSuccessfully- Tests Google-style SRE observability patternsExercise4_LoadTesting_ShouldExecuteSuccessfully- Tests performance validation and benchmarking
Key Point: Day02 tests inherit from LearningCourseTestBase and rely on the shared infrastructure.
Before running tests, ensure:
- .NET 9.0 SDK is installed (
dotnet --versionshows 9.0.x) - Docker Desktop is running (required for Aspire containers)
- Maven is available in PATH (for Java component builds)
- Java JDK 17 is available (automatically managed by the build)
- Sufficient system resources:
- Minimum 4GB RAM available
- Minimum 10GB disk space
The integration tests use .NET Aspire for orchestration, which automatically manages:
- Apache Flink (JobManager and TaskManager)
- Apache Kafka broker
- Temporal workflow server (if needed)
- PostgreSQL database (if needed)
All infrastructure is ephemeral and cleaned up after tests complete.
Ensure Docker Desktop is running before executing tests:
# Windows
docker ps
# Should show containers, not an errorThis occurs when infrastructure is not properly initialized.
Solution: Ensure you're running through the correct solution:
dotnet test LearningCourse/IntegrationTests.sln --filter "FullyQualifiedName~Day01"If tests fail with "Flink JobManager endpoint not found" or containers show "Created" status instead of "Up":
- Check Docker Desktop is running and has sufficient resources
- Verify no port conflicts (Flink uses 8081, Kafka uses 9092/9093)
- Check Docker logs:
docker logs <container-name>
Check Docker Desktop has sufficient resources allocated (Settings → Resources).
Stop any services using conflicting ports or configure alternative ports in the test configuration.
Run a clean build before testing:
dotnet clean LearningCourse/IntegrationTests.sln
dotnet build LearningCourse/IntegrationTests.sln --configuration ReleaseThe LearningCourse solution can be easily integrated into CI/CD workflows:
- name: Run All Integration Tests
run: dotnet test LearningCourse/IntegrationTests.sln --configuration Release --logger "trx;LogFileName=integration-test-results.trx"
- name: Run Only Day01 Tests
run: dotnet test LearningCourse/IntegrationTests.sln --configuration Release --filter "FullyQualifiedName~Day01" --logger "trx;LogFileName=day01-test-results.trx"
- name: Run Only Day02 Tests
run: dotnet test LearningCourse/IntegrationTests.sln --configuration Release --filter "FullyQualifiedName~Day02" --logger "trx;LogFileName=day02-test-results.trx"To add a new day's integration tests:
-
Create the test project in the appropriate Day folder:
dotnet new nunit -n DayXX.IntegrationTests -o LearningCourse/DayXX-Topic/DayXX.IntegrationTests
-
Add project reference to
LearningCourse/IntegrationTests.sln:cd LearningCourse dotnet sln IntegrationTests.sln add DayXX-Topic/DayXX.IntegrationTests/DayXX.IntegrationTests.csproj -
Add exercise solution projects to the solution:
dotnet sln IntegrationTests.sln add DayXX-Topic/Exercise-Solutions/Exercise1/Exercise1.csproj
-
Make test class inherit from
LearningCourseTestBase:using LearningCourse.IntegrationTests; public class DayXXTests : LearningCourseTestBase { // Tests here }
-
Run tests to verify:
dotnet test LearningCourse/IntegrationTests.sln --filter "FullyQualifiedName~DayXX"
Previous versions used run-all-integration-tests.ps1 PowerShell script. This has been replaced by the solution file approach.
Before (❌ deprecated):
.\LearningCourse\run-all-integration-tests.ps1Now (✅ correct):
dotnet test LocalTesting/LocalTesting.sln --configuration Release --filter "FullyQualifiedName~Day"The solution file approach offers several advantages:
- Better Visual Studio/VS Code integration
- Consistent with standard .NET testing workflows
- Easier to run specific tests or test categories
- No PowerShell-specific quirks or compatibility issues
- Standard NUnit test filtering and reporting
- Shared infrastructure prevents container conflicts
- Works on all platforms (Windows, Linux, macOS)
The following files are deprecated and should not be used:
- ❌
LearningCourse/IntegrationTests.sln- Creates duplicate Aspire instance (if it exists, delete it) - ❌
LearningCourse/run-all-integration-tests.ps1- Replaced by solution file approach (deleted)
Always use: LocalTesting/LocalTesting.sln for running all integration tests.