Coder Social home page Coder Social logo

microsoft / azure-pipelines-tasks Goto Github PK

View Code? Open in Web Editor NEW
3.4K 3.4K 2.6K 650.42 MB

Tasks for Azure Pipelines

Home Page: https://aka.ms/tfbuild

License: MIT License

JavaScript 0.77% PowerShell 17.98% TypeScript 80.14% HTML 0.62% Java 0.03% CSS 0.06% Batchfile 0.02% Shell 0.03% TSQL 0.03% Bicep 0.02% C# 0.29% Python 0.01%

azure-pipelines-tasks's Introduction

Azure Pipelines Tasks

Tasks

Overview

This repo contains the tasks that are provided out-of-the-box with Azure Pipelines and Team Foundation Server.

This provides open examples on how we write tasks which will help you write other tasks which can be uploaded to your account or server. See Writing Tasks below. Check Deprecation.md file for the list of task which are no longer supported.

Status

Build & Test
Win Windows Build & Test
macOS macOS Build & Test
Linux Linux Build & Test

How to Use Tasks

See the documentation for Continuous integration and deployment.

Writing Tasks

If you need custom functionality in your build/release, it is usually simpler to use the existing script running tasks such as the PowerShell or Bash tasks. Writing a new task may be appropriate if you need deeper integration or reusability in many build definitions

Tasks are simply tool runners. They know how to run MSBuild, VSTest, etc... in a first class way and handle return codes, how to treat std/err out, and how to write timeline records based on expected output. They also get access to credentials to write back to TFS/Azure Pipelines.

For uploading custom tasks to Azure Pipelines use the TFS Cross Platform Command Line utility.

Tasks can also be deployed with an Azure DevOps extension. See this tutorial for how to write a custom task and package it inside an extension.

Contributing

This project welcomes contributions and suggestions.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Issues

We accept issue reports both here (file a GitHub issue) and in Developer Community.

Do you think there might be a security issue? Have you been phished or identified a security vulnerability? Please don't report it here - let us know by sending an email to [email protected].

azure-pipelines-tasks's People

Contributors

abhinitmodi avatar allendm-msft avatar anaggar avatar anumita avatar arjgupta avatar ashwinichalla avatar bishal-pdmsft avatar brcrista avatar bryanmacfarlane avatar chshrikh avatar davidstaheli avatar dmitriibobreshev avatar ericsciple avatar hiyadav avatar jahsu-msft avatar kaadhina avatar madhurig avatar max-zaytsev avatar mvvsubbu avatar niadak avatar obsidianvoid avatar pavloandriiesh avatar prawalagarwal avatar rajatagrawal-dev avatar shreyasrmsft avatar thesattiraju avatar tingluohuang avatar vincent1173 avatar vtbassmatt avatar yacaovsnc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-pipelines-tasks's Issues

Provide NuGet Deploy

I would like to suggest to add a Deploy step that will pack and push build output to NuGet feed
Also it would be nice if there would be some sort of prebuild step that will replace version in *.cs files with value from the Build Number

I would like to use a scriptcs task.

I think it would be great to see a scriptcs task runner that uses svm, chocolatey, or anything that gets this working. I don't have privileged access to vNext Build so I can't take this on but it would enable us to better integrate our .csx build scripts with VSO and Team Build.

ASP.NET 5 Build Azure Web App

Hi

Following this article to upload my project to azure web app.
https://msdn.microsoft.com/Library/vs/alm/Build/azure/deploy-aspnet5

I have encounter an error on step 8.
/t:Build,FileSystemPublish /p:PublishConfiguration=$(BuildConfiguration) /p:PublishOutputPathNoTrailingSlash=$(Build.SourcesDirectory){yourProjectName}\artifacts\bin$(BuildConfiguration)\Publish

{yourProjectName} do i need to change this value to something else?
what value should it looks like.

Below is the log from Build solution src/CMS/CMS.xproj

2015-06-21T13:25:44.4666304Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\VSBuild\1.0.11\VSBuild.ps1

