392 references to CompletionState
Aspire.Hosting (94)
Ats\PipelineExports.cs (5)
190private static CompletionState ParseCompletionState(string completionState) 196"inprogress" or "in_progress" or "in-progress" => CompletionState.InProgress, 197"completed" => CompletionState.Completed, 198"completedwithwarning" or "completed_with_warning" or "completed-with-warning" => CompletionState.CompletedWithWarning, 199"completedwitherror" or "completed_with_error" or "completed-with-error" => CompletionState.CompletedWithError,
Pipelines\IPipelineActivityReporter.cs (1)
44Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default);
Pipelines\IReportingStep.cs (4)
58Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default); 66Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default);
Pipelines\IReportingTask.cs (4)
31Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default); 39Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default);
Pipelines\NullPipelineActivityReporter.cs (9)
27public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 62public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 67public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 90public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 95public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Pipelines\PipelineActivityReporter.cs (30)
32private static string ToBackchannelCompletionState(CompletionState state) => state switch 34CompletionState.InProgress => CompletionStates.InProgress, 35CompletionState.Completed => CompletionStates.Completed, 36CompletionState.CompletedWithWarning => CompletionStates.CompletedWithWarning, 37CompletionState.CompletedWithError => CompletionStates.CompletedWithError, 41private static PublishingActivityData CreateStepActivityData(ReportingStep step, string statusText, CompletionState completionState, bool enableMarkdown) 73Data = CreateStepActivityData(step, step.Title, CompletionState.InProgress, enableMarkdown: false) 89if (parentStep.CompletionState != CompletionState.InProgress) 107CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 117public async Task CompleteStepAsync(ReportingStep step, string completionText, CompletionState completionState, bool enableMarkdown, CancellationToken cancellationToken) 122if (step.CompletionState != CompletionState.InProgress) 149if (parentStep.CompletionState != CompletionState.InProgress) 164CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 182if (parentStep.CompletionState != CompletionState.InProgress) 195CompletionState = ToBackchannelCompletionState(CompletionState.Completed), 206public async Task CompleteTaskAsync(ReportingTask task, CompletionState completionState, string? completionMessage, bool enableMarkdown, CancellationToken cancellationToken) 214if (task.CompletionState != CompletionState.InProgress) 221if (parentStep.CompletionState != CompletionState.InProgress) 250var finalState = options?.CompletionState ?? CalculateOverallAggregatedState(); 260CompletionState.Completed => "Pipeline completed successfully", 261CompletionState.CompletedWithWarning => "Pipeline completed with warnings", 262CompletionState.CompletedWithError => "Pipeline completed with errors", 279public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 291private CompletionState CalculateOverallAggregatedState() 295return CompletionState.Completed; 298var maxState = CompletionState.InProgress; 301var stepState = step.CompletionState; 362CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 393CompletionState = ToBackchannelCompletionState(CompletionState.InProgress),
Pipelines\PipelineStepHelpers.cs (4)
91CompletionState.Completed, 98CompletionState.CompletedWithError, 131CompletionState.Completed, 138CompletionState.CompletedWithError,
Pipelines\PublishCompletionOptions.cs (1)
20public CompletionState? CompletionState { get; set; }
Pipelines\ReportingStep.cs (16)
49public CompletionState CompletionState 55private CompletionState _completionState = CompletionState.InProgress; 83internal CompletionState CalculateAggregatedState() 87return CompletionState.Completed; 90var maxState = CompletionState.InProgress; 163public async Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 174public async Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 197if (CompletionState != CompletionState.InProgress) 203var finalState = CalculateAggregatedState(); 209CompletionState.Completed => $"{Title} completed successfully", 210CompletionState.CompletedWithWarning => $"{Title} completed with warnings", 211CompletionState.CompletedWithError => $"{Title} completed with errors",
Pipelines\ReportingTask.cs (7)
42public CompletionState CompletionState { get; internal set; } = CompletionState.InProgress; 63public async Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 69public async Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 80if (CompletionState != CompletionState.InProgress)
Publishing\PipelineExecutor.cs (1)
90await activityReporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = ex.Message, CompletionState = CompletionState.CompletedWithError }, stoppingToken).ConfigureAwait(false);
Publishing\PublishingExtensions.cs (12)
25await step.CompleteAsync(completionText, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 41await step.CompleteAsync(message, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 58await step.CompleteAsync(completionText, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 74await step.CompleteAsync(message, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 91await step.CompleteAsync(completionText, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false); 107await step.CompleteAsync(errorMessage, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false); 155await task.CompleteAsync(message, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 171await task.CompleteAsync(message, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 187await task.CompleteAsync(message, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 203await task.CompleteAsync(message, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 219await task.CompleteAsync(errorMessage, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false); 235await task.CompleteAsync(errorMessage, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure (14)
AzureBicepResource.cs (3)
355CompletionState.Completed, 366CompletionState.Completed, 381CompletionState.CompletedWithError,
AzureEnvironmentResource.cs (9)
206CompletionState.Completed, 213CompletionState.CompletedWithError, 235CompletionState.Completed, 269CompletionState.Completed, 294CompletionState.Completed, 309CompletionState.Completed, 319CompletionState.Completed, 370CompletionState.Completed, 377CompletionState.CompletedWithError,
AzurePublishingContext.cs (2)
3820 => ("No azure compute environments found in the model.", CompletionState.CompletedWithWarning), 383_ => ($"Found {computeEnvironments.Count} compute environment(s) in the model.", CompletionState.Completed)
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppEnvironmentResource.cs (1)
164CompletionState.Completed,
Aspire.Hosting.Azure.AppService (4)
AzureAppServiceEnvironmentResource.cs (4)
251CompletionState.Completed, 262CompletionState.Completed, 303CompletionState.CompletedWithError, 312CompletionState.Completed,
Aspire.Hosting.Azure.ContainerRegistry (1)
AzureContainerRegistryHelpers.cs (1)
53CompletionState.Completed,
Aspire.Hosting.Azure.Kubernetes.Tests (21)
AzureKubernetesInfrastructureTests.cs (8)
614step => step is ("destroy-azure-azure-environment", _, CompletionState.Completed)); 665step => step is ("destroy-azure-azure-environment", _, CompletionState.Completed)); 737step => step is ("destroy-azure-azure-environment", _, CompletionState.Completed)); 788step => step is ("destroy-azure-azure-environment", _, CompletionState.Completed)); 860step => step is ("destroy-azure-azure-environment", _, CompletionState.Completed)); 932step => step is ("pipeline-execution", "Completed successfully", CompletionState.Completed)); 1002step => step is ("pipeline-execution", "Completed successfully", CompletionState.Completed)); 1091Assert.Equal(CompletionState.CompletedWithError, reporter.ResultCompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
44public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 49public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 69public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 84public CompletionState? ResultCompletionState { get; private set; } 145public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 191public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 248public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 270public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 298public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Azure.Sandboxes (8)
AzureSandboxContainerDeployment.cs (7)
312await diskTask.CompleteAsync($"Created sandbox disk image {diskImageId}", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 338await createTask.CompleteAsync($"Created sandbox {sandboxId}", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 351await lifecycleTask.CompleteAsync("Lifecycle policy configured", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 376await exposeTask.CompleteAsync(new MarkdownString($"Public URL: [{endpointUrl}]({endpointUrl})"), CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 1333CompletionState.CompletedWithWarning, 1351CompletionState.Completed, 1466await cleanupTask.CompleteAsync($"Deleted stale sandbox deployment {sectionName}", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false);
AzureSandboxGroupResource.cs (1)
177CompletionState.Completed,
Aspire.Hosting.Azure.Tests (33)
AzureAppServiceTests.cs (3)
241step.CompletionState == CompletionState.Completed); 277step.CompletionState == CompletionState.CompletedWithError); 311step.CompletionState == CompletionState.Completed);
AzureContainerAppExpressEndpointTests.cs (1)
234Assert.NotEqual(CompletionState.CompletedWithError, reporter.ResultCompletionState);
AzureDeployerTests.cs (16)
180Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 235Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 290Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 350Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 416Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 484Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 521Assert.NotEqual(CompletionState.CompletedWithError, reporter.ResultCompletionState); 606Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 690Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 953Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 1015Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 1225Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 1507.Where(s => s.CompletionState == CompletionState.CompletedWithError) 1512.Where(t => t.CompletionState == CompletionState.CompletedWithError) 2146Assert.Equal(CompletionState.CompletedWithError, loginStep.CompletionState); 2168Assert.Equal(CompletionState.Completed, loginStep.CompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
44public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 49public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 69public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 84public CompletionState? ResultCompletionState { get; private set; } 145public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 191public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 248public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 270public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 298public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Docker (6)
DockerComposeEnvironmentResource.cs (6)
151CompletionState.Completed, 180CompletionState.Completed, 460CompletionState.Completed, 465await deployTask.CompleteAsync($"Compose deployment failed ({runtime.Name}): {ex.Message}", CompletionState.CompletedWithError, context.CancellationToken).ConfigureAwait(false); 498CompletionState.Completed, 503await deployTask.CompleteAsync($"Compose shutdown failed ({runtime.Name}): {ex.Message}", CompletionState.CompletedWithError, context.CancellationToken).ConfigureAwait(false);
Aspire.Hosting.Docker.Tests (13)
tests\Shared\TestPipelineActivityReporter.cs (13)
44public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 49public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 69public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 84public CompletionState? ResultCompletionState { get; private set; } 145public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 191public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 248public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 270public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 298public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Foundry.Tests (13)
tests\Shared\TestPipelineActivityReporter.cs (13)
44public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 49public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 69public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 84public CompletionState? ResultCompletionState { get; private set; } 145public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 191public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 248public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 270public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 298public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Java.Tests (13)
tests\Shared\TestPipelineActivityReporter.cs (13)
44public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 49public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 69public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 84public CompletionState? ResultCompletionState { get; private set; } 145public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 191public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 248public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 270public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 298public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Kubernetes (7)
Deployment\HelmDeploymentEngine.cs (7)
208CompletionState.Completed, 270CompletionState.Completed, 277CompletionState.CompletedWithError, 495CompletionState.Completed, 503CompletionState.CompletedWithError, 640CompletionState.Completed, 648CompletionState.CompletedWithError,
Aspire.Hosting.Kubernetes.Tests (16)
KubernetesDeployTests.cs (1)
2042step => step is ("pipeline-execution", "Completed successfully", CompletionState.Completed));
KubernetesPublisherTests.cs (2)
1074Assert.Equal(CompletionState.CompletedWithError, reporter.ResultCompletionState); 1100Assert.Equal(CompletionState.CompletedWithError, reporter.ResultCompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
44public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 49public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 69public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 84public CompletionState? ResultCompletionState { get; private set; } 145public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 191public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 248public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 270public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 298public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Rust.Tests (15)
AddRustAppPublishTests.cs (2)
411Assert.Equal(CompletionState.CompletedWithError, reporter.ResultCompletionState); 466Assert.Equal(CompletionState.CompletedWithError, reporter.ResultCompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
44public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 49public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 69public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 84public CompletionState? ResultCompletionState { get; private set; } 145public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 191public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 248public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 270public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 298public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Tests (111)
Pipelines\DistributedApplicationPipelineTests.cs (2)
901Assert.Contains(reporter.CompletedSteps, step => step.StepTitle == "failing-step" && step.CompletionState == CompletionState.CompletedWithError); 1271Assert.Contains(reporter.CompletedSteps, step => step.StepTitle == "failing-step" && step.CompletionState == CompletionState.CompletedWithError);
Pipelines\PipelineLoggerProviderTests.cs (3)
139public Task CompleteAsync(string statusText, CompletionState completionState, CancellationToken cancellationToken = default) 144public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Publishing\PipelineActivityReporterTests.cs (88)
37Assert.Equal(CompletionState.InProgress, stepInternal.CompletionState); 71await step.CompleteAsync("Done", CompletionState.Completed, CancellationToken.None); 124Assert.Equal(CompletionState.InProgress, taskInternal.CompletionState); 161await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 185await step.CompleteAsync(completionText, isError ? CompletionState.CompletedWithError : CompletionState.Completed, CancellationToken.None); 189Assert.NotEqual(CompletionState.InProgress, stepInternal.CompletionState); 265await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 295Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); 319await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 330[InlineData(CompletionState.Completed, "Pipeline completed successfully", false)] 331[InlineData(CompletionState.CompletedWithError, "Pipeline completed with errors", true)] 332[InlineData(CompletionState.CompletedWithWarning, "Pipeline completed with warnings", false)] 333public async Task CompletePublishAsync_EmitsCorrectActivity(CompletionState completionState, string expectedStatusText, bool expectedIsError) 349Assert.Equal(completionState == CompletionState.CompletedWithWarning, activity.Data.IsWarning); 360await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = expectedStatusText, CompletionState = CompletionState.CompletedWithError }, CancellationToken.None); 385await step1.CompleteAsync("Step 1 completed", CompletionState.Completed, CancellationToken.None); 389await step2.CompleteAsync("Step 2 completed with warning", CompletionState.CompletedWithWarning, CancellationToken.None); 393await step3.CompleteAsync("Step 3 failed", CompletionState.CompletedWithError, CancellationToken.None); 449Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); 462await task.CompleteAsync((string?)null, CompletionState.Completed, cancellationToken: CancellationToken.None); 468await task.CompleteAsync("Error", CompletionState.CompletedWithError, cancellationToken: CancellationToken.None); 474Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); // Original state is retained 498Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 511await step.CompleteAsync("Complete", CompletionState.Completed, cancellationToken: CancellationToken.None); 517await step.CompleteAsync("Error", CompletionState.CompletedWithError, cancellationToken: CancellationToken.None); 523Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); // Original state is retained 540await step.CompleteAsync("Step completed", CompletionState.Completed, CancellationToken.None); 551await task.CompleteAsync("Error", CompletionState.CompletedWithError, cancellationToken: CancellationToken.None); // Should also not throw (noop) 758var aggregatedState = stepInternal.CalculateAggregatedState(); 761Assert.Equal(CompletionState.Completed, aggregatedState); 779Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 813Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 834await step.CompleteAsync("Step completed manually", CompletionState.Completed, CancellationToken.None); 845Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 869Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 904Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState); 920[InlineData(CompletionState.Completed, "Pipeline completed successfully", false)] 921[InlineData(CompletionState.CompletedWithError, "Pipeline completed with errors", true)] 922[InlineData(CompletionState.CompletedWithWarning, "Pipeline completed with warnings", false)] 923public async Task CompletePublishAsync_WithDeployFlag_EmitsCorrectActivity(CompletionState completionState, string expectedStatusText, bool expectedIsError) 939Assert.Equal(completionState == CompletionState.CompletedWithWarning, activity.Data.IsWarning); 950await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = expectedStatusText, CompletionState = CompletionState.CompletedWithError }, CancellationToken.None); 976await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionState = CompletionState.Completed, PipelineSummary = pipelineSummary }, CancellationToken.None); 1003await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionState = CompletionState.Completed }, CancellationToken.None); 1100await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 1190await task.CompleteAsync(new MarkdownString("Deployed to **Azure**"), CompletionState.Completed, CancellationToken.None); 1209await step.CompleteAsync(new MarkdownString("Step **completed** successfully"), CompletionState.Completed, CancellationToken.None); 1229await task.CompleteAsync("Warning message", CompletionState.CompletedWithWarning, CancellationToken.None); 1235await task.CompleteAsync("Different warning message", CompletionState.CompletedWithWarning, CancellationToken.None); 1241Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 1254await task.CompleteAsync("Error message", CompletionState.CompletedWithError, CancellationToken.None); 1260await task.CompleteAsync("Different error message", CompletionState.CompletedWithError, CancellationToken.None); 1266Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState); 1278await step.CompleteAsync("Warning", CompletionState.CompletedWithWarning, CancellationToken.None); 1284await step.CompleteAsync("Different warning", CompletionState.CompletedWithWarning, CancellationToken.None); 1290Assert.Equal(CompletionState.CompletedWithWarning, stepInternal.CompletionState); 1302await step.CompleteAsync("Error", CompletionState.CompletedWithError, CancellationToken.None); 1308await step.CompleteAsync("Different error", CompletionState.CompletedWithError, CancellationToken.None); 1314Assert.Equal(CompletionState.CompletedWithError, stepInternal.CompletionState); 1318[InlineData(CompletionState.Completed, CompletionState.CompletedWithWarning)] 1319[InlineData(CompletionState.Completed, CompletionState.CompletedWithError)] 1320[InlineData(CompletionState.CompletedWithWarning, CompletionState.Completed)] 1321[InlineData(CompletionState.CompletedWithWarning, CompletionState.CompletedWithError)] 1322[InlineData(CompletionState.CompletedWithError, CompletionState.Completed)] 1323[InlineData(CompletionState.CompletedWithError, CompletionState.CompletedWithWarning)] 1324public async Task CompleteTaskAsync_IdempotentWhenTransitioningBetweenTerminalStates(CompletionState firstState, CompletionState secondState) 1349[InlineData(CompletionState.Completed, CompletionState.CompletedWithWarning)] 1350[InlineData(CompletionState.Completed, CompletionState.CompletedWithError)] 1351[InlineData(CompletionState.CompletedWithWarning, CompletionState.Completed)] 1352[InlineData(CompletionState.CompletedWithWarning, CompletionState.CompletedWithError)] 1353[InlineData(CompletionState.CompletedWithError, CompletionState.Completed)] 1354[InlineData(CompletionState.CompletedWithError, CompletionState.CompletedWithWarning)] 1355public async Task CompleteStepAsync_IdempotentWhenTransitioningBetweenTerminalStates(CompletionState firstState, CompletionState secondState)
Publishing\PublishingExtensionsTests.cs (5)
32Assert.Equal(CompletionState.InProgress, taskInternal.CompletionState); 49Assert.NotEqual(CompletionState.InProgress, stepInternal.CompletionState); 86Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); 104Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 121Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
44public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 49public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 69public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 84public CompletionState? ResultCompletionState { get; private set; } 145public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 191public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 248public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 270public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 298public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Pipelines.AppHost (12)
AppHost.cs (12)
86CompletionState.CompletedWithWarning, 101CompletionState.CompletedWithWarning, 121CompletionState.CompletedWithWarning, 136CompletionState.CompletedWithWarning, 156CompletionState.CompletedWithWarning, 171CompletionState.CompletedWithWarning, 194CompletionState.CompletedWithWarning, 206CompletionState.CompletedWithWarning, 213CompletionState.Completed, 220CompletionState.CompletedWithWarning, 272CompletionState.CompletedWithWarning, 317CompletionState.Completed,
Pipelines.Library (7)
DistributedApplicationPipelineExtensions.cs (7)
85CompletionState.CompletedWithError, 97CompletionState.CompletedWithError, 104CompletionState.Completed, 116CompletionState.Completed, 134CompletionState.CompletedWithError, 160CompletionState.CompletedWithError, 167CompletionState.Completed,
SimplePipelines.AppHost (3)
AppHost.cs (3)
18CompletionState.Completed, 36CompletionState.Completed, 54CompletionState.Completed,