public void Handle(AssemblyStarted message) { var runName = Path.GetFileNameWithoutExtension(message.Assembly.Location); var framework = Assembly.GetEntryAssembly()? .GetCustomAttribute <TargetFrameworkAttribute>()? .FrameworkName; if (!string.IsNullOrEmpty(framework)) { runName = $"{runName} ({framework})"; } var start = new CreateRun { name = runName, build = new CreateRun.BuildDetail { id = buildId }, isAutomated = true }; var runsUri = new Uri(new Uri(collectionUri), $"{project}/_apis/test/runs").ToString(); var response = postAction(client, $"{runsUri}?api-version={AzureDevOpsRestApiVersion}", "application/json", Serialize(start)); runUrl = Deserialize <TestRun>(response).url; }
/// <summary> /// Add or Modify a Run. /// </summary> /// <remarks> /// Add a new Run or Modify an existing Run. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='experimentName'> /// The experiment name. /// </param> /// <param name='runId'> /// The identifier of the Run. /// </param> /// <param name='createRunDto'> /// The requested Run parameter Additions/modifications. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Run> PatchAsync(this IRunsOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName, string experimentName, string runId, CreateRun createRunDto = default(CreateRun), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchWithHttpMessagesAsync(subscriptionId, resourceGroupName, workspaceName, experimentName, runId, createRunDto, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Add or Modify a Run. /// </summary> /// <remarks> /// Add a new Run or Modify an existing Run. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='experimentName'> /// The experiment name. /// </param> /// <param name='runId'> /// The identifier of the Run. /// </param> /// <param name='createRunDto'> /// The requested Run parameter Additions/modifications. /// </param> public static Run Patch(this IRunsOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName, string experimentName, string runId, CreateRun createRunDto = default(CreateRun)) { return(operations.PatchAsync(subscriptionId, resourceGroupName, workspaceName, experimentName, runId, createRunDto).GetAwaiter().GetResult()); }