2015-06-21T13:25:46.6363981Z C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe "C:\a\557e1857\9ilin CMS\src\CMS\CMS.xproj" /nologo /m /nr:false /fl /flp:"logfile=C:\a\557e1857\9ilin CMS\src\CMS\CMS.xproj.log" /dl:CentralLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /t:Build,FileSystemPublish /p:PublishConfiguration=release /p:PublishOutputPathNoTrailingSlash=C:\a\557e1857\9ilin CMS{yourProjectName}\artifacts\bin\release\Publish /p:platform="any cpu" /p:configuration="release"

2015-06-21T13:25:46.9020288Z MSBUILD : error MSB1008: Only one project can be specified.

2015-06-21T13:25:46.9020288Z Switch: CMS{yourProjectName}\artifacts\bin\release\Publish

2015-06-21T13:25:46.9020288Z For switch syntax, type "MSBuild /help"

2015-06-21T13:25:46.9176536Z ##[error]Unexpected exit code received from msbuild.exe: 1

Support for publishing test results in the xUnit XML format...

Currently, the publish test results to TFS/VSO task only supports publishing of the following formats:

  • JUnit
  • VSTest
  • NUnit

Most of us playing around with DNX are using xUnit since they already support dnx with a task runner from the CLI, which makes xUnit support a fairly big deal.

PowerShell activity fail when team project has a space in it

Hi,
I'm not sure this is the right place to post that (uservoice?) so pardon me if it's not.
When the team project has a space in the name, all PowerShell activities (not azure, the stantard ones) fail.
Here is the error message we get.
'C:\agent_work\9655a16e' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

We've tested the exact same settings on a project without space in the name and it works perfectly.

Note : the failing projects also have dashes in the name so maybe it's the dash and not the space causing the issue (" - ").

Thanks for your help!

Arbitrary xcodebuild parameters

Is it possible to pass arbitrary parameters to the xcode build task? As far as I can see, only $(Configuration) and $(SDK) get passed down to the commandline invocation.

Azure Powershell causes invalid attribute character error

Based on the document here, I get this error on VSO while trying a build & publish:

'<', hexadecimal value 0x3C, is an invalid attribute character. Line 10, position 42.

The Powershell script for prebuilding works and builds the target project correctly but adding the Azure Powershell script causes this issue.

I've been able to reproduce this with a new build definition as well. Any ideas on how this can be tackled?

Thanks!

VSTest Task does not quote the testFiltercriteria if the value includes spaces

The VSTest task allows you to specify test filter criteria as part of the testFiltercriteria property.

If the value of this property includes spaces, running the build will fail because the test filter criteria are not quoted.

For example, setting the testFiltercriteria property to /TestCaseFilter:TestCategory !=ThriftRequired will result in the following command line:

Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe (...)  /TestCaseFilter:TestCategory !=ThriftRequired

and the following error:

2015-08-17T13:36:36.7199841Z ##[error]Error: The test source file "!=ThriftRequired" provided was not found.

Manually quoting the testFiltercriteria in the settings works as a temporary workaround.

Xamarin.iOS Build Task Doesn't work

Hi

The Xamarin.iOS task always returns an error: "Return code: 1"

I have done the following to try out the build task.

  • Created a VSO project, and uploaded the code for the TaskyiOS_Starter sample app from Xamarin.
  • Set up a build with the Xamarin.iOS as the first build step, and configured it to build for the simulator
  • Installed Xamarin Studio on the Mac, and logged in with a valid trial account
  • Installed the cross platform build agent on a mac, and connected it to VSO (I have this running in interactive mode)

When I queue up a new build, I can see it hit my agent, but it returns an error, and the log details the following:

-07-15T00:18:50.059Z: [command]/usr/bin/nuget restore /Users/Gary.Jackson/Projects/myagent/_work/build/0fbee2c4e562ab4b6d6b2db37f92b44ffe234542132e10f0e14be3d9fb4b37e0/repo/TaskyiOS_Starter.sln

2015-07-15T00:18:50.359Z: [command]'/Applications/Xamarin Studio.app/Contents/MacOS/mdtool' --verbose build --configuration:'Release|iPhoneSimulator' /Users/Gary.Jackson/Projects/myagent/_work/build/0fbee2c4e562ab4b6d6b2db37f92b44ffe234542132e10f0e14be3d9fb4b37e0/repo/TaskyiOS_Starter.sln

