Run automated tests from Azure Test Plans using a YAML pipeline - azure-devops

Until recently I ran Selenium automated tests from the Azure Test Plans using a YAML pipeline for the Build part and a classic Release Definition for the Release part.
Now, the organization I work in does not allow the use of classic Release Definitions from Azure DevOps.
So I extended my YAML Build Pipeline with stages for running my automated tests on different environments.
But I also want to make use of the Azure Test Plans for running my tests.
My problem is that when I want to run a test from my Test Plan, the only possibility for selecting a Release pipeline is the classic Release Definition I have created.
Is there any possibility to trigger the run of my automated tests from the Azure Test Plans, but to use a YAML pipeline when selecting the Stage.
Thank you!
I tried to edit the settings of my Test Plan, but in order to select a Stage, I have to select a Release Pipeline, and the only options are the ones existing in the Pipelines -> Releases windows of Azure DevOps

Related

How to configure YAML multistage pipeline release stages in Azure test plan settings

I have a multi-stage YAML pipeline using which I run my automated tests against different environments(Dev, Test, Pre-prod, etc). I wanted to run these automated tests directly from the test plan by configuring the build and release pipeline using Azure test plan settings.
But I couldn't see my release stages after selecting the build in the build pipeline dropdown. It is working fine for my classic UI release pipeline, not for the YAML muti-stage.
Does YAML multi-stage support this functionality?
This seems to rely on the "old releases". But the steps and code it generates could easily be ported over to the new YAML pipelines. But you'd have to do it by hand.
You could create a temporary "old style" pipeline, configure it to see what all gets generated and then duplicate those tasks to your YAML pipeline.

Deployment configured as YAML as part of a Pipeline

We have been using a YAML file to do our CI in Azure DevOps for a few months with the idea that we would get our release configured using YAML in the future.
Well that time is now and I'm confused by how you would introduce a CD process. With the MyProject-CI.yml being a Build Pipeline and our Releases being Classic Pipelines I assumed that when the time came to get the CD process down as YAML we would create a MyProject-CD.yml. That would be triggered by the dropping of an Artifact within the MyProject-CI.yml CI.
However I think that was just a misunderstanding on my behalf and what we are supposed to do is convert the original MyProject-CI.yml into a multi-stage pipeline that has the following stages
Build and Run Unit Tests
Deploy to Development and run WebTests
Deploy to Production and run WebTests
Is the switch to a multi stage CI/CD in one file correct rtaher than Release and Build in separate files?
The short answer is yes, you got the idea. A single multi-stage pipeline yml is the way to do both build and deploy, and that is the base intention. Here is an exercise that parallels your case that might help.
As your pipelines get more complex, you will likely get into scenarios with multiple files, as you can template parts of your pipeline for reuse in multiple places, or to enforce conventions from a central location.

Is is possible to inherit a definition of Azure DevOps Pipeline?

I would like to know if there is a mechanisim in Azure DevOps to reuse a definition for Azure DevOps Pipelines.
In my scenario I defined two Azure DevOps (Build) Pipelines to generate the artifacts of my web app; one for staging the other for production. The build definiton is the same in both cases except for two things:
a variable that set the build configuration for the ASP .NET Core (Staging or Release)
the branch that triggers the build (staging or master)
My goal is to avoid duplicated build definition that should be updated in both whenever somehting is updated in the project.
The build definition are in classic mode (no YAML files).
With classic you can create task groups and reuse those. You can select existing build steps and convert them to a task group and then reuse the task group across builds.
This is covered in the following document.
With yaml files you can use templates.

How to use a test plan (it is a manual test) on Azure devops 2019 CI/CD pipeline

Righ now, I am setting a CI/CD pipeline on Azure devops 2019. I have implemented some Autometed test, but I would like to know if there is a way to set a stage in a pipeline with a task that allow me to trigger a manual test created on test plans ?
To do this first we need to Associate automated tests with test cases. Then you can use Visual Studio Test task by selecting tests using Test Plan to run tests from your test plan that have an automated test method associated with it.
A similar question has been answered on the Comments in Azure DevOps Labs.Please refer to it.

How do you publish tests/artifacts in Azure DevOps (VSTS)

In Team City, tests are updated as they pass or fail which is useful for long running tests (you might abort the run).
You can also publish arificts while the build is running. e.g.
##teamcity[publishArtifacts 'alogOrScreenshot']
Can you do this in Azure DevOps, ideally using the VS Runner?
Azure DevOps has support for in-progress view of Test data as soon as its published instead of awaiting completion of session. More details # https://learn.microsoft.com/en-us/azure/devops/pipelines/test/review-continuous-test-results-after-build?view=azure-devops#view-execution-of-in-progress-tests.
To add, Junit / Xunit / NUnit and Ctest formats are supported with Publish test results task. https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=yaml