Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down Expand Up @@ -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
21 changes: 21 additions & 0 deletions ci.slnf
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
14 changes: 10 additions & 4 deletions test/WalkingTec.Mvvm.Core.Test/VM/ImportProgressTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

namespace WalkingTec.Mvvm.Core.Test.VM;

/// <summary>Synchronous IProgress&lt;T&gt; — avoids thread-pool ordering issues in tests.</summary>
file sealed class SyncProgress<T>(List<T> target) : IProgress<T>
{
public void Report(T value) => target.Add(value);
}

/// <summary>
/// Guards issue #607 — IProgress&lt;ImportProgress&gt; reporting in BatchSaveData,
/// and issue #615 — InlineErrors / InlineErrorLimit on BaseImportVM.
Expand Down Expand Up @@ -43,7 +49,7 @@ public void BatchSaveData_reports_progress_for_each_row()
};
var vm = MakeVm(entities);
var reports = new List<ImportProgress>();
var progress = new Progress<ImportProgress>(p => reports.Add(p));
var progress = new SyncProgress<ImportProgress>(reports);

vm.BatchSaveData(progress);

Expand All @@ -60,7 +66,7 @@ public void BatchSaveData_progress_total_matches_entity_count()
var vm = MakeVm(entities);
var reports = new List<ImportProgress>();

vm.BatchSaveData(new Progress<ImportProgress>(p => reports.Add(p)));
vm.BatchSaveData(new SyncProgress<ImportProgress>(reports));

Assert.IsTrue(reports.All(p => p.Total == 5),
"All progress reports should carry Total = entity count");
Expand All @@ -75,7 +81,7 @@ public void BatchSaveData_progress_processed_is_monotonically_increasing()
var vm = MakeVm(entities);
var reports = new List<ImportProgress>();

vm.BatchSaveData(new Progress<ImportProgress>(p => reports.Add(p)));
vm.BatchSaveData(new SyncProgress<ImportProgress>(reports));

// Filter to a single phase to check monotonicity
var saveReports = reports.Where(p => p.Phase == "Saving").ToList();
Expand Down Expand Up @@ -107,7 +113,7 @@ public void ImportProgress_phase_names_are_non_empty()
var vm = MakeVm(entities);
var reports = new List<ImportProgress>();

vm.BatchSaveData(new Progress<ImportProgress>(p => reports.Add(p)));
vm.BatchSaveData(new SyncProgress<ImportProgress>(reports));

Assert.IsTrue(reports.All(p => !string.IsNullOrEmpty(p.Phase)),
"All progress reports must have a non-empty Phase");
Expand Down
Loading