##[Error] 2015-07-15T00:18:50.919Z: Return code: 1

Removing the following lines from the constructor of the local "toolrunner.js" allows the task to run, so I'm not sure if this is a task bug, or possibly something with the toolrunner?

if (toolPath.indexOf(' ') > 0) {
toolPath = '\'' + toolPath + '\'';
}

Azure cloud service deployment template fails staging deployment when diagnostics is used

(Brought this issue over from the xplat agent repo)

kaspernortoft commented an hour ago
The Azure cloud service deployment script fails the second deployment if the service uses the diagnostics extension and is swapped from staging to production.
ConflictError: The extension ID RoleName-PaaSDiagnostics-Staging-Ext-0 is already in use for this deployment.
It seems possible to use the Set-AzureServiceDiagnosticsExtension instead to set the diagnostics, but it is pretty slow

Thanks for reporting this issue. I'll investigate this. If possible, could you set the "system.debug" variable to true on your definition (on the Variables tab), run that definition again, then send me downloaded logs? The Azure PS cmdlets will write a lot of diagnostics information that I can go through and see exactly where it's failing.

NuGetInstaller task is a little restrictive.

Hi,

Currently the task checks for a packages.config within the sub-tree that the solution file is in.
This does not account for solutions that reference projects outside of their own sub-tree.

I suggest removing all the logic from within the solution file loop and just invoking nuget on each solution found.

I could create a pull request if that is preferable, but I'm completely new to github.

Thanks
Dave

Document PowerShell Modules

It would be helpful if you can provide documentation of the functions provided by the Microsoft.TeamFoundation.DistributedTask.Task.Internal and Microsoft.TeamFoundation.DistributedTask.Task.Common PowerShell modules

XamariniOS: mdtool builds with default solution configuration rather than supplied one

I have four solution configurations that change various build parameters and when I run a XamariniOS build task from a Mac OS X agent, mdtool appears to be building the default "Debug, Any CPU" Solution configuration even though some of the output appears to show that the correct arguments are being passed in.

It appears that there are extra single quote marks in the 'configuration' argument passed to mdtool and these are getting parsed incorrectly.

Here I am passing "Test" as the configuration and the build task definition is adding "iPhoneSimulator" platform because the checkbox was selected to do that:

2015-08-16T12:23:04.083Z: [command]/Applications/Xamarin Studio.app/Contents/MacOS/mdtool --verbose build --configuration:'Test|iPhoneSimulator' /Users/alex.taylor/build-vso-agent/_work/build/3392b38aa628ac0bbffe84e306ee56aff602b176f4d2ec1b19d23c8ca06fafe9/repo/My.Project.sln
2015-08-16T12:23:05.004Z: 
2015-08-16T12:23:05.646Z: 
2015-08-16T12:23:05.654Z: 
2015-08-16T12:23:05.675Z:       Loading projects ..
2015-08-16T12:23:06.356Z: Building Solution: My.Project ('Test|iPhoneSimulator')
2015-08-16T12:23:06.357Z:    Building: My.Project.Shared ('Test|iPhoneSimulator')
2015-08-16T12:23:06.359Z:    Building: My.Project.Core.iOS (Debug|iPhone)
2015-08-16T12:23:07.146Z:       
2015-08-16T12:23:07.146Z:       Build started 17/08/2015 12:23:07 a.m..
2015-08-16T12:23:07.146Z:       __________________________________________________
2015-08-16T12:23:07.224Z: 
2015-08-16T12:23:07.226Z:           
2015-08-16T12:23:07.226Z:           Target PrepareForBuild:
2015-08-16T12:23:07.226Z:               Configuration: Debug Platform: iPhone
2015-08-16T12:23:07.237Z:               Created directory "bin/iPhone/Debug/"
2015-08-16T12:23:07.237Z:               Created directory "obj/iPhone/Debug/"

