Commit 1deba72
authored
Release v1.3.0: Add comprehensive test suite and migrate to isolated worker model (#83)
* test: add test projects for Flattener and Functions
- Create CallRecordInsights.Flattener.Tests project
- Create CallRecordInsights.Functions.Tests project
- Add project references to solution
- Configure for Central Package Management
* test: add test dependencies to Central Package Management
- Add Microsoft.NET.Test.Sdk 17.9.0
- Add xunit 2.6.5
- Add xunit.runner.visualstudio 2.5.6
- Add FluentAssertions 6.12.0
- Add Moq 4.20.70
* fix: replace C# 12 collection expressions with compatible syntax
C# 12 collection expression syntax (e.g., []) is not available in
.NET 6/C# 10. Replace with traditional new Dictionary<>() and new
HashSet<>() syntax for compatibility.
This change is required to establish baseline tests on .NET 6 before
migrating to .NET 10.
* test: add JsonFlattener algorithm tests with test data
Add comprehensive tests for the JSON flattening algorithm:
- Array expansion with varying cardinalities
- Parent value inheritance
- Cartesian product validation (multiple sessions/streams)
- Null/empty input handling
- Missing array handling
Includes minimal-callrecord.json test data file with representative
Microsoft Teams call record structure (1 session, 1 segment, 1 stream).
All 10 tests passing on .NET 6.
* test: add comprehensive JSONPath parser tests
Add 39 tests covering:
- Selector parsing (property, array wildcard, array index, nested arrays)
- Token selection (SelectToken/SelectTokens)
- Path relationships (IsParentOf, IsSiblingOf, IsRelativeOf)
- Path utilities (GetClosestExpansion, GetParentPath, LevelsOfExpansion)
- Common ancestor detection
- Expandability checks
Documents unsupported features (array slices, quoted properties) that
have implementation issues in the current parser.
All 39 tests passing on .NET 6.
* test: add KustoCallRecord type conversion tests
Add 13 tests covering all data types in the 266-property model:
- Guid parsing (CallId, SessionId, TenantIds)
- DateTimeOffset parsing (timestamps)
- TimeSpan parsing from ISO 8601 duration format (PT0.02S)
- Long/Double numeric types
- Boolean values
- String values
- Null handling for all property types
- Configuration validation (266 columns, key property mappings)
All 13 tests passing on .NET 6.
Total test suite: 62 tests, all passing.
* refactor: migrate to Azure Functions isolated worker model packages
Update Functions project and package versions:
Removed in-process packages:
- Microsoft.NET.Sdk.Functions
- Microsoft.Azure.Functions.Extensions
- Microsoft.Azure.WebJobs.Extensions.*
Added isolated worker packages:
- Microsoft.Azure.Functions.Worker 1.21.0
- Microsoft.Azure.Functions.Worker.Sdk 1.17.0
- Microsoft.Azure.Functions.Worker.Extensions.EventHubs 6.3.5
- Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues 5.4.0
- Microsoft.Azure.Functions.Worker.Extensions.Http 3.1.0
- Microsoft.Azure.Functions.Worker.Extensions.Timer 4.3.0
- Newtonsoft.Json 13.0.3 (required by Cosmos SDK)
Set OutputType to Exe for isolated worker model.
Part of .NET 6 to .NET 10 LTS migration plan - Phase 1.
* refactor: replace Startup.cs with Program.cs and update DI
Replace in-process FunctionsStartup with isolated worker HostBuilder:
- Delete Startup.cs (in-process model entry point)
- Create Program.cs with HostBuilder and ConfigureFunctionsWorkerDefaults()
- Preserve configuration loading (appsettings.json, environment variables)
- Preserve all service registrations
Add QueueServiceClient registration:
- New AddCallRecordsQueueContext() extension method
- Required for isolated worker model (no direct queue output bindings)
- Registers QueueServiceClient for DI
All existing tests still pass (62/62).
* refactor: migrate trigger functions to isolated worker model
Update EventHub, Queue, and Timer functions for isolated worker:
ProcessEventHubEventFunction:
- [FunctionName] → [Function]
- Inject QueueServiceClient and IConfiguration
- Get QueueClient from service client at runtime
- Remove queue output binding parameter
ProcessCallRecordFunction:
- [FunctionName] → [Function]
- QueueTrigger remains compatible
- Update using statements
AddOrRenewCallRecordsSubscriptionFunction:
- [FunctionName] → [Function]
- TimerTrigger remains compatible
- Update using statements
All tests still pass (62/62).
* refactor: migrate HTTP functions to isolated worker model
Update all HTTP functions for isolated worker model:
GetCallRecordInsightsHealthFunction:
- HttpRequest → HttpRequestData, IActionResult → HttpResponseData
- Inject QueueServiceClient and get QueueClient at runtime
- Replace GetWebJobsConnectionSection (in-process only) with direct config access
- Use request.CreateResponse() and WriteAsJsonAsync()
GetCallRecordAdminFunction:
- HttpRequest → HttpRequestData, IActionResult → HttpResponseData
- Update all response creation to use HttpResponseData
- Replace ASP.NET Core status results with HttpStatusCode
CallRecordsFunctionsAdmin (3 endpoints):
- Inject QueueServiceClient and IConfiguration
- Get QueueClient at runtime for manual processing endpoint
- Update GetSubscriptionIdFunction response handling
- Update AddSubscriptionOrRenewIfExpiredFunction response handling
- Update ManuallyProcessCallIdsFunction with queue injection
- Convert helper methods to async for HttpResponseData
Build succeeds with zero errors/warnings.
All tests still pass (62/62).
Phase 1 complete: Isolated worker migration on .NET 6.
* test: add global using directives for test projects
Add Usings.cs files with global using statements for xUnit.
These are generated by the dotnet new xunit template and eliminate
the need for using Xunit; in each test file.
* test: remove template placeholder test file
Remove UnitTest1.cs template file - replaced with actual test files:
- JsonFlattenerTests.cs
- JsonPathExtensionsTests.cs
- KustoCallRecordConversionTests.cs
* Add DI container integration tests for Functions project
- Create DependencyInjectionTests with 12 tests to verify service resolution
- Test all critical services: JsonProcessor, GraphServiceClient, TokenCredential,
QueueServiceClient, CallRecordsGraphContext, CallRecordsDataContext
- Verify configuration loading and Graph client authentication chain
- Tests catch NuGet package breaking changes in DI registration
- All tests pass (12/12) with minimal test configuration
* chore: update app version to 1.3.0
* fix: update Bicep for isolated worker and fix scope resolution
- Change FUNCTIONS_WORKER_RUNTIME from 'dotnet' to 'dotnet-isolated'
- Fix BCP420 error by splitting conditional scope into two resources
- graphChangeTrackingAppKeyVaultRoleAssignmentSeparate (useSeparateKeyVaultForGraph=true)
- graphChangeTrackingAppKeyVaultRoleAssignmentShared (useSeparateKeyVaultForGraph=false)
* build: update ARM template from Bicep changes
Rebuild deploy/resourcemanager/template.json to reflect:
- FUNCTIONS_WORKER_RUNTIME: dotnet-isolated
- Fixed scope resolution with conditional resources1 parent 1103c67 commit 1deba72
25 files changed
Lines changed: 1925 additions & 225 deletions
File tree
- deploy
- bicep
- resourcemanager
- src
- Flattener
- Functions
- Extensions
- Functions
- tests
- CallRecordInsights.Flattener.Tests
- TestData
- CallRecordInsights.Functions.Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
29 | 43 | | |
30 | 44 | | |
31 | 45 | | |
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
35 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
36 | 54 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
6 | 15 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
10 | 19 | | |
11 | 20 | | |
12 | 21 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
16 | 29 | | |
17 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
566 | | - | |
567 | | - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
568 | 578 | | |
569 | 579 | | |
570 | 580 | | |
| |||
0 commit comments