This directory contains integration tests for validating the OpenFeature CLI generators.
The integration tests use Dagger to create reproducible test environments without needing to install dependencies locally.
Each integration test:
- Builds the CLI from source
- Generates code using a sample manifest file
- Compiles and tests the generated code in a language-specific container
- Reports success or failure
make test-integration# For C# tests
make test-integration-csharpTo add an integration test for a new generator:
- Create a combined implementation and runner file in
test/integration/cmd/<language>/run.go - Update the main runner in
test/integration/cmd/run.goto execute your new test - Add a Makefile target for running your test individually
See the step-by-step guide in new-language.md for detailed instructions.
The testing framework uses the following components:
test/integration/integration.go: Defines theTestinterface and common utilitiestest/integration/cmd/run.go: Runner for all integration tests that executes each language-specific testtest/integration/cmd/<language>/run.go: Combined implementation and runner for each languagetest/<language>-integration/: Contains language-specific test files (code samples, project files)
Each integration test uses Dagger to:
- Build the CLI in a clean environment
- Generate code using a sample manifest
- Compile and test the generated code in a language-specific container
- Report success or failure
Using Dagger for integration tests provides several advantages:
- Reproducibility: Tests run in containerized environments that are identical locally and in CI
- Language Support: Easy to add new language tests with the same pattern
- Improved Debugging: Clear separation of build, generate, and test steps
- Parallelization: Tests can run in parallel when executed in different containers
- No Dependencies: No need to install language-specific tooling locally