on the command line however when I run the command I get:

          Loading projects ..
    Building Solution: My.Project (Test|iPhoneSimulator)
       Building: My.Project.Shared (Test|iPhoneSimulator)
       Building: My.Project.Core.iOS (Test|iPhoneSimulator)

          Build started 17/08/2015 12:29:32 a.m..
          __________________________________________________


            Target PrepareForBuild:
                Configuration: Test Platform: iPhoneSimulator
                Created directory "bin/iPhoneSimulator/Test/"
                Created directory "obj/iPhoneSimulator/Test/"

Persisting Powershell variables between steps

Is it possible to define (environment or global) variables in a powershell build step, and be able to use it in another (powershell) step further ahead?

I've been trying to do this, for instance, in a step where a set a variable for the package version by running GitVersion, and then further on, after running the build and tests, tag my repo. The script where I run the tagging step can't get the value of the variable I previously set.

Any recomendations?

Thanks!

Support for recursively expanding variables

I tried defining my own variable $(Build.BinariesDirectory) = $(Agent.BuildDirectory)\Binaries, but it looks like we can’t (yet) create “self-expanding” variables.

Build just substitutes the literal "$(Agent.BuildDirectory)\Binaries" when calling tasks.

Can't split gulp tasks in diferents gulpfiles

Hello,
I config my linux machine as build agent to VSO_Build and run very well.
But when I split my gulp tasks in diferents files, VSO not found the tasks out of gulpfile.
Eg:

gulpfile.js
tasks/
├── dev.js
├── release.js
└── test.js

gulpfile.js file:

var requireDir = require('require-dir');
var tasks = requireDir('./tasks');

And ./tasks/dev.js file

var gulp = require('gulp');
gulp.task('bower:install', function(){ .... });

Whe run task gulp bower:install, I see this log:
My Build Log

Anyone else had this same problem?

XamariniOS build failing on mdtool step

XamariniOS v 1.0.4, xamariniOS.js has this line:

mdtoolRunner.arg('--configuration:'' + configuration + '|' + device + ''', true);

Note the single quotes. When I try to build through VSO it appears the mdtool is being invoked with a configuration that includes the surrounding single quotes. The beginning of my agent log:

2015-08-18T15:52:37.400Z: [command]/Applications/Xamarin Studio.app/Contents/MacOS/mdtool --verbose build --configuration:'Ad-Hoc|iPhone' /Users/brian/myagent/_work/build/028c6348fb6992c170d51fdb97f4aa007efd9217b6ed97908eb1e308c816cb80/repo/MySolution.sln
2015-08-18T15:52:38.178Z: Xamarin Studio Build Tool
2015-08-18T15:52:38.597Z:
2015-08-18T15:52:38.609Z: Loading solution: /Users/brian/myagent/_work/build/028c6348fb6992c170d51fdb97f4aa007efd9217b6ed97908eb1e308c816cb80/repo/MySolution.sln
2015-08-18T15:52:38.623Z: Loading projects ..
2015-08-18T15:52:39.631Z: Building Solution: MySolution ('Ad-Hoc|iPhone')

This is causing projects which shouldn't be built as part of the configuration to be built and they are failing.

When I run the command shown in the vso agent log directly on the command line that last line in the build output is:

Building Solution: MySolution (Ad-Hoc|iPhone)

and the solution builds only the projects that should be built and everything works correctly.

npm install task (not msbuild) fails with EPERM on hosted build

It looks like there are some problems with permissions while installing various packages over npm install.

When I run my build for the 1st time I received the following errors:

npm ERR! Error: EPERM, open 'C:\NPM\Cache\bb33797c-ache-minimatch-2-0-8-package-tgz.lock'
npm ERR! { [Error: EPERM, open 'C:\NPM\Cache\bb33797c-ache-minimatch-2-0-8-package-tgz.lock']
npm ERR! errno: 50,
npm ERR! code: 'EPERM',
npm ERR! path: 'C:\\NPM\\Cache\\bb33797c-ache-minimatch-2-0-8-package-tgz.lock' }
npm ERR! 

After that I just run my build for the 2nd time without any modifications and I got the following errors:

npm ERR! Error: EPERM, open 'C:\NPM\Cache\e360d466-Cache-inherits-2-0-1-package-tgz.lock'
npm ERR! { [Error: EPERM, open 'C:\NPM\Cache\e360d466-Cache-inherits-2-0-1-package-tgz.lock']
npm ERR! errno: 50,
npm ERR! code: 'EPERM',
npm ERR! path: 'C:\\NPM\\Cache\\e360d466-Cache-inherits-2-0-1-package-tgz.lock' }
npm ERR! 

