So I am testing each of the activities of the pipeline and I want to disable some of the activities in it. Essentially there is an activity of sending emails which I want to disable as I wanted to see the output of prior activities.
Offcourse I dont want to remove the email sending activity because it is in the prod environment and not developed by me.
Is there any way to disable it?
You cannot disable one, but what you want to do is possible with the debug option in the editor. Just click on the red circle above any activity and run the debugger, it will run until that activity is complete and stop, allowing you to see the output of those prior to that.
Hope this helped!
This builds on Martin Esteban Zurita's answer, if you need to prevent activities from the beginning or from within the middle of your pipeline running, without deleting them altogether:
You can temporarily change the order of the activities and make the ones you want to disable run at the end of the pipeline instead, (closing any gaps you may have created), then click the last activity you do want to run and click the breakpoint circle icon to prevent the "disabled" activities from running.
Then reinstate the order after testing/debugging.
You could disable the trigger or delay the trigger execution to some date in the future.
I usually copy the activities to another temp pipeline, make your desired debugging and recompose the pipeline in the end if applicable.
Or you can clone the pipeline, delete the desired components and debug it.
Just remove from your dataset and add them again. ;-)
Related
We are currently checking the test plan module on our Azure Devops server and I'm facing an issue that the community may help.
According to this once a test run has been marked as failed or blocked there is no way to resume the test once the raised defects have been resolved. You either have to mark the test run as paused (so as to be granted the "resume" option) or reset the whole test to active in which case you loose all your progress and need to start over. Two questions:
This "workaround" works as long as you are careful and save the test run as paused. Otherwise if a failed step exists the run is saved as failed. Once this is done I have found no way of changing it to "paused" so as to get the resume option. Is there a way I'm missing?
In the test list under a specific suite you get the current test run outcome and state of test case. In case of "Paused" you don't have a way to know if the test execution is paused or you are utilizing the aforementioned workaround (e.g. a bug is registered). I cannot see a way that I could enhance the test run with some information that would signal this (there is no wit template I have found) on the grid. So is the standard query module (bringing testcases and associated bugs with state) the only way?
thanks
For the first question, if the test case is on status Failed and you retest the test case, all test steps need to be redone. Also there is no resume-button. This is by design. For now, set the status to Paused can resume the test, but it cannot truly reflect the result. As far as I know, there is no other way.
You could add your request for this feature(For example: when status = Failed/Block, the restore button is enable) on our UserVoice site , which is our main forum for product suggestions.After suggest raised, you can vote and add your comments for this feedback. The product team would provide the updates if they view it.
For the second question, as workaround , you can also add tags to paused test cases for labeling.
We recently moved to VSTS from TFS. One feature we often used is to pause queues whenever required. It was quite useful to prevent build failures in gated check in’s for known environment issues. Ex: specific tests or external dependencies failures or resources issues etc.,
I don’t see an option on how to pause a definition in VSTS. Wondering if anyone has suggestions or work arounds ?
There is the button of Cancel that can cancel the building.
You also can cancel the building through REST API: Update a build.
PATCH https://{instance}/DefaultCollection/{project}/_apis/build/builds/{buildId}?api-version={version}
Content-type (application/json)
{
"status":"cancelling"
}
You can pause any build step in your definition.
Puase task
If you want to pause entire definition then you can pause all the build steps.
Now in VSTS you can Pause a build definition from the Brelease/Build menu. Select the defnition you want to Pause and click on the [...] on the right of it, then click on Pause:
Frequently, I'll make changes in an editor, then save and repeat this process. The build automatically flag in Eclipse starts to create a build as soon as I save. But, I'll make another change and then save again and the current build becomes invalid.
Is there a way to cancel a current build automatically when I start typing into an editor or when I save?
Automatically? No, there's just the Progress View and its ability to send a cancel request. Builds are triggered headlessly in all cases other than when you trigger it from the menu, which is only even available when it's not set to build automatically, and there's no UI dedicated for canceling them.
I'm trying to execute a bit different build steps in VSTS based on type how build was started: automatically or manually.
I'm especially interested in accessing that information from powershell script. But so far was not able to find suitable solution or workaround.
Did someone faced similar requirement before? How did you solved it? I would appreciate your help!
Seems you want to know whether the project build is happening through TFS triggered build or manually triggered build.
There is no such feature for vnext build for now. About this , you could submit your uservoice to this link, TFS Product Team is listening to your voice there.
As a workaround either to use two build definitions through different version patterns or manually add a specifical tag after a manually build finished. Through using tags to set some labels on the build to distinguish manual and automatic builds. But this is a manual action, it would be better if we can do this automatically.
It seems to be I've managed to find an option that allows to determine wherever build was triggered automatically or manually.
All builds started manually have actual user in $Env:BUILD_QUEUEDBY variable, while automatic builds have system account there. My value was [********]\Project Collection Service Accounts.
I don't know how reliable it is, but for me so far following code did the job:
# Identifying who triggered the build
$OwnerId = $Env:BUILD_QUEUEDBY;
$OwnerId = $OwnerId.ToUpper();
if ($OwnerId.EndsWith("PROJECT COLLECTION SERVICE ACCOUNTS"))
{
Write-Host "Build was triggered automatically. Resulting files considered 'BETA'"
}
else
{
Write-Host "Build was triggered manually. Resulting files considered 'STABLE'"
}
I would like my builds to behave differently (a handling script needs to know) if a person requested the build through the UI "build now" button, or if it was triggered by SCM. I don't want to have to provide a checkbox in the UI that the users have to alter - I've already gotten blowback from them about such things. Trouble is, any parameter I set has the same default regardless of how the build is triggered.
You should not really have 1 job with different behaviour. If you need different behaviour set up a job per behaviour. Best bet in your case is to have 2 separate jobs, one for the SCM triggered builds, and one for the manually triggered builds.
There's a plugin to allow you to filter jobs into separate pages (can't remember the name at the moment). You could set all SCM builds on 1 page and manual builds on another, then set the manual build page as the default one on login. Users will only see the jobs you want triggered manually by default, but can still access the SCM triggered builds by selecting the other page.
Could you somehow check the SCM polling log during the pre-build (with a script), and then go from there?