diff --git a/reports/current.md b/reports/current.md index c956e58..0957859 100644 --- a/reports/current.md +++ b/reports/current.md @@ -1,6 +1,6 @@ # NATS .NET Porting Status Report -Generated: 2026-02-27 09:42:18 UTC +Generated: 2026-02-27 09:43:52 UTC ## Modules (12 total) diff --git a/reports/report_0a6e6bf.md b/reports/report_0a6e6bf.md index c956e58..ca403e6 100644 --- a/reports/report_0a6e6bf.md +++ b/reports/report_0a6e6bf.md @@ -1,6 +1,6 @@ # NATS .NET Porting Status Report -Generated: 2026-02-27 09:42:18 UTC +Generated: 2026-02-27 09:42:31 UTC ## Modules (12 total) diff --git a/reports/report_2a900bf.md b/reports/report_2a900bf.md new file mode 100644 index 0000000..0957859 --- /dev/null +++ b/reports/report_2a900bf.md @@ -0,0 +1,35 @@ +# NATS .NET Porting Status Report + +Generated: 2026-02-27 09:43:52 UTC + +## Modules (12 total) + +| Status | Count | +|--------|-------| +| verified | 12 | + +## Features (3673 total) + +| Status | Count | +|--------|-------| +| deferred | 3394 | +| verified | 279 | + +## Unit Tests (3257 total) + +| Status | Count | +|--------|-------| +| deferred | 2680 | +| n_a | 187 | +| verified | 390 | + +## Library Mappings (36 total) + +| Status | Count | +|--------|-------| +| mapped | 36 | + + +## Overall Progress + +**868/6942 items complete (12.5%)** diff --git a/tools/NatsNet.PortTracker/Commands/TestCommands.cs b/tools/NatsNet.PortTracker/Commands/TestCommands.cs index e18b3b2..f2ce4f6 100644 --- a/tools/NatsNet.PortTracker/Commands/TestCommands.cs +++ b/tools/NatsNet.PortTracker/Commands/TestCommands.cs @@ -131,10 +131,124 @@ public static class TestCommands testCommand.Add(showCmd); testCommand.Add(updateCmd); testCommand.Add(mapCmd); + testCommand.Add(CreateBatchUpdate(dbOption)); + testCommand.Add(CreateBatchMap(dbOption)); return testCommand; } + private static Command CreateBatchUpdate(Option dbOption) + { + var cmd = new Command("batch-update", "Bulk update test status"); + var idsOpt = BatchFilters.IdsOption(); + var moduleOpt = BatchFilters.ModuleOption(); + var statusOpt = BatchFilters.StatusOption(); + var executeOpt = BatchFilters.ExecuteOption(); + var setStatus = new Option("--set-status") { Description = "New status to set", Required = true }; + var setNotes = new Option("--set-notes") { Description = "Notes to set" }; + + cmd.Add(idsOpt); + cmd.Add(moduleOpt); + cmd.Add(statusOpt); + cmd.Add(executeOpt); + cmd.Add(setStatus); + cmd.Add(setNotes); + + cmd.SetAction(parseResult => + { + var dbPath = parseResult.GetValue(dbOption)!; + var ids = parseResult.GetValue(idsOpt); + var module = parseResult.GetValue(moduleOpt); + var status = parseResult.GetValue(statusOpt); + var execute = parseResult.GetValue(executeOpt); + var newStatus = parseResult.GetValue(setStatus)!; + var notes = parseResult.GetValue(setNotes); + + if (string.IsNullOrWhiteSpace(ids) && module is null && string.IsNullOrWhiteSpace(status)) + { + Console.WriteLine("Error: at least one filter (--ids, --module, --status) is required."); + return; + } + + using var db = new Database(dbPath); + var (whereClause, filterParams) = BatchFilters.BuildWhereClause(ids, module, status); + + var setClauses = new List { "status = @newStatus" }; + var updateParams = new List<(string, object?)> { ("@newStatus", newStatus) }; + if (notes is not null) + { + setClauses.Add("notes = @newNotes"); + updateParams.Add(("@newNotes", notes)); + } + + BatchFilters.PreviewOrExecute(db, "unit_tests", + "id, name, status, module_id, notes", + string.Join(", ", setClauses), updateParams, + whereClause, filterParams, execute); + }); + + return cmd; + } + + private static Command CreateBatchMap(Option dbOption) + { + var cmd = new Command("batch-map", "Bulk map tests to .NET test methods"); + var idsOpt = BatchFilters.IdsOption(); + var moduleOpt = BatchFilters.ModuleOption(); + var statusOpt = BatchFilters.StatusOption(); + var executeOpt = BatchFilters.ExecuteOption(); + var setProject = new Option("--set-project") { Description = ".NET test project" }; + var setClass = new Option("--set-class") { Description = ".NET test class" }; + var setMethod = new Option("--set-method") { Description = ".NET test method" }; + + cmd.Add(idsOpt); + cmd.Add(moduleOpt); + cmd.Add(statusOpt); + cmd.Add(executeOpt); + cmd.Add(setProject); + cmd.Add(setClass); + cmd.Add(setMethod); + + cmd.SetAction(parseResult => + { + var dbPath = parseResult.GetValue(dbOption)!; + var ids = parseResult.GetValue(idsOpt); + var module = parseResult.GetValue(moduleOpt); + var status = parseResult.GetValue(statusOpt); + var execute = parseResult.GetValue(executeOpt); + var project = parseResult.GetValue(setProject); + var cls = parseResult.GetValue(setClass); + var method = parseResult.GetValue(setMethod); + + if (string.IsNullOrWhiteSpace(ids) && module is null && string.IsNullOrWhiteSpace(status)) + { + Console.WriteLine("Error: at least one filter (--ids, --module, --status) is required."); + return; + } + if (project is null && cls is null && method is null) + { + Console.WriteLine("Error: at least one of --set-project, --set-class, --set-method is required."); + return; + } + + using var db = new Database(dbPath); + var (whereClause, filterParams) = BatchFilters.BuildWhereClause(ids, module, status); + + var setClauses = new List(); + var updateParams = new List<(string, object?)>(); + if (project is not null) { setClauses.Add("dotnet_project = @setProject"); updateParams.Add(("@setProject", project)); } + if (cls is not null) { setClauses.Add("dotnet_class = @setClass"); updateParams.Add(("@setClass", cls)); } + if (method is not null) { setClauses.Add("dotnet_method = @setMethod"); updateParams.Add(("@setMethod", method)); } + + BatchFilters.PreviewOrExecute(db, "unit_tests", + "id, name, status, dotnet_project, dotnet_class, dotnet_method", + string.Join(", ", setClauses), updateParams, + whereClause, filterParams, execute); + }); + + return cmd; + } + private static string Truncate(string? s, int maxLen) { if (s is null) return "";