I receiving that errors on VSO

XamariniOS does not escape spaces in solution file for nuget restore command

Running XamariniOS v1.0.4. If the solution file has spaces in it the nuget restore command fails and the build hangs:

[command]/usr/bin/nuget restore /Users/brian/myagent/_work/build/028c6348fb6992c170d51fdb97f4aa007efd9217b6ed97908eb1e308c816cb80/repo/My Solution With Spaces.sln
2015-08-18T13:38:27.708Z: restore: invalid arguments.
2015-08-18T13:38:27.717Z: usage: NuGet restore [ | <packages.config file>] [options]
2015-08-18T13:38:27.718Z:
2015-08-18T13:38:27.718Z: Restores NuGet packages.

Support NuGet based test adapters in the VSTest task

With the old XAML build definitions tests could be run using test frameworks which used NuGet packages for distribution of their test adapter and test runner. This includes XUnit and NUnit, both which have moved away from using VSIX extensions.
With the new build definitions these frameworks no longer work. Instead you need to specify the path to the test adapter. Obviously this won't work unless the contents of the NuGet packages are in source control, and even if they are you wouldn't want to point to the dlls under the packages directory as the path will change whenever a new version is released.
Yes of course we could copy the required dlls to a different directory and point the build definition to this path but that defeats the whole purpose of using NuGet packages.

MSBuild step is not a clean MSBuild task

Configuration of a step of type MSBuild requires providing a solution file (*.sln).
So it is not really a MSBuild task.
I would like to run a MSBuild script, not a specific solution.

Is it possible to change the task accordingly? If not, the current one may be renamed and a a new new one created instead.

Does it make sense to have a cspack vso agent task

I use Octopus Deploy extensively and it's handling of Cloud Services deployments is a bit clunky (http://docs.octopusdeploy.com/display/OD/Azure+Cloud+Services), I basically need to package the Azure Cloud Services bits with cspack which are then rolled into a NuGet package and sent to the Octopus deploy server.

Since I now have a working custom NuGetPackage and NuGetPublish steps (this to the community here) and I'm thinking to create another custom step which runs right before these to create the package.

Does this sounds sensible, does anyone know if this has been done already and I've missed it ? Are the Azure deployment tools like cspack already on the VSO hosted agent or should I ship cspack with my code.

Build works - but 'The fully qualified file name must be less than 260 characters' in VSBuild.ps1 v1.0.013

Hi all,

I've set up continuous deployment for my vNext app using the VSO build agent. I've got it running, but I'm always getting this error in VSBuld.ps1. The build continues and the deployed app works fine - I just have this error that I would like to get rid of.

I suspect that the problem has to do with node or bower packages that that have created a deep tree-structure. It's not my project file path that's too long, I checked.

2015-08-06T15:12:11.2975509Z Executing the powershell script: 
C:\_Apps\agent\tasks\VSBuild\1.0.13\VSBuild.ps1

2015-08-06T15:12:12.2037866Z ##[error]The specified path, file name, or both are too long. 
The fully qualified file name must be less than 260 characters, and the directory name must 
be less than 248 characters.

2015-08-06T15:12:12.2350397Z C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe 
"C:\-path with length 160 or so.xproj" /nologo /m /nr:false /fl 
/flp:"logfile=C:\-again path of length 150 max.log" 
/dl:CentralLogger,"C:\_Apps\agent\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,
"C:\_Apps\agent\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:DeployOnBuild=true 
/p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true 
/p:PackageLocation=\"C:\_Apps\agent\_work\96521202\staging\" /p:platform="any cpu" 
/p:configuration="release" /p:VisualStudioVersion="14.0"

2015-08-06T15:12:12.5475633Z Build started 6-8-2015 17:12:12.
... and after a while ...
2015-08-06T15:12:48.3444957Z Build succeeded.
2015-08-06T15:12:48.3444957Z     0 Warning(s) 
2015-08-06T15:12:48.3444957Z     0 Error(s)
2015-08-06T15:12:48.3444957Z Time Elapsed 00:00:35.82

