.NET Workflows - Enable "human in the loop" case for declarative integration tests (#1171)

* Enabled

* Rollback visitor

* Update dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/WorkflowTest.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Chris
2025-10-03 17:24:22 +00:00
committed by GitHub
co-authored by Copilot
parent 3ee7461b59
commit 880a99ca05
12 changed files with 156 additions and 32 deletions
@@ -29,7 +29,7 @@ public sealed class DeclarativeCodeGenTest(ITestOutputHelper output) : WorkflowT
[InlineData("Marketing.yaml", "Marketing.json", true)]
[InlineData("MathChat.yaml", "MathChat.json", true)]
[InlineData("DeepResearch.yaml", "DeepResearch.json", Skip = "Long running")]
[InlineData("HumanInLoop.yaml", "HumanInLoop.json", Skip = "Needs test support")]
[InlineData("HumanInLoop.yaml", "HumanInLoop.json", Skip = "Needs template support")]
public Task ValidateScenarioAsync(string workflowFileName, string testcaseFileName, bool externalConveration = false) =>
this.RunWorkflowAsync(Path.Combine(GetRepoFolder(), "workflow-samples", workflowFileName), testcaseFileName, externalConveration);
@@ -41,11 +41,15 @@ public sealed class DeclarativeCodeGenTest(ITestOutputHelper output) : WorkflowT
string workflowProviderCode = DeclarativeWorkflowBuilder.Eject(workflowPath, DeclarativeWorkflowLanguage.CSharp, WorkflowNamespace, WorkflowPrefix);
try
{
WorkflowEvents workflowEvents = await WorkflowHarness.RunCodeAsync(workflowProviderCode, $"{WorkflowPrefix}WorkflowProvider", WorkflowNamespace, workflowOptions, (TInput)GetInput<TInput>(testcase));
foreach (ExecutorEvent invokeEvent in workflowEvents.ExecutorInvokeEvents)
{
this.Output.WriteLine($"EXEC: {invokeEvent.ExecutorId}");
}
WorkflowHarness harness = await WorkflowHarness.GenerateCodeAsync(
runId: Path.GetFileNameWithoutExtension(workflowPath),
workflowProviderCode,
workflowProviderName: $"{WorkflowPrefix}WorkflowProvider",
WorkflowNamespace,
workflowOptions,
(TInput)GetInput<TInput>(testcase));
WorkflowEvents workflowEvents = await harness.RunTestcaseAsync(testcase, (TInput)GetInput<TInput>(testcase)).ConfigureAwait(false);
Assert.Empty(workflowEvents.ActionInvokeEvents);
Assert.Empty(workflowEvents.ActionCompleteEvents);