mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
test(cqrs): 补齐 registry gate 回归
- 新增缺少 ICqrsHandlerRegistry 时的 generator 静默跳过覆盖 - 更新 CQRS 恢复文档与本轮验证记录
This commit is contained in:
parent
857ce08edb
commit
e17fa15a01
@ -2332,6 +2332,37 @@ public class CqrsHandlerRegistryGeneratorTests
|
||||
("CqrsHandlerRegistry.g.cs", AssemblyLevelCqrsHandlerRegistryExpected));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证当 runtime 缺少 generated registry 需要实现的基础注册接口时,
|
||||
/// 生成器会整体跳过发射,避免产出无法承载运行时注册合同的半成品源码。
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void Does_Not_Generate_Registry_When_Runtime_Lacks_Handler_Registry_Interface()
|
||||
{
|
||||
var source = RemoveBlock(
|
||||
HiddenNestedHandlerSelfRegistrationSource,
|
||||
"public interface ICqrsHandlerRegistry",
|
||||
"[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]");
|
||||
var execution = ExecuteGenerator(source);
|
||||
var inputCompilationErrors = execution.InputCompilationDiagnostics
|
||||
.Where(static diagnostic => diagnostic.Severity == DiagnosticSeverity.Error)
|
||||
.ToArray();
|
||||
var generatedCompilationErrors = execution.GeneratedCompilationDiagnostics
|
||||
.Where(static diagnostic => diagnostic.Severity == DiagnosticSeverity.Error)
|
||||
.ToArray();
|
||||
var generatorErrors = execution.GeneratorDiagnostics
|
||||
.Where(static diagnostic => diagnostic.Severity == DiagnosticSeverity.Error)
|
||||
.ToArray();
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(inputCompilationErrors, Is.Empty);
|
||||
Assert.That(generatedCompilationErrors, Is.Empty);
|
||||
Assert.That(generatorErrors, Is.Empty);
|
||||
Assert.That(execution.GeneratedSources, Is.Empty);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证当程序集包含生成代码无法合法引用的私有嵌套处理器时,生成器会在生成注册器内部执行定向反射注册,
|
||||
/// 不再依赖程序集级 fallback marker。
|
||||
|
||||
@ -7,14 +7,15 @@ CQRS 迁移与收敛。
|
||||
|
||||
## 当前恢复点
|
||||
|
||||
- 恢复点编号:`CQRS-REWRITE-RP-078`
|
||||
- 恢复点编号:`CQRS-REWRITE-RP-079`
|
||||
- 当前阶段:`Phase 8`
|
||||
- 当前 PR 锚点:`PR #307`
|
||||
- 当前结论:
|
||||
- `GFramework.Cqrs` 已完成对外部 `Mediator` 的生产级替代,当前主线已从“是否可替代”转向“仓库内部收口与能力深化顺序”
|
||||
- `dispatch/invoker` 生成前移已扩展到 request / stream 路径,`RP-077` 已补齐 request invoker provider gate 与 stream gate 对称的 descriptor / descriptor entry runtime 合同回归
|
||||
- 当前 `RP-078` 已补齐 mixed fallback metadata 在 runtime 不允许多个 fallback attribute 实例时的单字符串 attribute 回退回归
|
||||
- `ai-plan` active 入口现以 `PR #307` 和 `RP-078` 为唯一权威恢复锚点;更早 PR 与阶段细节均以下方归档为准
|
||||
- `RP-078` 已补齐 mixed fallback metadata 在 runtime 不允许多个 fallback attribute 实例时的单字符串 attribute 回退回归
|
||||
- 当前 `RP-079` 已补齐 runtime 缺少 generated handler registry interface 时的 generator 静默跳过回归
|
||||
- `ai-plan` active 入口现以 `PR #307` 和 `RP-079` 为唯一权威恢复锚点;更早 PR 与阶段细节均以下方归档为准
|
||||
|
||||
## 当前活跃事实
|
||||
|
||||
@ -52,11 +53,18 @@ CQRS 迁移与收敛。
|
||||
- 备注:当前 WSL worktree 需要显式绑定 `GIT_DIR` / `GIT_WORK_TREE` 后运行
|
||||
- `git diff --check`
|
||||
- 结果:通过
|
||||
- `dotnet test GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj -c Release --filter "FullyQualifiedName~CqrsHandlerRegistryGeneratorTests.Does_Not_Generate_Registry_When_Runtime_Lacks_Handler_Registry_Interface"`
|
||||
- 结果:通过,`1/1` passed
|
||||
- `python3 scripts/license-header.py --check`
|
||||
- 结果:通过
|
||||
- 备注:当前 WSL worktree 需要显式绑定 `GIT_DIR` / `GIT_WORK_TREE` 后运行
|
||||
- `git diff --check`
|
||||
- 结果:通过
|
||||
|
||||
## 下一推荐步骤
|
||||
|
||||
1. 继续处理 `PR #307` 的剩余 review 收尾,优先保持 `ai-plan` active 入口与 trace 的单一锚点一致
|
||||
2. 若继续推进代码切片,优先复核 fallback metadata 与 generated invoker provider 之外是否还有同类 runtime contract gate 回归缺口
|
||||
2. 若继续推进代码切片,优先复核基础 generation gate 中其他必需 runtime contracts 是否也需要同类回归覆盖
|
||||
3. 在进入下一批 runtime / generator 收敛前,保持最小 Release build 或 targeted test 作为权威验证
|
||||
|
||||
## 活跃文档
|
||||
|
||||
@ -87,3 +87,25 @@
|
||||
|
||||
1. 继续复算 branch diff vs `origin/main`,若仍低于 `25` 个文件可继续下一批
|
||||
2. 下一批优先查看 fallback metadata 与 generated invoker provider 之外是否还有同类 runtime contract gate 回归缺口
|
||||
|
||||
### 阶段:基础 generated registry contract gate 回归(CQRS-REWRITE-RP-079)
|
||||
|
||||
- 继续沿用 `$gframework-batch-boot 25`,当前 branch diff 仍低于阈值
|
||||
- 复核 generator 基础启用条件后确认:缺少 `ICqrsHandlerRegistry` 时,runtime 不具备承载 generated registry 的基础接口合同,应整体跳过发射
|
||||
- 已补齐:
|
||||
- `Does_Not_Generate_Registry_When_Runtime_Lacks_Handler_Registry_Interface`
|
||||
|
||||
### 验证(RP-079)
|
||||
|
||||
- `dotnet test GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj -c Release --filter "FullyQualifiedName~CqrsHandlerRegistryGeneratorTests.Does_Not_Generate_Registry_When_Runtime_Lacks_Handler_Registry_Interface"`
|
||||
- 结果:通过,`1/1` passed
|
||||
- `python3 scripts/license-header.py --check`
|
||||
- 结果:通过
|
||||
- 备注:当前 WSL worktree 需要显式绑定 `GIT_DIR` / `GIT_WORK_TREE` 后运行
|
||||
- `git diff --check`
|
||||
- 结果:通过
|
||||
|
||||
### 当前下一步(RP-079)
|
||||
|
||||
1. 继续复算 branch diff vs `origin/main`,若仍低于 `25` 个文件可继续下一批
|
||||
2. 下一批优先复核基础 generation gate 中其他必需 runtime contracts 是否也需要同类回归覆盖
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user