Can I help you guys debug this?

Unexpected exit code 1 returned from tool gulp.cmd

Hello.
I want to compile gulpfile through vso, but I have a problem during the build. I poprobyval gulpfile to replace your file from https://github.com/Microsoft/vso-agent-samples/tree/2ff3120af8428016be900202693ad66531a15079/gulp, just updating package.json
I checked, and the way to set up folders and gulpfile, but it did not help, all the same mistake. And I do not know the cause, because the log does nothing.
Sorry for bad english)
The contents of the log:
2015-06-11T21:14:03.4313879Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\Gulp\0.5.2\Gulptask.ps1
2015-06-11T21:14:03.6313859Z C:\NPM\Modules\gulp.cmd --gulpfile C:\a\51f50c38\Business Tools\gulpfile.js
2015-06-11T21:14:04.0393867Z [21:14:04]
2015-06-11T21:14:04.8543013Z ##[error]Unexpected exit code 1 returned from tool gulp.cmd

help

Publish Test Results step ignores "Always Run" option

If I set up a build with a Publish Test Results step at the end, and set Always Run to true, then it still doesn't run if a previous step fails. If the previous step fails because of test errors, then that means tests results will only be collected for builds where the tests succeed, which is not that useful.

I also tried setting Continue on Error on the previous task, so that the build finishes with the "partially successful" status, which does let the test results be collected. However that status makes the "automatically build pull requests" feature think the build succeeded and allows it to be merged despite the test failures.

VSTest task fails to locate VSTest.console.exe on build machine with only Visual Studio Agents installed

I have a build machine that has, roughly, .NET 4.6, the VSO Agent, Microsoft Build Tools 2015 and the Agents for Visual Studio 2015 installed.

Running a VSTest task as part of a build on this build agent results in the following error:

2015-08-17T12:41:38.1761372Z Executing the powershell script: C:\vsoagent\tasks\VSTest\1.0.16\VSTest.ps1
2015-08-17T12:41:39.2073467Z ##[debug]Calling Invoke-VSTest for all test assemblies
2015-08-17T12:41:39.2385874Z ##[error]Unable to determine the location of vstest.console.exe
2015-08-17T12:41:39.2542123Z ##[warning]No results found to publish.

It seems this is caused by the Microsoft.TeamFoundation.DistributedTask.Task.Internal.PowerShell.InvokeVSTestCmdlet task not being able to properly resolve the location in which VSTest.console.exe is located; the GetVsTestLocation method attempts to resolve locations in which Visual Studio is installed (it is not installed in this scenario).

VSTest.console.exe is present on this machine at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow - it was installed as part of the Agents for Visual Studio 2015 package.

It seems that the path in which VSTest.console.exe is located can be retrieved by looking at the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\EnterpriseTools\QualityTools registry key, where the InstallDir entry contains the right value.

As a workaround, faking a ShellFolder value in the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0 key also works.

Publishing of Karma-generated JUnit report file does not include classname value

When running unit tests using Karma, if we publish the results using karma-junit-reporter, VSO does not display the value of the classname, which makes reading the results very hard.

Part of a unit test:

describe('given the contractAccountAuthorizationService', function () {
    describe('initialise', function() {
        it('should return a promise', function(done) {
            // some implementation...
        });
    });

    describe('whenInitialised', function() {
        it('should return a promise', function(done) {
            // some implementation...
        });
    });
});

(for simplicity placed in one file here, but we have it(...) functions with the same description between different spec files too)

Example JUnit report:

<?xml version="1.0"?>
<testsuites>
  <testsuite name="PhantomJS 1.9.8 (Windows 7 0.0.0)" package="" timestamp="2015-08-18T09:26:02" id="0" hostname="C121441" tests="59" errors="0" failures="0" time="0.343">
    <properties>
      <property name="browser.fullName" value="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.8 Safari/534.34"/>
    </properties>
    <testcase name="should return a promise" time="0.020" classname="PhantomJS 1.9.8 (Windows 7 0.0.0).given the contractAccountAuthorizationService initialise"/>
    <testcase name="should return a promise" time="0.021" classname="PhantomJS 1.9.8 (Windows 7 0.0.0).given the contractAccountAuthorizationService whenInitialised"/>
  </testsuite>
