mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.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:
+10
-6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user