diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index df74597bb..e3213fb1c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -21,14 +21,12 @@ jobs: - uses: actions/setup-dotnet@v4 with: dotnet-version: '8.0.x' - - name: Install Blazor WASM workload - run: sudo dotnet workload install wasm-tools - - run: dotnet restore WalkingTec.Mvvm.sln - - run: dotnet build WalkingTec.Mvvm.sln --no-restore -c Release + - run: dotnet restore ci.slnf + - run: dotnet build ci.slnf --no-restore -c Release - name: Test with coverage run: | - dotnet test WalkingTec.Mvvm.sln \ + dotnet test ci.slnf \ --no-build -c Release \ --verbosity normal \ --filter "TestCategory!=Integration" \ @@ -104,4 +102,5 @@ jobs: - uses: actions/setup-dotnet@v4 with: dotnet-version: '8.0.x' + - run: dotnet restore WalkingTec.Mvvm.sln - run: dotnet list WalkingTec.Mvvm.sln package --vulnerable --include-transitive diff --git a/ci.slnf b/ci.slnf new file mode 100644 index 000000000..abf37d3e5 --- /dev/null +++ b/ci.slnf @@ -0,0 +1,21 @@ +{ + "solution": { + "path": "WalkingTec.Mvvm.sln", + "projects": [ + "src/WalkingTec.Mvvm.Core/WalkingTec.Mvvm.Core.csproj", + "src/WalkingTec.Mvvm.Mvc/WalkingTec.Mvvm.Mvc.csproj", + "src/WalkingTec.Mvvm.TagHelpers.LayUI/WalkingTec.Mvvm.TagHelpers.LayUI.csproj", + "src/WalkingTec.Mvvm.Etl/WalkingTec.Mvvm.Etl.csproj", + "src/WalkingTec.Mvvm.Mvc.Tests/WalkingTec.Mvvm.Mvc.Tests.csproj", + "test/WalkingTec.Mvvm.Core.Test/WalkingTec.Mvvm.Core.Test.csproj", + "test/WalkingTec.Mvvm.Admin.Test/WalkingTec.Mvvm.Admin.Test.csproj", + "test/WalkingTec.Mvvm.Test.Mock/WalkingTec.Mvvm.Test.Mock.csproj", + "test/WalkingTec.Mvvm.Etl.Test/WalkingTec.Mvvm.Etl.Test.csproj", + "demo/WalkingTec.Mvvm.Demo/WalkingTec.Mvvm.Demo.csproj", + "demo/WalkingTec.Mvvm.ReactDemo/WalkingTec.Mvvm.ReactDemo.csproj", + "demo/WalkingTec.Mvvm.VueDemo/WalkingTec.Mvvm.VueDemo.csproj", + "demo/WalkingTec.Mvvm.Vue3Demo/WalkingTec.Mvvm.Vue3Demo.csproj", + "demo/WalkingTec.Mvvm.ConsoleDemo/WalkingTec.Mvvm.ConsoleDemo.csproj" + ] + } +} diff --git a/test/WalkingTec.Mvvm.Core.Test/VM/ImportProgressTests.cs b/test/WalkingTec.Mvvm.Core.Test/VM/ImportProgressTests.cs index 4f5846d08..da8eb6355 100644 --- a/test/WalkingTec.Mvvm.Core.Test/VM/ImportProgressTests.cs +++ b/test/WalkingTec.Mvvm.Core.Test/VM/ImportProgressTests.cs @@ -9,6 +9,12 @@ namespace WalkingTec.Mvvm.Core.Test.VM; +/// Synchronous IProgress<T> — avoids thread-pool ordering issues in tests. +file sealed class SyncProgress(List target) : IProgress +{ + public void Report(T value) => target.Add(value); +} + /// /// Guards issue #607 — IProgress<ImportProgress> reporting in BatchSaveData, /// and issue #615 — InlineErrors / InlineErrorLimit on BaseImportVM. @@ -43,7 +49,7 @@ public void BatchSaveData_reports_progress_for_each_row() }; var vm = MakeVm(entities); var reports = new List(); - var progress = new Progress(p => reports.Add(p)); + var progress = new SyncProgress(reports); vm.BatchSaveData(progress); @@ -60,7 +66,7 @@ public void BatchSaveData_progress_total_matches_entity_count() var vm = MakeVm(entities); var reports = new List(); - vm.BatchSaveData(new Progress(p => reports.Add(p))); + vm.BatchSaveData(new SyncProgress(reports)); Assert.IsTrue(reports.All(p => p.Total == 5), "All progress reports should carry Total = entity count"); @@ -75,7 +81,7 @@ public void BatchSaveData_progress_processed_is_monotonically_increasing() var vm = MakeVm(entities); var reports = new List(); - vm.BatchSaveData(new Progress(p => reports.Add(p))); + vm.BatchSaveData(new SyncProgress(reports)); // Filter to a single phase to check monotonicity var saveReports = reports.Where(p => p.Phase == "Saving").ToList(); @@ -107,7 +113,7 @@ public void ImportProgress_phase_names_are_non_empty() var vm = MakeVm(entities); var reports = new List(); - vm.BatchSaveData(new Progress(p => reports.Add(p))); + vm.BatchSaveData(new SyncProgress(reports)); Assert.IsTrue(reports.All(p => !string.IsNullOrEmpty(p.Phase)), "All progress reports must have a non-empty Phase");