379 references to CompletionState
Aspire.Hosting (94)
Ats\PipelineExports.cs (5)
192
private static
CompletionState
ParseCompletionState(string completionState)
198
"inprogress" or "in_progress" or "in-progress" =>
CompletionState
.InProgress,
199
"completed" =>
CompletionState
.Completed,
200
"completedwithwarning" or "completed_with_warning" or "completed-with-warning" =>
CompletionState
.CompletedWithWarning,
201
"completedwitherror" or "completed_with_error" or "completed-with-error" =>
CompletionState
.CompletedWithError,
Pipelines\IPipelineActivityReporter.cs (1)
47
Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default);
Pipelines\IReportingStep.cs (4)
60
Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default);
68
Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default);
Pipelines\IReportingTask.cs (4)
34
Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default);
42
Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default);
Pipelines\NullPipelineActivityReporter.cs (9)
31
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
67
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
72
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
96
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
101
public Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Pipelines\PipelineActivityReporter.cs (30)
34
private static string ToBackchannelCompletionState(
CompletionState
state) => state switch
36
CompletionState
.InProgress => CompletionStates.InProgress,
37
CompletionState
.Completed => CompletionStates.Completed,
38
CompletionState
.CompletedWithWarning => CompletionStates.CompletedWithWarning,
39
CompletionState
.CompletedWithError => CompletionStates.CompletedWithError,
43
private static PublishingActivityData CreateStepActivityData(ReportingStep step, string statusText,
CompletionState
completionState, bool enableMarkdown)
75
Data = CreateStepActivityData(step, step.Title,
CompletionState
.InProgress, enableMarkdown: false)
91
if (parentStep.CompletionState !=
CompletionState
.InProgress)
109
CompletionState = ToBackchannelCompletionState(
CompletionState
.InProgress),
119
public async Task CompleteStepAsync(ReportingStep step, string completionText,
CompletionState
completionState, bool enableMarkdown, CancellationToken cancellationToken)
124
if (step.CompletionState !=
CompletionState
.InProgress)
151
if (parentStep.CompletionState !=
CompletionState
.InProgress)
166
CompletionState = ToBackchannelCompletionState(
CompletionState
.InProgress),
184
if (parentStep.CompletionState !=
CompletionState
.InProgress)
197
CompletionState = ToBackchannelCompletionState(
CompletionState
.Completed),
208
public async Task CompleteTaskAsync(ReportingTask task,
CompletionState
completionState, string? completionMessage, bool enableMarkdown, CancellationToken cancellationToken)
216
if (task.CompletionState !=
CompletionState
.InProgress)
223
if (parentStep.CompletionState !=
CompletionState
.InProgress)
252
var
finalState = options?.CompletionState ?? CalculateOverallAggregatedState();
262
CompletionState
.Completed => "Pipeline completed successfully",
263
CompletionState
.CompletedWithWarning => "Pipeline completed with warnings",
264
CompletionState
.CompletedWithError => "Pipeline completed with errors",
281
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
293
private
CompletionState
CalculateOverallAggregatedState()
297
return
CompletionState
.Completed;
300
var
maxState =
CompletionState
.InProgress;
303
var
stepState = step.CompletionState;
364
CompletionState = ToBackchannelCompletionState(
CompletionState
.InProgress),
395
CompletionState = ToBackchannelCompletionState(
CompletionState
.InProgress),
Pipelines\PipelineStepHelpers.cs (4)
92
CompletionState
.Completed,
99
CompletionState
.CompletedWithError,
132
CompletionState
.Completed,
139
CompletionState
.CompletedWithError,
Pipelines\PublishCompletionOptions.cs (1)
23
public
CompletionState
? CompletionState { get; set; }
Pipelines\ReportingStep.cs (16)
53
public
CompletionState
CompletionState
59
private
CompletionState
_completionState =
CompletionState
.InProgress;
87
internal
CompletionState
CalculateAggregatedState()
91
return
CompletionState
.Completed;
94
var
maxState =
CompletionState
.InProgress;
167
public async Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
178
public async Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
201
if (CompletionState !=
CompletionState
.InProgress)
207
var
finalState = CalculateAggregatedState();
213
CompletionState
.Completed => $"{Title} completed successfully",
214
CompletionState
.CompletedWithWarning => $"{Title} completed with warnings",
215
CompletionState
.CompletedWithError => $"{Title} completed with errors",
Pipelines\ReportingTask.cs (7)
47
public
CompletionState
CompletionState { get; internal set; } =
CompletionState
.InProgress;
68
public async Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
74
public async Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
85
if (CompletionState !=
CompletionState
.InProgress)
Publishing\PipelineExecutor.cs (1)
93
await activityReporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = ex.Message, CompletionState =
CompletionState
.CompletedWithError }, stoppingToken).ConfigureAwait(false);
Publishing\PublishingExtensions.cs (12)
30
await step.CompleteAsync(completionText,
CompletionState
.Completed, cancellationToken).ConfigureAwait(false);
46
await step.CompleteAsync(message,
CompletionState
.Completed, cancellationToken).ConfigureAwait(false);
63
await step.CompleteAsync(completionText,
CompletionState
.CompletedWithWarning, cancellationToken).ConfigureAwait(false);
79
await step.CompleteAsync(message,
CompletionState
.CompletedWithWarning, cancellationToken).ConfigureAwait(false);
96
await step.CompleteAsync(completionText,
CompletionState
.CompletedWithError, cancellationToken).ConfigureAwait(false);
112
await step.CompleteAsync(errorMessage,
CompletionState
.CompletedWithError, cancellationToken).ConfigureAwait(false);
160
await task.CompleteAsync(message,
CompletionState
.Completed, cancellationToken).ConfigureAwait(false);
176
await task.CompleteAsync(message,
CompletionState
.Completed, cancellationToken).ConfigureAwait(false);
192
await task.CompleteAsync(message,
CompletionState
.CompletedWithWarning, cancellationToken).ConfigureAwait(false);
208
await task.CompleteAsync(message,
CompletionState
.CompletedWithWarning, cancellationToken).ConfigureAwait(false);
224
await task.CompleteAsync(errorMessage,
CompletionState
.CompletedWithError, cancellationToken).ConfigureAwait(false);
240
await task.CompleteAsync(errorMessage,
CompletionState
.CompletedWithError, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure (14)
AzureBicepResource.cs (3)
359
CompletionState
.Completed,
370
CompletionState
.Completed,
385
CompletionState
.CompletedWithError,
AzureEnvironmentResource.cs (9)
210
CompletionState
.Completed,
217
CompletionState
.CompletedWithError,
239
CompletionState
.Completed,
273
CompletionState
.Completed,
298
CompletionState
.Completed,
313
CompletionState
.Completed,
323
CompletionState
.Completed,
374
CompletionState
.Completed,
381
CompletionState
.CompletedWithError,
AzurePublishingContext.cs (2)
366
0 => ("No azure compute environments found in the model.",
CompletionState
.CompletedWithWarning),
367
_ => ($"Found {computeEnvironments.Count} compute environment(s) in the model.",
CompletionState
.Completed)
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppEnvironmentResource.cs (1)
166
CompletionState
.Completed,
Aspire.Hosting.Azure.AppService (4)
AzureAppServiceEnvironmentResource.cs (4)
251
CompletionState
.Completed,
262
CompletionState
.Completed,
303
CompletionState
.CompletedWithError,
312
CompletionState
.Completed,
Aspire.Hosting.Azure.ContainerRegistry (1)
AzureContainerRegistryHelpers.cs (1)
55
CompletionState
.Completed,
Aspire.Hosting.Azure.Kubernetes.Tests (13)
tests\Shared\TestPipelineActivityReporter.cs (13)
46
public List<(string StepTitle, string CompletionText,
CompletionState
CompletionState)> CompletedSteps { get; } = [];
51
public List<(string TaskStatusText, string? CompletionMessage,
CompletionState
CompletionState)> CompletedTasks { get; } = [];
71
public Action<string, string,
CompletionState
>? OnStepCompleted { get; set; }
86
public
CompletionState
? ResultCompletionState { get; private set; }
147
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
193
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
250
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
272
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
300
public Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Azure.Sandboxes (7)
AzureSandboxContainerDeployment.cs (7)
294
await diskTask.CompleteAsync($"Created sandbox disk image {diskImageId}",
CompletionState
.Completed, context.CancellationToken).ConfigureAwait(false);
320
await createTask.CompleteAsync($"Created sandbox {sandboxId}",
CompletionState
.Completed, context.CancellationToken).ConfigureAwait(false);
333
await lifecycleTask.CompleteAsync("Lifecycle policy configured",
CompletionState
.Completed, context.CancellationToken).ConfigureAwait(false);
363
await exposeTask.CompleteAsync(new MarkdownString($"Public URL: [{endpointUrl}]({endpointUrl})"),
CompletionState
.Completed, context.CancellationToken).ConfigureAwait(false);
1293
CompletionState
.CompletedWithWarning,
1311
CompletionState
.Completed,
1426
await cleanupTask.CompleteAsync($"Deleted stale sandbox deployment {sectionName}",
CompletionState
.Completed, context.CancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure.Tests (30)
AzureAppServiceTests.cs (2)
226
step.CompletionState ==
CompletionState
.CompletedWithError);
264
step.CompletionState ==
CompletionState
.Completed);
AzureDeployerTests.cs (15)
183
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
238
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
293
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
353
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
419
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
487
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
547
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
631
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
894
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
956
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
1166
Assert.NotEqual(
CompletionState
.CompletedWithError, mockActivityReporter.ResultCompletionState);
1448
.Where(s => s.CompletionState ==
CompletionState
.CompletedWithError)
1453
.Where(t => t.CompletionState ==
CompletionState
.CompletedWithError)
2083
Assert.Equal(
CompletionState
.CompletedWithError, loginStep.CompletionState);
2105
Assert.Equal(
CompletionState
.Completed, loginStep.CompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
46
public List<(string StepTitle, string CompletionText,
CompletionState
CompletionState)> CompletedSteps { get; } = [];
51
public List<(string TaskStatusText, string? CompletionMessage,
CompletionState
CompletionState)> CompletedTasks { get; } = [];
71
public Action<string, string,
CompletionState
>? OnStepCompleted { get; set; }
86
public
CompletionState
? ResultCompletionState { get; private set; }
147
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
193
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
250
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
272
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
300
public Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Docker (6)
DockerComposeEnvironmentResource.cs (6)
153
CompletionState
.Completed,
182
CompletionState
.Completed,
434
CompletionState
.Completed,
439
await deployTask.CompleteAsync($"Compose deployment failed ({runtime.Name}): {ex.Message}",
CompletionState
.CompletedWithError, context.CancellationToken).ConfigureAwait(false);
472
CompletionState
.Completed,
477
await 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)
46
public List<(string StepTitle, string CompletionText,
CompletionState
CompletionState)> CompletedSteps { get; } = [];
51
public List<(string TaskStatusText, string? CompletionMessage,
CompletionState
CompletionState)> CompletedTasks { get; } = [];
71
public Action<string, string,
CompletionState
>? OnStepCompleted { get; set; }
86
public
CompletionState
? ResultCompletionState { get; private set; }
147
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
193
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
250
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
272
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
300
public Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Foundry.Tests (13)
tests\Shared\TestPipelineActivityReporter.cs (13)
46
public List<(string StepTitle, string CompletionText,
CompletionState
CompletionState)> CompletedSteps { get; } = [];
51
public List<(string TaskStatusText, string? CompletionMessage,
CompletionState
CompletionState)> CompletedTasks { get; } = [];
71
public Action<string, string,
CompletionState
>? OnStepCompleted { get; set; }
86
public
CompletionState
? ResultCompletionState { get; private set; }
147
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
193
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
250
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
272
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
300
public Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Java.Tests (13)
tests\Shared\TestPipelineActivityReporter.cs (13)
46
public List<(string StepTitle, string CompletionText,
CompletionState
CompletionState)> CompletedSteps { get; } = [];
51
public List<(string TaskStatusText, string? CompletionMessage,
CompletionState
CompletionState)> CompletedTasks { get; } = [];
71
public Action<string, string,
CompletionState
>? OnStepCompleted { get; set; }
86
public
CompletionState
? ResultCompletionState { get; private set; }
147
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
193
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
250
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
272
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
300
public Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Kubernetes (7)
Deployment\HelmDeploymentEngine.cs (7)
199
CompletionState
.Completed,
267
CompletionState
.Completed,
274
CompletionState
.CompletedWithError,
492
CompletionState
.Completed,
500
CompletionState
.CompletedWithError,
619
CompletionState
.Completed,
627
CompletionState
.CompletedWithError,
Aspire.Hosting.Kubernetes.Tests (15)
KubernetesPublisherTests.cs (2)
971
Assert.Equal(
CompletionState
.CompletedWithError, reporter.ResultCompletionState);
997
Assert.Equal(
CompletionState
.CompletedWithError, reporter.ResultCompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
46
public List<(string StepTitle, string CompletionText,
CompletionState
CompletionState)> CompletedSteps { get; } = [];
51
public List<(string TaskStatusText, string? CompletionMessage,
CompletionState
CompletionState)> CompletedTasks { get; } = [];
71
public Action<string, string,
CompletionState
>? OnStepCompleted { get; set; }
86
public
CompletionState
? ResultCompletionState { get; private set; }
147
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
193
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
250
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
272
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
300
public Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Rust.Tests (15)
AddRustAppPublishTests.cs (2)
413
Assert.Equal(
CompletionState
.CompletedWithError, reporter.ResultCompletionState);
468
Assert.Equal(
CompletionState
.CompletedWithError, reporter.ResultCompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
46
public List<(string StepTitle, string CompletionText,
CompletionState
CompletionState)> CompletedSteps { get; } = [];
51
public List<(string TaskStatusText, string? CompletionMessage,
CompletionState
CompletionState)> CompletedTasks { get; } = [];
71
public Action<string, string,
CompletionState
>? OnStepCompleted { get; set; }
86
public
CompletionState
? ResultCompletionState { get; private set; }
147
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
193
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
250
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
272
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
300
public Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Tests (111)
Pipelines\DistributedApplicationPipelineTests.cs (2)
903
Assert.Contains(reporter.CompletedSteps, step => step.StepTitle == "failing-step" && step.CompletionState ==
CompletionState
.CompletedWithError);
1273
Assert.Contains(reporter.CompletedSteps, step => step.StepTitle == "failing-step" && step.CompletionState ==
CompletionState
.CompletedWithError);
Pipelines\PipelineLoggerProviderTests.cs (3)
141
public Task CompleteAsync(string statusText,
CompletionState
completionState, CancellationToken cancellationToken = default)
146
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Publishing\PipelineActivityReporterTests.cs (88)
39
Assert.Equal(
CompletionState
.InProgress, stepInternal.CompletionState);
73
await step.CompleteAsync("Done",
CompletionState
.Completed, CancellationToken.None);
126
Assert.Equal(
CompletionState
.InProgress, taskInternal.CompletionState);
163
await step.CompleteAsync("Completed",
CompletionState
.Completed, CancellationToken.None);
187
await step.CompleteAsync(completionText, isError ?
CompletionState
.CompletedWithError :
CompletionState
.Completed, CancellationToken.None);
191
Assert.NotEqual(
CompletionState
.InProgress, stepInternal.CompletionState);
267
await step.CompleteAsync("Completed",
CompletionState
.Completed, CancellationToken.None);
297
Assert.Equal(
CompletionState
.Completed, taskInternal.CompletionState);
321
await step.CompleteAsync("Completed",
CompletionState
.Completed, CancellationToken.None);
332
[InlineData(
CompletionState
.Completed, "Pipeline completed successfully", false)]
333
[InlineData(
CompletionState
.CompletedWithError, "Pipeline completed with errors", true)]
334
[InlineData(
CompletionState
.CompletedWithWarning, "Pipeline completed with warnings", false)]
335
public async Task CompletePublishAsync_EmitsCorrectActivity(
CompletionState
completionState, string expectedStatusText, bool expectedIsError)
351
Assert.Equal(completionState ==
CompletionState
.CompletedWithWarning, activity.Data.IsWarning);
362
await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = expectedStatusText, CompletionState =
CompletionState
.CompletedWithError }, CancellationToken.None);
387
await step1.CompleteAsync("Step 1 completed",
CompletionState
.Completed, CancellationToken.None);
391
await step2.CompleteAsync("Step 2 completed with warning",
CompletionState
.CompletedWithWarning, CancellationToken.None);
395
await step3.CompleteAsync("Step 3 failed",
CompletionState
.CompletedWithError, CancellationToken.None);
451
Assert.Equal(
CompletionState
.Completed, taskInternal.CompletionState);
464
await task.CompleteAsync((string?)null,
CompletionState
.Completed, cancellationToken: CancellationToken.None);
470
await task.CompleteAsync("Error",
CompletionState
.CompletedWithError, cancellationToken: CancellationToken.None);
476
Assert.Equal(
CompletionState
.Completed, taskInternal.CompletionState); // Original state is retained
500
Assert.Equal(
CompletionState
.Completed, stepInternal.CompletionState);
513
await step.CompleteAsync("Complete",
CompletionState
.Completed, cancellationToken: CancellationToken.None);
519
await step.CompleteAsync("Error",
CompletionState
.CompletedWithError, cancellationToken: CancellationToken.None);
525
Assert.Equal(
CompletionState
.Completed, stepInternal.CompletionState); // Original state is retained
542
await step.CompleteAsync("Step completed",
CompletionState
.Completed, CancellationToken.None);
553
await task.CompleteAsync("Error",
CompletionState
.CompletedWithError, cancellationToken: CancellationToken.None); // Should also not throw (noop)
760
var
aggregatedState = stepInternal.CalculateAggregatedState();
763
Assert.Equal(
CompletionState
.Completed, aggregatedState);
781
Assert.Equal(
CompletionState
.Completed, stepInternal.CompletionState);
815
Assert.Equal(
CompletionState
.Completed, stepInternal.CompletionState);
836
await step.CompleteAsync("Step completed manually",
CompletionState
.Completed, CancellationToken.None);
847
Assert.Equal(
CompletionState
.Completed, stepInternal.CompletionState);
871
Assert.Equal(
CompletionState
.CompletedWithWarning, taskInternal.CompletionState);
906
Assert.Equal(
CompletionState
.CompletedWithError, taskInternal.CompletionState);
922
[InlineData(
CompletionState
.Completed, "Pipeline completed successfully", false)]
923
[InlineData(
CompletionState
.CompletedWithError, "Pipeline completed with errors", true)]
924
[InlineData(
CompletionState
.CompletedWithWarning, "Pipeline completed with warnings", false)]
925
public async Task CompletePublishAsync_WithDeployFlag_EmitsCorrectActivity(
CompletionState
completionState, string expectedStatusText, bool expectedIsError)
941
Assert.Equal(completionState ==
CompletionState
.CompletedWithWarning, activity.Data.IsWarning);
952
await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = expectedStatusText, CompletionState =
CompletionState
.CompletedWithError }, CancellationToken.None);
978
await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionState =
CompletionState
.Completed, PipelineSummary = pipelineSummary }, CancellationToken.None);
1005
await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionState =
CompletionState
.Completed }, CancellationToken.None);
1102
await step.CompleteAsync("Completed",
CompletionState
.Completed, CancellationToken.None);
1192
await task.CompleteAsync(new MarkdownString("Deployed to **Azure**"),
CompletionState
.Completed, CancellationToken.None);
1211
await step.CompleteAsync(new MarkdownString("Step **completed** successfully"),
CompletionState
.Completed, CancellationToken.None);
1231
await task.CompleteAsync("Warning message",
CompletionState
.CompletedWithWarning, CancellationToken.None);
1237
await task.CompleteAsync("Different warning message",
CompletionState
.CompletedWithWarning, CancellationToken.None);
1243
Assert.Equal(
CompletionState
.CompletedWithWarning, taskInternal.CompletionState);
1256
await task.CompleteAsync("Error message",
CompletionState
.CompletedWithError, CancellationToken.None);
1262
await task.CompleteAsync("Different error message",
CompletionState
.CompletedWithError, CancellationToken.None);
1268
Assert.Equal(
CompletionState
.CompletedWithError, taskInternal.CompletionState);
1280
await step.CompleteAsync("Warning",
CompletionState
.CompletedWithWarning, CancellationToken.None);
1286
await step.CompleteAsync("Different warning",
CompletionState
.CompletedWithWarning, CancellationToken.None);
1292
Assert.Equal(
CompletionState
.CompletedWithWarning, stepInternal.CompletionState);
1304
await step.CompleteAsync("Error",
CompletionState
.CompletedWithError, CancellationToken.None);
1310
await step.CompleteAsync("Different error",
CompletionState
.CompletedWithError, CancellationToken.None);
1316
Assert.Equal(
CompletionState
.CompletedWithError, stepInternal.CompletionState);
1320
[InlineData(
CompletionState
.Completed,
CompletionState
.CompletedWithWarning)]
1321
[InlineData(
CompletionState
.Completed,
CompletionState
.CompletedWithError)]
1322
[InlineData(
CompletionState
.CompletedWithWarning,
CompletionState
.Completed)]
1323
[InlineData(
CompletionState
.CompletedWithWarning,
CompletionState
.CompletedWithError)]
1324
[InlineData(
CompletionState
.CompletedWithError,
CompletionState
.Completed)]
1325
[InlineData(
CompletionState
.CompletedWithError,
CompletionState
.CompletedWithWarning)]
1326
public async Task CompleteTaskAsync_IdempotentWhenTransitioningBetweenTerminalStates(
CompletionState
firstState,
CompletionState
secondState)
1351
[InlineData(
CompletionState
.Completed,
CompletionState
.CompletedWithWarning)]
1352
[InlineData(
CompletionState
.Completed,
CompletionState
.CompletedWithError)]
1353
[InlineData(
CompletionState
.CompletedWithWarning,
CompletionState
.Completed)]
1354
[InlineData(
CompletionState
.CompletedWithWarning,
CompletionState
.CompletedWithError)]
1355
[InlineData(
CompletionState
.CompletedWithError,
CompletionState
.Completed)]
1356
[InlineData(
CompletionState
.CompletedWithError,
CompletionState
.CompletedWithWarning)]
1357
public async Task CompleteStepAsync_IdempotentWhenTransitioningBetweenTerminalStates(
CompletionState
firstState,
CompletionState
secondState)
Publishing\PublishingExtensionsTests.cs (5)
34
Assert.Equal(
CompletionState
.InProgress, taskInternal.CompletionState);
51
Assert.NotEqual(
CompletionState
.InProgress, stepInternal.CompletionState);
88
Assert.Equal(
CompletionState
.Completed, taskInternal.CompletionState);
106
Assert.Equal(
CompletionState
.CompletedWithWarning, taskInternal.CompletionState);
123
Assert.Equal(
CompletionState
.CompletedWithError, taskInternal.CompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
46
public List<(string StepTitle, string CompletionText,
CompletionState
CompletionState)> CompletedSteps { get; } = [];
51
public List<(string TaskStatusText, string? CompletionMessage,
CompletionState
CompletionState)> CompletedTasks { get; } = [];
71
public Action<string, string,
CompletionState
>? OnStepCompleted { get; set; }
86
public
CompletionState
? ResultCompletionState { get; private set; }
147
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, CancellationToken cancellationToken = default)
193
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
250
public Task CompleteAsync(MarkdownString completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
272
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
300
public Task CompleteAsync(MarkdownString completionMessage,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Pipelines.AppHost (12)
AppHost.cs (12)
88
CompletionState
.CompletedWithWarning,
103
CompletionState
.CompletedWithWarning,
123
CompletionState
.CompletedWithWarning,
138
CompletionState
.CompletedWithWarning,
158
CompletionState
.CompletedWithWarning,
173
CompletionState
.CompletedWithWarning,
196
CompletionState
.CompletedWithWarning,
208
CompletionState
.CompletedWithWarning,
215
CompletionState
.Completed,
222
CompletionState
.CompletedWithWarning,
274
CompletionState
.CompletedWithWarning,
319
CompletionState
.Completed,
Pipelines.Library (7)
DistributedApplicationPipelineExtensions.cs (7)
88
CompletionState
.CompletedWithError,
100
CompletionState
.CompletedWithError,
107
CompletionState
.Completed,
119
CompletionState
.Completed,
137
CompletionState
.CompletedWithError,
163
CompletionState
.CompletedWithError,
170
CompletionState
.Completed,
SimplePipelines.AppHost (3)
AppHost.cs (3)
20
CompletionState
.Completed,
38
CompletionState
.Completed,
56
CompletionState
.Completed,