</testsuites>

We then publish the test results using the Publish Test Results task.

In VSO, the results are displayed as:

vso unit test results

... but the full value of the classname attribute is not displayed anywhere, which makes it very hard to find the context of a test result.

FWIW we also tried exporting results using karma-trx-reporter but that causes a failure in the Publish-TestResults Cmdlet: ##[error]Object reference not set to an instance of an object.

So, how can we provide better unit testing reports for Karma tests?

Provide bower support

The new build system already support NPM, Gulp and Grunt. It would be nice to have also support for Bower like in Visual Studio ASP.NET 5 projects.

Use hidden / secret variables in commands

Do secret / hidden variables defined at the build level get excluded from calls to commands, if they are a part of that command, in TFS?

for instance, in order to tag the repo with the version number, I'm trying to do the following:

git push https://${env:tagUser}:${env:tagPass}@${env:tagUrl} $versionString

in a powershell script. The three env: variables are defined as build variables. tagPass is the only one that is hidden. tagUser and tagUrl get substituted in the command; tagPass may or may not - the logged error message message excludes the text (as expected). The command fails only if tagPass is marked as hidden. If I save it as unhidden, the push works correctly.

My thought here is that since it is a call to a command (something that may interact with stdout), the variable value is stripped from the command, and authentication fails because of that. Is my assumption correct, and if so, any recommended work arounds?

Xamarin.Android build task fails

I've added the Xamarin.Android build task to my VSO Build, using the Hosted build agent. When VSO runs the task, it fails with the error message:

2015-08-20T16:39:01.2412835Z      1>CSC : error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll' and 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll'. Remove one of the duplicate references. [C:\a\a815ee8d\phoneword\PhonewordAndroid\PhonewordAndroid.csproj]

I don't have this problem when I build my Xamarin.Android project locally via Visual Studio 2015 or using the command line.

Sign and Align Android

Hello I am hoping someone here can help me with a problem. I am trying to use the sign and align plug in in vso. I can't seem to find a value that works for Keystore file location. I always get an error indicating that it can't find the file. I checked the file in my case in a number of places under app/java etc. Is there any example of what to pass for that value in terms of environment variables etc? I know the key file is good because i can use it and sign just great in android studio.

Gulp step failing with Local gulp not found

I have an NPM install and Gulp step - the NPM install step completes OK, but then the Gulp step fails with "Local gulp not found in C:\a\bf6a5db2\PROJECT"

The NPM install step has the working directory param set to -
$/PROJECT/PD Enquiries/PD/src/PDEnquiries

...and the Gulp step has the Gulp file path set to -

$/PROJECT/PD Enquiries/PD/src/PDEnquiries/gulpfile.js

I wonder if Gulp is expected to be in the root of the project, but actually it is under PD Enquiries/PD/src/PDEnquiries?

Writing to stderr == error should be optional

So far I have found many tools seems to write to stderr even when there is no error. For example cloning git submodules writes each "cloning into" into std err.

For this reason I think there should be optional to treat writing to stderr as an error and also add a treat none zero return code as an error option. In my case I would like to say that there is only a failure if return code != 0 even if something was written to stderr.

Provide vSphere/HyperV provisioning tasks

Hi,

For certain build/test/deploy scenarios it would be really useful if you could provision an on-premise virtual machine on demand and have tasks execute on it.

i.e. tasks like

  • bootup/shutdown virtual (build/test) machines on demand
  • wait until the virtual machine is up&running
  • copy files to a virtual machine
  • revert a virtual machine to a base snapshot, before deploying builds
  • cloning a vm template to create more test machines
  • make a "snapshot" of a vm

Any thoughts on this?
Would something like this fit somewhere in the current vso-agent architecture or should it be somewhere else?
Is it something that is already planned/not yet implemented?

Locating help on TFS Powershell commands

When writting a custom action I seem to be unable to find information on commands like;

Invoke-Tool

Also I am unable to find any help on the majority of imported modules, like;

