0
votes

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.

  1. What I don't understand is how can I get these test results back to the Azure Pipeline for publishing the same?
  2. Is there a way I can architect this solution without having to setup my Azure VM as a pipeline agent in Azure DevOps?
  3. Is there a standard pattern to design such continuous test infrastructure using Azure DevOps?

Thanks

1
Sorry not totally get your point. Did you just want to run karma tests integrate with Azure DevOps on Azure VM(Windows/Linux) and finally publish generated test result/report to Azure DevOps pipeline (such as a html page).PatrickLu-MSFT
@PatrickLu-MSFT: Yes, so my product would be installed on a azure VM and will host a url. I will run tests by invoking the azure VM url from my azure devops pipeline which is running on a MS hosted agent. Basically I want to leverage MS hosted windows/linux agents with chrome/firefox to run my tests on the remote url of the azure vm.Chubsdad

1 Answers

0
votes

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:

  1. run ng test or any command to raise your tests

  2. publish test results with PublishTestResults task

  3. 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.