Thank you for your interest in contributing! This document provides guidelines and information for contributors.
This framework is in preview (pre-1.0). The core infrastructure, all trigger packages, and the durable support package are fully functional. See README.md for the full capability matrix.
- .NET 8 SDK and .NET 10 SDK
- Visual Studio 2022 / VS Code / Rider
- Basic understanding of:
- Azure Functions (dotnet-isolated model)
- gRPC and Protocol Buffers
- ASP.NET Core (for WebApplicationFactory-based testing)
git clone https://github.com/bjorkstromm/azure-functions-test-framework
cd azure-functions-test-framework
dotnet restore
dotnet build# All tests
dotnet test
# 4-flavour test matrix (IHostBuilder / FunctionsApplicationBuilder × direct gRPC / ASP.NET Core)
dotnet test --project tests/TestProject.HostBuilder.Tests
dotnet test --project tests/TestProject.HostBuilder.AspNetCore.Tests
dotnet test --project tests/TestProject.HostApplicationBuilder.Tests
dotnet test --project tests/TestProject.HostApplicationBuilder.AspNetCore.Tests
# Custom route prefix tests (4-flavour)
dotnet test --project tests/TestProject.CustomRoutePrefix.HostBuilder.Tests
dotnet test --project tests/TestProject.CustomRoutePrefix.HostBuilder.AspNetCore.Tests
dotnet test --project tests/TestProject.CustomRoutePrefix.HostApplicationBuilder.Tests
dotnet test --project tests/TestProject.CustomRoutePrefix.HostApplicationBuilder.AspNetCore.Tests
# Worker SDK 2.x sample tests
dotnet test --project samples/Sample.FunctionApp.Worker.Tests
dotnet test --project samples/Sample.FunctionApp.Tests.XUnit
dotnet test --project samples/Sample.FunctionApp.Tests.NUnit
dotnet test --project samples/Sample.FunctionApp.Tests.TUnit
# Durable Functions tests
dotnet test --project samples/Sample.FunctionApp.Durable.Tests
# Custom route prefix sample tests
dotnet test --project samples/Sample.FunctionApp.CustomRoutePrefix.Tests
dotnet test --project samples/Sample.FunctionApp.CustomRoutePrefix.AspNetCore.TestsFor a detailed architecture walkthrough, see .github/copilot-instructions.md. Key design decisions (ALC isolation, FrameworkReference, durable converter interception) are documented in README.md under "Architecture & Design Decisions".
src/AzureFunctions.TestFramework.Core/FunctionsTestHost.cs— Main orchestratorsrc/AzureFunctions.TestFramework.Core/FunctionsTestHostBuilder.cs— Fluent builder APIsrc/AzureFunctions.TestFramework.Core/Grpc/GrpcHostService.cs— gRPC protocol handler + route matchingsrc/AzureFunctions.TestFramework.Core/Worker/WorkerHostService.cs— Worker lifecycle managementsrc/AzureFunctions.TestFramework.Core/Worker/InProcessMethodInfoLocator.cs— ALC isolation fix
Each test project references exactly one function-app project. See KNOWN_ISSUES.md for why.
- Use nullable reference types (
#nullable enable) - Add XML documentation for public APIs (the build enforces
TreatWarningsAsErrors=true) - Follow existing patterns (e.g., async/await, ILogger usage)
- Use meaningful variable names
Important: Never block the gRPC event stream. Use Task.Run() for long-running operations:
// ❌ DON'T: Blocks event stream
var response = await SendMessageAsync(request);
// ✅ DO: Run in background
_ = Task.Run(async () => {
var response = await SendMessageAsync(request);
}, cancellationToken);- Package versions are managed centrally via
Directory.Packages.props— add new versions there, not inline - Semantic versioning is driven by MinVer from git tags (
v*.*.*)
- Add unit tests for new functionality
- Update integration tests if changing public API
- Ensure existing tests still pass
- Add test cases for edge cases
- Fork the repository
- Create a branch from
main:git checkout -b feature/your-feature-name - Make your changes following the coding guidelines
- Add/update tests as appropriate
- Ensure all tests pass:
dotnet test - Commit your changes with clear commit messages
- Push to your fork
- Create a Pull Request with:
- Clear description of what problem you're solving
- Reference to any related issues
- Test results showing your changes work
<type>: <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding/updating testsrefactor: Code refactoringchore: Maintenance tasks
Example:
feat: add Cosmos DB trigger invocation support
- Add AzureFunctions.TestFramework.CosmosDb package
- Implement InvokeCosmosDbAsync extension method
- Add sample function and integration tests
Fixes #42
- Read README.md for capabilities and usage examples
- Read .github/copilot-instructions.md for detailed architecture
- Check KNOWN_ISSUES.md for active caveats
- Check Azure Functions Worker SDK docs: https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide
- Ask questions in a new GitHub Issue with the
questionlabel
By contributing, you agree that your contributions will be licensed under the MIT License.
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Keep discussions on-topic
Thank you for contributing! 🎉