import-module "Microsoft.TeamFoundation.DistributedTask.Task.Internal"
import-module "Microsoft.TeamFoundation.DistributedTask.Task.Common"

I was wondering if someone would be able to point me at the API documentation for all the custom commands/cmdlets used for VSO/TFS tasks.

Thanks.

VSTest task is invoked with working dir prepended to the TestAssembly field

Given the following input:
TestAssembly: *.tests.dll;*.specs.dll;-:\obj**;-:.\tests\FunctionalTests

I would expect it to run tests that end in tests.dll, or specs.dll, except for assemblies in obj folders, or assemblies in the relative .\tests\functionaltests folder

Instead, VSTest.ps1 is invoked with the following parameter
testAssembly=D:\agents\agent1_work\871969cb\super-project**.tests.dll;*.specs.dll;-:\obj*;-:.\tests\FunctionalTests**

When the testAssembly parameter is split for file finding, we get this:

include D:\agents\agent1_work\871969cb\super-project***.tests.dll
include **.specs.dll
exclude \obj*
exclude .\tests\FunctionalTests

The PWD for the task is the parent directory for the VSTest.ps1 script, not the working directory.

The first include will work because the file finder starts at the non-wildcard portion of the string: D:\agents\agent1_work\871969cb\super-project and finds all descendant files that match the pattern ***.tests.dll

The second include fails to find any tests because it's looking in the agent's tasks folder, no the working directory.

The first exclude works because it's a wildcard prefixed match.
I'm not sure if the second exclude would work, again because the root for path comparison isn't the working directory.

Variable name mismatch in NuGet Restore task.

The arguments variable is defined as "nuGetRestoreArgs" in the NuGetInstaller task but as "nuGetArgs" in the ps1. I think this may be what is causing my arguments to be ignored in VSO.

npm install fail:"A parameter cannot be found that matches parameter name 'WarningPattern'"

My npm install-tasks have started to fail with the following message:

2015-08-07T19:49:13.1703608Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\NpmInstall\0.1.3\NpmInstall.ps1
2015-08-07T19:49:15.3210712Z ##[error]A parameter cannot be found that matches parameter name 'WarningPattern'.

I'm using the hosted build agent.

Previous builds, using the 0.1.2 version of the NpmInstall task does not have this problem.

My guess would be that the Invoke-Task powershell cmdlet is fetched from an outdated ps module?
Will this error stop appearing after some time when changes are propagated ?

Please introduce $(Build.BinariesDirectory) for migration purposes

I understand this is something we might be trying to move away from, but in order to upgrade old XAML builds to the new engine and to even old style TFS2008 builds which depend on redirectinr the Project output, it would be nice if there were a $(Build.BinariesDirectory) which we can substitute.

Right now I’m depending on $(Agent.BuildDirectory)\Binaries and $(AGENT_BUILDDIRECTORY)\Binaries to set these values and then pass them to MsBuild. That way the old packaging scripts, Wix scripts and other things that expect to find a temporary folder in a certain format all “just work”.

I don’t want to use the $(Build.StagingDirectory) for that, as that gets cleared after each build and breaks incremental builds.

I tried defining my own variable $(Build.BinariesDirectory) = $(Agent.BuildDirectory)\Binaries, but it looks like we can’t (yet) create “self-expanding” variables.

The AzureWebPowerShellDeployment task needs to fail properly if the Get-AzureWebsite command fails.

Right now with VS2015 out already some website configs have the unreleased "VS2015" option for remote debugging checked in the configuration (neither VS 2012 or VS2013 option is checked) and that causes the Get-AzureWebsite command to fail. (http://www.brandonmartinez.com/2015/07/14/resolve-a-requested-value-vs2015-was-not-found-get-azurewebsite-error-in-powershell/)

When that happens the task tries to create a new website with the same name and then that task fails.

Example code
2015-08-19T00:05:18.2923740Z Get-AzureWebSite -Name myportal -Slot staging -ErrorAction SilentlyContinue
2015-08-19T00:05:32.3355539Z New-AzureWebSite -Name myportal -Location East US -Slot staging

Whomever put the -SilentlyContinue switch is assuming that the Get-AzureWebSite can only fail for one reason, that the site is not provisioned yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.