Run Playwright tests in Azure Devops after the release deployment - azure-devops

I have an MVC web application that runs the Azure DevOps pipeline for CI and CD, building and deploying on 2 different VMs on Azure.
I'd like to add Playwrite tests for E2E testing for both of these applications once they are deployed on the VMs.
I cannot find any resources that explain this.
So the process should be:
Pipeline - Build
Release - Deploy
Run Playwrite tests in TypeScript

Related

Can we make different folders for prod and non-prod in multistage YAML Pipeline?

We have around 13 prod and 13 non-prod environments in multistage YAML pipeline, due to this the performance is very slow. Can we keep prod and non-prod in a separate folder, so that while deploying we can run ci/cd independently.
Please suggest.
Thanks
Can we keep prod and non-prod in a separate folder, so that while deploying we can run ci/cd independently.
If you need to run CI/CD independently, you can split your pipelines into build pipelines and release pipelines.
Build pipelines automate test and build for your project. Release pipelines delivery automatically deploy and test code in multiple stages to help drive quality.
If your issue is that the application is deployed to all environments, then as Krzysztof Madej commented, you can modify your pipeline to deploy to one or more of them.

How to deploy an ASP.Net docker containerized application to an On-Premise Server, using Azure CI-CD Pipelines?

I have a multi-layer Asp.Net Application running. Due to it's multi-layer nature, I have to build a container for it and deploy it as a container.
Is there anyway I can deploy it to an existing server using Azure-Pipelines?
All other support that I am finding online is related to deploying to Azure App Services, however I would like to deploy to an existing production environment.
Is there anyway I can deploy it to an existing server using Azure-Pipelines?
Since you are deploying to the local environment, you can use Self-hosted Agent(Build Pipeline and Release Pipeline) or Deployment Group(Release Pipeline).
Then you could try the following pipeline settings.
Here is a blog about ASP.Net Application Deployment in Docker for Windows.
You could use Command Line Task to run the docker command. In this case, you can move the local build and deploy process to azure devops
By the way, if you have the Container registry Service connection in Azure Devops, you could use the Docker task or Docker Compose task.

Publishing remote test results to my Azure DevOps pipeline

I have a nodejs web application that I build in Azure Pipelines. I am planning to deploy the generated artifacts on a Azure VM (probably a dev test labs), as part of one of the pipeline steps.
I want to now run browser tests by pointing the browser to the hosted URL in the Azure VM. I want to use the Azure windows and linux VMs in a build pipeline to run the tests on this remote Azure VM and publish the results to the pipeline. These would be karma tests essentially running on the nodejs server.
In my current design, the test results are going to be available on the Azure VM hosting the nodejs application.
What I don't understand is how can I get these test results back to
the Azure Pipeline for publishing the same?
Is there a way I can architect this solution without having to setup my Azure VM as a
pipeline agent in Azure DevOps?
Is there a standard pattern to design such continuous test infrastructure using Azure DevOps?
Thanks
According to your description, you just want to use Microsoft host agent to access an url on your self-host agent (ignore it's Azure VM or your own physical machine, same to host agent).
It depends if that url are accessible through public internet.
The simplest solution here is deploy your build agent on that Azure VM directly. Then run build and test. You can do this through the following script and tasks:
run ng test or any command to raise your tests
publish test results with PublishTestResults task
publish code coverage results with PublishCodeCoverageResults task
Microsoft-hosted agent pool will not work for you with every scenarios. For many teams this is the simplest way to run your jobs. You can try it first and see if it works for your build or deployment. If not, you can use a self-hosted agent. Self-hosted agents give you more control for your builds, tests and deployments.
In your scenario, setup your Azure VM as a pipeline agent and run build/test on it should be the simplest and convenient solution.

Set up Azure Pipeline for Test Automation Framework

I need assistance in running my test scripts built-in Java platform with selenium webdriver using Eclipse IDE for my repo and used git to push my repo to Azure DevOps. The project is set up in Maven. How do I run my test scripts using pipelines in Azure DevOps?
Not sure get more details from you. So here just share my suggestion on how to run Selenium tests in the release pipeline for Java application.
In my scenario, I deploy my Java application to azure web app service then run it. If you don't want, you can also deploy to local tomcat by using this extension.
1) After the Java application build, copy the project to the artifact of the release during Build pipeline via copy files and publish artifact task.
2) Create release pipeline, then add Azure app service task to deploy my Java application to azure.
3) Add a Maven task to the release pipeline, configure the task to make it point to pom.xml file which located in artifact.
4) Trigger the Selenium tests in pom.xml.
Now you can run browser to view the test.
You can check this lab blog to get more details. Just focus on the design logic of pipeline execution, because the sample in that blog is running with vstest.exe.

Azure DevOps SetUp - Mulitple Project / WebJobs under Single Solution

We have about multiple Projects in a single Solution.
2 projects needs to be deployed as Azure Web App
10 projects are web jobs which needs be deployed to one of the Azure web app
Can someone guide me on how to setup the deployment pipeline for Continuous Integration.
This is one option:
Setup build pipeline so that build will produce ready to install packages. An easy way to achieve this is to use Build solution Task and add following parameters into MSBuild arguments:
/p:TransformConfigFiles=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:OutDir="$(build.stagingDirectory)"
(+ of course you need publish symbols path and publish artifact task which are created by default)
Now when you build your solution you should have ready to install packages (zip files).
Next we need to setup deployment pipeline. Here you should use Azure App Service Deploy task. All the other parameters except package or folder should be easy to setup if you have linked Azure subscription into Azure DevOps.In package or folder you can put: $(System.DefaultWorkingDirectory)/**/(name of the zip package you want to deploy).zip.
Web jobs don't differ from apps much, so you should be able to setup their pipelines also with above guide.
For more information about web job deployment check this Microsoft example:
https://blogs.msdn.microsoft.com/tfssetup/2016/05/18/deploying-and-schedule-azure-webjobs-from-vsts-to-azure-web-app-with-bonus-cron-scheduling/