Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 31, 2025

Addresses build failures, database-related test conflicts, and code duplication in ResourceWatcher test infrastructure per review feedback.

Build Fixes

  • Removed non-existent project reference: TesterWorker.csproj was referenced in solution but didn't exist
  • Sequential framework execution: Added <TestTfmsInParallel>false</TestTfmsInParallel> to prevent net8.0/net10.0 from running in parallel against shared SQL Server test database, which caused UDT type conflicts in EnsureTableAreCreated()

Code Quality

  • Explicit LINQ operations: Replaced implicit filtering with .Where() and foreach mapping with .Select() per analyzer recommendations
  • Driver pattern for shared logic: Created CommonStepHelpers static class to eliminate duplication across step definitions:
// Before: Duplicated across SqlStateProviderSteps and StateTransitionsSteps
var modified = LocalDateTimePattern.ExtendedIso.Parse(modifiedString).Value;
var sources = new Dictionary<string, LocalDateTime>(StringComparer.OrdinalIgnoreCase);

// After: Shared helper methods
var modified = CommonStepHelpers.ParseLocalDateTime(modifiedString);
var sources = CommonStepHelpers.CreateModifiedSourcesDictionary();
  • Scoped bindings: Added [Scope(Tag = "resourcewatcher")] to StateTransitionsSteps to complement existing [Scope(Tag = "sqlstateprovider")] scoping, preventing step binding ambiguity
  • Private methods for reuse: Step classes now use private methods that delegate to shared helpers (e.g., SetModifiedSource())

Test Results

70 tests passing across net8.0 and net10.0 frameworks (44 in ResourceWatcher.Tests, 26 in Sample.Tests)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Remove TesterWorker project reference from solution file
- Add TestTfmsInParallel=false to prevent parallel framework execution
- Refactor TestableStateProvider to use explicit LINQ filtering
- Refactor BlobWorkerHostSteps to use Select instead of foreach mapping
- Add CommonStepHelpers class with Driver pattern for shared logic
- Scope StateTransitionsSteps with @ResourceWatcher tag
- Extract common date/time parsing and ModifiedSources logic to helpers
- Update both SqlStateProviderSteps and StateTransitionsSteps to use helpers

Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Copilot AI changed the title [WIP] Add samples and tests for ResourceWatcher Fix build errors, test failures, and refactor duplicate Reqnroll step bindings Dec 31, 2025
Copilot AI requested a review from AndreaCuneo December 31, 2025 07:37
@AndreaCuneo AndreaCuneo marked this pull request as ready for review December 31, 2025 07:38
@AndreaCuneo AndreaCuneo requested a review from a team as a code owner December 31, 2025 07:38
@AndreaCuneo AndreaCuneo merged commit 1762343 into feature/resource_watcher_tests Dec 31, 2025
2 checks passed
@AndreaCuneo AndreaCuneo deleted the copilot/sub-pr-530 branch December 31, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants