Open Closed

Setting Up an Azure Pipeline for ASP.NET ZERO Core Angular #10178


0
andry3ag created

Hi Team,

We have recently downloaded the ASP.Net Core 3x with Angular 9.x (version 8.6). I have been looking into adding Azure Devops Pipeline so when we push changes to source control it automatically runs a build and executes the units tested I created. I got it to work using pipeline yaml for just doing the builds after submission but having issues with executing the tests.I have followed the documnetation to create tests for my back end services (https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Developing-Step-By-Step-Angular-Creating-Unit-Tests-for-Person-Application-Service). I can see the tests that I created are submitted to Azure Devops under the [Project Name].Tests but it seems that is not executing the added test. I cant even see the test under VSTest section on the Azure Pipeline as seen by screen shot below. On purpose I have made the test fail so I can verify the flow working but its actualy passing on Azure Pipeline. The test is failing on my local machine when I execute the test. On Azure Pipeline it seems that its not even running the test. I can see that you have documentation for ASP.NET ZERO Core MVC (https://docs.aspnetzero.com/en/aspnet-core-mvc/latest/Setting-Up-an-Azure-Pipeline-Mvc-Core) but I dont see documentation for ASP.NET Core and Angular. Can you provide some steps I need to follow or some documentation so I can configure the Azure Pipeline?


2 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @andry3ag

    Could you share the content of Test step ?

    Thanks,

  • 0
    Hammer created

    Is there any news for this? I would be very interested in it. I tried to setup a pipeline, managed to make the backend part work, but am currently stuck with the angular part.

    Here is what I have so far in my yml:

    `trigger: - release

    jobs:

    - job: Frontend   displayName: Frontend Processing   continueOnError: false

      pool:       vmImage: 'ubuntu-latest'        steps:     - task: NodeTool@0       inputs:         versionSpec: '12.x'       displayName: 'Install Node.js 12.x'     - task: Npm@1       displayName: 'Angular CLI'       inputs:         command: custom         verbose: false         customCommand: 'install @angular/cli@11.1.2'     - task: Npm@1       displayName: 'npm install'       inputs:         verbose: false        - task: Npm@1       displayName: Build       inputs:         command: custom         verbose: false         customCommand: 'start'        - task: CopyPublishBuildArtifacts@1       displayName: 'Copy Publish Artifact: test'       inputs:         CopyRoot: dist         Contents: '**'         ArtifactName: test         ArtifactType: Container        - task: DownloadPipelineArtifact@2       displayName: 'Download Pipeline Artifact'       inputs:         targetPath: ' $(Build.ArtifactStagingDirectory)/dist/AngularTest'

    - job: Backend   displayName: Backend Processing   dependsOn: Frontend   continueOnError: false`