mirror of https://github.com/open-feature/cli.git
* feat: introduce dagger for integration testing and ci Signed-off-by: Kris Coleman <kriscodeman@gmail.com> * feat: make integration testing extensible and modular my intention here is to make the pattern for integration testing more accessible. let's abstract the integration test pattern itself into a framework to harness the boiler plate. then reuse our csharp integration test code as our first integration-test. Signed-off-by: Kris Coleman <kriscodeman@gmail.com> --------- Signed-off-by: Kris Coleman <kriscodeman@gmail.com> |
||
|---|---|---|
| .. | ||
| expected | ||
| CompileTest.csproj | ||
| Dockerfile | ||
| OpenFeature.cs | ||
| Program.cs | ||
| README.md | ||
README.md
C# Integration Testing
This directory contains integration tests for the C# code generator.
Running the tests
Run the C# integration tests with Dagger:
make test-csharp-dagger
This will:
- Build the OpenFeature CLI
- Generate C# client code using the sample manifest
- Run the C# compilation test in an isolated environment
- Report success or failure
What the test does
The integration test:
- Builds the OpenFeature CLI inside a container
- Generates C# client code using a sample manifest
- Compiles the generated code with a sample program
- Runs the compiled program to verify it works correctly
Test Files
CompileTest.csproj: .NET project file for compilation testingProgram.cs: Test program that uses the generated codeexpected/: Directory containing expected output files (used for verification)
Implementation
The C# integration test uses Dagger to create a reproducible test environment:
- It builds the CLI in a Go container
- Generates C# code using the CLI
- Tests the generated code in a .NET container
The implementation is located in test/integration/cmd/csharp/run.go.
For more implementation details, see the main test/README.md file.