Giter VIP home page Giter VIP logo

meta-runner-power-pack's Introduction

official JetBrains project License

Meta-runner Power Pack

A collection of Meta-runners for TeamCity.

Available Meta-Runners

  • Publish TeamCity artifacts (publishes artifacts to TeamCity while the build is running)
  • Upload to FTP (uploads files to FTP)
  • Download File (downloads file by HTTP or FTP URL)
  • Trigger Custom Build (triggers a build in TeamCity optionally with custom parameters)
  • Add Tags to Build (adds tags to currently running build in TeamCity)
  • Deploy War (deploys war file to servlet container)
  • Create Text File (creates text file with specified content)
  • Build Status Text (sets custom build status text to the build)
  • Sonar Runner (Runner for Sonar)
  • PHP-related meta runners (see documentation)
    • Run arbitrary PHP code
    • Install a specific Composer dependency
    • Install/update packages from composer.json
    • Run Phing build script
    • Run PHPUnit tests (with code coverage reporting)
  • .NET-related meta runners
    • Update connection string in configuration file
    • Update appsetting value in configuration file
    • Run tests with VSTest
  • .NET/PowerShell-based meta-runners

Installation Instructions

Each file called MRPP_<some text>.xml contains a definition of a single Meta-runner.

You can install a meta-runner directly via the file system or, since TeamCity 9.0, using the TeamCity Web UI:

  • to install Meta-runner directly to the file system, take the Meta-runner definition file and put it into the <TeamCity Data Directory>/config/projects/<Project ID>/pluginData/metaRunners/ directory, where <Project ID> is the identifier of a project where you want to place the Meta-runner. If the metaRunners directory does not exist, it will be created. Once you place the file on the disk, TeamCity will detect it and load this Meta-runner; no server restart is required.

  • to install Meta-runner via the Web UI, go to the Project Settings page, select Meta-Runners from the list of settings on the left, click Upload Meta-Runner and select the Meta-runner definition file. Save you changes.

If the Meta-runner is loaded successfully, you will see it listed on the Meta-Runners page for the project; if you have appropriate permissions, you can modify the definition directly in the TeamCity UI.

The runner is now available in the list of build runners on the build configuration Build Steps page and is represented as a native TeamCity runner with a convenient UI.

A Meta-runner placed into some project will be available to all build configurations and all subprojects of this project. If you want a Meta-runner to be available to all of the projects, place it in the Root project.

Troubleshooting

If you see "Meta-Runner with specified name already exists" when attempting to upload a meta-runner via the UI, or if after placing the Meta-runner on the disk you see the following error in the TeamCity web interface: Meta-Runner with id '<some id>' was registered from path '<some path>\<meta runner file name>.xml' and cannot be overridden from path '<another path>\<meta runner file name>.xml'

it means that a Meta-runner with the same ID is already defined in another project. To fix it, you can either remove the old Meta-runner, or change the ID of the new one. The ID of the Meta-runner is the name of the file, so you can simply rename the file. It makes sense to preserve prefix MRPP_ so that you could understand where this Meta-runner came from.

meta-runner-power-pack's People

Contributors

abbottdev avatar asifa-interxion avatar burnasheva avatar charlyraffellini avatar cottsak avatar dawen18 avatar deuscapturus avatar gep13 avatar halfpastfouram avatar iamkoch avatar igor-vovk avatar jkommer avatar jkonecki avatar johnnycederholm avatar jole78 avatar julia-alexandrova avatar kamengoranchev avatar lexxfedoroff avatar linfar avatar ma499 avatar maartenba avatar micheh avatar mikeclayton avatar nd avatar nikolaypianikov avatar pavelsher avatar robdmoore avatar wes-novack avatar x-cubed avatar yaegor 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

meta-runner-power-pack's Issues

Specify local xUnit executable path

Different git branches could be running on different xUnit versions and the current approach of choosing the latest from nuget doesn't work. xUnit can have breaking changes. Hence it should be possible to specify a local xUnit executable path. This is similar to #96 but I do not want to fetch xUnit from nuget, as that could slow down the build as well.

Note: we have xUnit checked in to source control.

MRPP_AddBuildTags does not separate multiple tags

When I attempt to tag a build using MRPP_AddBuildTags with multiple tags separated by a space, the build ends up with 1 tag and the space is replaced with &lt;/tag>&lt;tag>.

For example, I attempt to tag with this: env=sandbox deploy=Everything
And I end up with this single tag: env=sandbox&lt;/tag>&lt;tag>deploy=Everything

Missing feature for allowing generate report on DotCover

One of features in dotcover is _generate a report _with result after analysis in different formats (HTML|JSON|XML|NDependXML) .
More info: JetBrains DotCover Page

SonarQube accept import a results from the report generated from dotcover in HTML format.

In the meta-runner xUnit.net-dotCover is missing how enable for generate a report.

One option is add and extra step after execute metarunner.
This extra step execute in a poweshell or command line the following:

${path}/dotcover report /Source=xunitcoverage.dcvr /Output=ResultDotCover.html /ReportType=HTML
to generate this report.

This execution in sometimes fails because the xunitcoverage.dcvr not exists, I think when publish the artefact was deleted from the working folder.

I think if you execute dotcover report step how a part of the metarunner works fine.

Can you add this feature in the metarunner?

Meta-runner for getting Artifact Dependencies

Now it happens so: the build is triggered, it picks up dependencies while queuing, and afterwards it may run only with that dependency versions which are linked while queuing. So, when the last configuration of the long queue starts, it still runs with yesterday's build.

If I put getting dependency as a step it will help taking the very last build.

Related to http://youtrack.jetbrains.com/issue/TW-33828

Chokolatey sets $url parameter

When building a project and Chokolatey is not installed on the build agent, the Chokolatey install script apparently defines a url parameter containing the value https://chocolatey.org/api/v2/package/chocolatey/ which gets passed along to gitversion.exe. Using a local git repository (no url is specified), the following command was executed by the metarunner: C:\ProgramData\Chocolatey\bin\gitversion.exe "C:\TeamCity\buildAgent\work\4d3ca3d2ab478a4a" /url 'https://chocolatey.org/api/v2/package/chocolatey/' /output 'buildserver' /UpdateAssemblyInfo true. Running the build again works as expected, since the install script is not executed.

[PHP] Downloading Composer Does Not Check Signature

Metarunner for PHP Composer Install downloads composer.phar every time. While this is good (since who knows how old composer binary was installed in the system) the method used is dangerous and not recommended.

Current method simply downloads PHAR archive and simply executes it without checking of the signature. Proper method to programmatically download composer is to use simple bash script provided by authors.

PHPUnit runner does not work with some failure conditions

When configuring PHPUnit to generate code coverage reports and if configuring failure conditions to fail on anything except number of tests TeamCity throws an error that says : 'Cannot calculate build metric 'number of covered lines' - no value'

xUnit.net + dotCover meta-runner fails with space in working folder path

The current approach to using Invoke-Expression to launch nuget, xunit and dotCover exe's will fail if there is a space in the working folder path. It can be fixed by using call operator "&" and single quoted paths in conjunction with Invoke-Expression. Examples below with original code commented out followed by fixed code:

NuGet:

#Invoke-Expression "$nugetExe install xunit.runner.console -source $xUnitNuget"
Invoke-Expression "& '$nugetExe' install xunit.runner.console -source $xUnitNuget"

xUnit:

#$xunitOnlyCommand = "$xunit $xunitArg"
$xunitOnlyCommand = "& '$xunit' $xunitArg"

dotCover:

#$command = "$dotCover $dotCoverArgs"
$command = "& '$dotCover' $dotCoverArgs"

PHPUnit version

Hi there, I was testing those Meta Runners which technically may help me quite a lot, but I need to specify the PHPUnit version because the latest one will work just with PHP 7 while I need PHP-Unit 5 to work with PHP 5.6

Apparently there is no way where I can specify which version I can use or a specific path to an existing phpunit binary of my choice.

Can you please point me to the right direction?

Thanks
Best regards
Andrea

xUnit.net + dotCover Plugin not working .NET Core

The issue is xUnit.net + dotCover plugin is not working correctly with .net core 2, here is our settings for this build step:
image

Here is the error /warning message from Teamcity
image

Any Thoughts on that?

Thanks
Shady

GitVersion MetaRunner can't find chocolatey properly

When building my project I get

PowerShell Executable: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
[08:50:26] Working directory: C:\Users\teamcity\teamcityconf\BuildAgent\trick\work\a340315af7a6407e
[08:50:28] Chocolatey already installed
[08:50:28] GitVersion not installed; installing GitVersion
[08:50:28] ##teamcity[buildStatus text='The term 'C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd' 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.' status='FAILURE']

image

however with the latest version of chocolatey this directory does not exist

image

xunit.net is broken in teamcity 2017.2

Using Teamcity 2017.2 i get :

.NET Coverage: Failed to find .NET coverage tool at dotCover.exe

[10:16:33][Step 16/22] Step 2/2: Run xUnit.net tests (.NET Process Runner) (1s)
[10:16:33][Step 2/2] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[10:16:33][Step 2/2] in directory: C:\TeamCity\buildAgent\work\3915e306ed37130f
[10:16:34][Step 2/2] error: file not found: MSIL
[10:16:34][Step 2/2] .NET Coverage: Failed to find .NET coverage tool at dotCover.exe
[10:16:34][Step 2/2] .NET Coverage: Failed to find .NET coverage tool at dotCover.exe
[10:16:34][Step 2/2] Process exited with code 0
[10:16:34][Step 2/2] Step Run xUnit.net tests (.NET Process Runner) failed

I found an old version (in another teamcity install made many years ago) that works, but i could not relate to any history in this git repository :

MR_XUnitNet_very_old.xml.txt

PHPUnit meta runner does not fail if PHPUnit return exit code > 0

At the top of the ant script

<property name="phpunit.result.error" value="false" />

is set.

Properties are immutable.

The later defined conditions can't change the value of the property. So, if we
get an exit code > 0 from PHPUnit, "runTest" will never fail.

<target name="runTests" depends="getPhpUnit,runPhpUnitPhar,runPhpUnitRuntime,collectCoverage">
    <fail message="Unit test error." if="${phpunit.result.error}" />
</target>

Removing ths line

<property name="phpunit.result.error" value="false" />

solves the problem for me.

xUnit.net + dotCover plugin and NuGet.Config in folder

Given: working folder with solution project folders and files, and Nuget.Config file
When: running xUnit+dotCover step
AND restoring package 'xunit.runner.console.2.1.0'
Then: package will be restored at Nuget.Config specified folder, not working folder
AND dotCover console throws error: Target executable is not specified

Test failures still running subsequent build steps

When an xunit test fails the step is still reported as failed ( ie in red ) but subsequent tasks still execute even though the execute step are all set to "If all previous steps finished successfully"

The xUnit.net console running is returning exit code '1'

TeamCity server version is 9.1.6 (build 37459)

[Step 1/1] dotCoverArgs: cover coverage_settings.xml /LogFile=dotCoverXunitLog.txt /ReturnTargetExitCode
[Step 1/1] JetBrains dotCover Console Runner 10.0.2. Build 104.0.20151218.125453
[Step 1/1] xUnit.net Console Runner (64-bit .NET 4.0.30319.42000)

...

[Step 1/1] [JetBrains dotCover] Analysed application exited with code '1'

pre-release version numbers in semver-buildnumber

In regards to the semver-buildnumber meta-runner, would it be possible to support pre-release version numbers such as the following?

1.0.0-alpha1

Currently it only supports .NET version numbers that exactly conform to major.minor.build.release.

Unknown test framework

I'm trying to create a build step for test dll that tests an asp.net 5 web api project. The tests run just fine locally using xUnit, but in Team City, I get the following (I added ):

System.InvalidOperationException: Unknown test framework: could not find xunit.dll (v1) or xunit.execution.*.dll (v2) in D:\TeamCity\buildAgent\work\9e2adc6bf9610ed8\artifacts\bin\Release\dnx451

I've tried various combinations of NuGet package restore and dnx updates, but always get the same result. I've found that various people have had a similar issue, but all their solutions do not seem to work for me. Can someone lend a hand with this?

GitVersion: Join-Path not recognized

Error message is as follows. I'm using MR_GitVersion3.xml.

The term 'Join-Path' 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.

Seemingly relative line:

[string] $workingDir = (Join-Path "%teamcity.build.workingDir%" "%mr.GitVersion.gitCheckoutDir%"),

xUnit.net does not work anymore with choco 9.9.12

I'm adding a new agent to teamcity, it first download chocolatey, and then tries do install xunit, but it fails with the following error messages. Looking at choco folder it looks like the structure it changed in new versions before there was a C:\ProgramData\Chocolatey\chocolateyInstall subfolder, now there is not.
I think that the plugin should use choco in path rather than making any assumption on any installed folder.

Step 5/9: Test (xUnit.net + dotCover)
[12:37:32][Step 5/9] Step 1/2: Install xUnit from Chocolatey (Powershell)
[12:37:32][Step 1/2] PowerShell Executable: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
[12:37:32][Step 1/2] Working directory: C:\BuildAgent\work\ca594cc2eae5296
[12:37:32][Step 1/2] PowerShell arguments: [-NoProfile, -NonInteractive, -ExecutionPolicy, ByPass, -File, C:\BuildAgent\temp\buildTmp\powershell6473424193213794350.ps1]
[12:37:33][Step 1/2] Chocolatey already installed
[12:37:33][Step 1/2] xUnit.net not installed; installing xUnit.net
[12:37:33][Step 1/2] ##teamcity[buildStatus text='The term 'C:\ProgramData\Chocolatey\chocolateyInstall\chocolatey.cmd' 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.' status='FAILURE']
[12:37:33]
[Step 1/2] Incorrect property name.
Valid property list format is (name( )=( )'escaped_value'( )) where escape symbol is "|"
[12:37:33][Step 1/2] ##teamcity[message text='The term 'C:\ProgramData\Chocolatey\chocolateyInstall\chocolatey.cmd' 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.' status='ERROR']
[12:37:33]
[Step 1/2] Incorrect property name.
Valid property list format is (name( )=( )'escaped_value'( )) where escape symbol is "|"
[12:37:33][Step 1/2] Process exited with code 1
[12:37:33][Step 1/2] Step Install xUnit from Chocolatey (Powershell) failed

Ant-style wildcards don't work

using

src\**\bin\Release\*.Tests.dll

Causes an exception as the gci call returns an Object[] and not a string as expected.

Wrapping the result in a [String]::Join fixes this, however under certain conditions a string is returned (e.g. explicit paths laid) so this would need to be defensively coded around.

MRPP_AddBuildTags occasionally fails with 401 error

We are using the version from July 31 in TC 2018.1.1. We specified particular credentials in the "Add Build Tags" build step. It works 99% of the time, but on rare occasions in random builds we get this:

[15:02:23]prepare-internal-credentials:
[15:02:23]
[15:02:23]prepare-custom-credentials:
[15:02:23]     [echo] using custom credentials
[15:02:23]
[15:02:23]prepare-tags:
[15:02:23]
[15:02:23]addTags:
[15:02:23]     [http] HTTP Request
[15:02:23]     [http] ********************
[15:02:23]     [http] URL:		https://buildserver/httpAuth/app/rest/8.0/builds/id:1302210/tags
[15:02:23]     [http] Method:		POST
[15:02:23]     [http] 	Content-Type: application/xml
[15:02:23]     [http] Entity:		yes
[15:02:23]     [http] ------ BEGIN ENTITY ------
[15:02:23]     [http] <tags><tag>ObfuscatedTag1</tag><tag>ObfuscatedTag2</tag></tags>
[15:02:23]     [http] ------- END ENTITY -------
[15:02:23]     [http] 
[15:02:23]     [http] HTTP Response
[15:02:23]     [http] ********************
[15:02:23]     [http] Status:		401
[15:02:23]
[15:02:23]BUILD FAILED
[15:02:23]E:\Obfuscated\Obfuscated\build9079597898286185054.tmp:73: Expected Status [204] but got [401] for URI [https://buildserver/httpAuth/app/rest/8.0/builds/id:1302210/tags]

I can't figure out the cause. Credentials in the build steps do not change between builds. Is using "8.0" in the URL a problem? Should it use the most recent endpoint?

Is it possible that TeamCity cannot handle these REST calls if multiple calls happen at the same time?

xUnit.net + dotCover does not work anymore with 2.3

Hello,
since the release of 2.3 of XUnit, the meta-runner does not work anymore. The XUnit team changed the location of the xunit.runner.console.

The xunit.runner.console NuGet package has been changed; notably, the path to the net452 executables has moved from tools\ to tools\net452. You will need to update any paths which previously hard-coded this path.

You guys will have to check the version of XUnit downloaded from the feed to determine if the console application is in tools or tools\net452.

Also, I noticed that after the changes that @asif Ahmed on supporting multiple paths, the script gives me the the following errors:

##teamcity[buildStatus text='Method invocation failed because [System.Object[]
[13:14:37]
[Step 1/1] Value should end with "'"
Valid property list format is (name( )*=( )*'escaped_value'( )*)* where escape symbol is "|"
[13:14:37][Step 1/1] ] does not contain a method named 'Trim'.' status='FAILURE']
[13:14:37][Step 1/1] ##teamcity[message text='Method invocation failed because [System.Object[]

I do not have any problems using commit d310194.

Thank you.

PHPUnit : fails with “tccoverage does not exist”

Hi,

All in title : i can't get the PHPUnit metarunner work with code coverage :

[12:22:11]Step 2/2: Run unit tests & coverage (PHP - PHPUnit) (3s)
[12:22:11][Step 2/2] Step 1/1: Ant (3s)
[12:22:13][Step 1/1] collectCoverage
[12:22:13][collectCoverage] zip
[12:22:13][zip] /home/teamcity/TeamCity/buildAgent/work/88c8db464164b0a9/tccoverage does not exist.
[12:22:14][Step 1/1] Step Ant failed

I'm using the dev-master branch

PHPUnit -c option

Hi there,
I was facing an issue using the MRPP_PHP_PHPUnit because the project I was trying to test didn't have a configuration file but a test folder with php scripts.

The test where failing because of missing xml file and to change the runner this way:
<arg line="-c &quot;${phpunit.configuration}&quot; --log-junit ${phpunit.junit.log} ${phpunit.coverage.param} ${phpunit.params}"/>
to
<arg line="&quot;${phpunit.configuration}&quot; --log-junit ${phpunit.junit.log} ${phpunit.coverage.param} ${phpunit.params}"/>

Is there any other way I can acchieve the same result without modifying the runner?

Thanks
Best regards
Andrea

Error running dotCover with xUnit + dotCover runner

When running coverage on tests that use SQL Server, this error appears:

[JetBrains dotCover] Coverage session finished with errors: Unable to profile the application because the host protection is applied. Probably it relates with Microsoft SQL; Unable to profile the application because the host protection is applied. Probably it relates with Microsoft SQL.

This issue and a workaround (add /ProcessFilters=-:sqlservr.exe to dotCover.exe arguments) is describe here: https://teamcity-support.jetbrains.com/hc/en-us/community/posts/205410670-Can-t-generate-the-code-coverage-report

SSLHandshakeException

Hello,

How can I solve the following issue in a build?

[11:35:07][Step 1/1] getPhpUnit (1s)
[11:35:07][getPhpUnit] get (1s)
[11:35:07][get] Getting: http://phar.phpunit.de/phpunit.phar
[11:35:07][get] To: /opt/TeamCity/buildAgent/temp/buildTmp/phpunit.phar
[11:35:08][get] http://phar.phpunit.de/phpunit.phar permanently moved to    https://phar.phpunit.de/phpunit.phar
[11:35:09][get] Error getting http://phar.phpunit.de/phpunit.phar to /opt/TeamCity/buildAgent/temp/buildTmp/phpunit.phar
[11:35:09][get] javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

deploy war depends on jdom?

[15:02:21]Step 6/6: Deploy War (Deploy War) (3s)
[15:02:21][Step 6/6] Step 1/1: Ant (3s)
[15:02:24][Step 1/1] deploy
[15:02:24][deploy] cargo
[15:02:25][cargo] org.codehaus.cargo.container.ContainerException: Failed to create deployable with implementation class org.codehaus.cargo.container.tomcat.TomcatWAR for the parameters (container [id = [tomcat6x]], deployable type [war]).
[15:02:25][Step 1/1] Process exited with code 1
[15:02:25][Step 1/1] Ant output
[15:02:25][Ant output] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[15:02:25][Ant output] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[15:02:25][Ant output] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[15:02:25][Ant output] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[15:02:25][Ant output] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[15:02:25][Ant output] at org.apache.tools.ant.Main.runBuild(Main.java:809)
[15:02:25][Ant output] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[15:02:25][Ant output] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[15:02:25][Ant output] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
[15:02:25][Ant output] Caused by: java.lang.NoClassDefFoundError: org/jdom/Parent
[15:02:25][Ant output] at java.lang.ClassLoader.defineClass1(Native Method)
[15:02:25][Ant output] at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
[15:02:25][Ant output] at org.apache.tools.ant.AntClassLoader.defineClassFromData(AntClassLoader.java:1124)
[15:02:25][Ant output] at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1295)
[15:02:25][Ant output] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1351)
[15:02:25][Ant output] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1311)
[15:02:25][Ant output] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1064)
[15:02:25][Ant output] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[15:02:25][Ant output] at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.parseTomcatContextXml(TomcatWarArchive.java:92)
[15:02:25][Ant output] at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.(TomcatWarArchive.java:59)
[15:02:25][Ant output] at org.codehaus.cargo.container.tomcat.TomcatWAR.(TomcatWAR.java:50)
[15:02:25][Ant output] ... 29 more
[15:02:25][Ant output] Caused by: java.lang.ClassNotFoundException: org.jdom.Parent
[15:02:25][Ant output] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1361)
[15:02:25][Ant output] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1311)
[15:02:25][Ant output] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1064)
[15:02:25][Ant output] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[15:02:25][Ant output] ... 40 more
[15:02:25][Ant output]
[15:02:25][Ant output] Total time: 3 seconds
[15:02:25][Step 1/1] Step Ant failed

Build with Msbuild 2015

I'm using the meta runner and everything is ok, but I'm not able to use new C# syntax because it seems that it is launching old version of msbuild.exe.

Location of Msbuild is c:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe and in build machine there is VS2015 installed.

How can I configure Gitversion meta-runner to use the correct version of msbuild?

Gian Maria.

PHPUnit meta runner fails even if tests pass

With the PHP meta runners installed on TeamCity 8.0.6, the ant script would fail even if phpunit had an exit code of 0:

[Step 1/1] runTests
[runTests] fail
[fail] Unit test error.
[Step 1/1] Process exited with code 1

We were able to fix this by changing the fail condition from

<fail message="Unit test error." if="phpunit.result.error" />

To

<fail message="Unit test error." if="${phpunit.result.error}" />

Is this a compatibility issue with the built-in Ant? Will updating the runner cause issues with older environments?

Confusion as to how to use the GitVersion meta runner

I was assuming that once I switched my checkout mode from Automatically on Server to Automatically on Agent, the repository + all git info would be pulled for GitVersion to work properly, but that was not the case for me.

The repo is pulled as expected (by TeamCity), but when I get to my GitVersion runner step, it says: Fetching from remote 'origin' using the the following refspecs: +refs/heads/:refs/remotes/origin/.

Then it fails: LibGit2Sharp.LibGit2SharpException: Request failed with status code: 401

Likely because the runner does not have the username.

When I go back to edit the steps properties, add the repo url, with the username and password it works as expected - but files are checked out twice, once by teamcity and then again by the meta runner. Is this to be expected? I thought once the files were checked out by teamcity and all the git info was available that GitVersion would have everything it needs to process. Am I missing something here?

Meta runner fails to start xunit.console.exe after the package version update

We use the xUnit + dotCover as one of the build steps in a TeamCity configuration. The step started failing consistently around 7/17/2018 on some of the branches with the following message:
##teamcity[buildStatus text='Cannot find path 'C:\BuildAgent\work\a089c236b45ffff1\xunit.runner.console.2.3.1\tools\net452\xunit.console.exe C:\BuildAgent\work\a089c236b45ffff1\xunit.runner.console.2.4.0\tools\net452\xunit.console.exe.config' because it does not exist.' status='FAILURE']
We use git and 'Automatically on server' checkout mode for the version control.

Upon further investigation, we discovered the following:

  • Meta runner installs the latest version of the xunit.runner.console nuget package into the working directory.
  • Version 2.4.0 of the xunit.runner.console package came out around the same time our builds started failing.
  • The working folders on all build agents had both xunit.runner.console.2.3.1 and xunit.runner.console.2.4.0 folders at the time of the failures.
  • Meta runner code at MRPP_xunit_dotcover.xml#L78 is using Resolve-Path on xunit.runner.console.* which I believe returns an array of strings in case if both xunit.runner.console.2.3.1 and xunit.runner.console.2.4.0 folders are present.
  • The meta runner also appends .config suffix to the path and then fails because the path 'C:\BuildAgent\work\a089c236b45ffff1\xunit.runner.console.2.3.1\tools\net452\xunit.console.exe C:\BuildAgent\work\a089c236b45ffff1\xunit.runner.console.2.4.0\tools\net452\xunit.console.exe.config' does not exist.
  • Manually deleting xunit.runner.console.2.3.1 folder on a build agent fixes the problem.

Is this a bug in the meta runner code? Or is it something wrong with the configuration we use? It seems like meta runner code should account for having multiple version of the xunit.runner.console package in the working folder and only use the most recent one. Or even better, the version of the xunit.runner.console package should be a configurable parameter.

Cannot run tests: Method invocation failed

[19:46:49]Step 2/2: xUnit.net + dotCover    (2s)
[19:46:49][Step 2/2] Step 1/1: Install Test runner, Create config, Run tests, Update coverage (PowerShell) (2s)
[19:46:49][Step 1/1] PowerShell Executable: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
[19:46:49][Step 1/1] Working directory: C:\TeamCity\buildAgent\work\9e44db9594c498c9
[19:46:49][Step 1/1] Command: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
[19:46:49][Step 1/1] PowerShell arguments: -NoProfile, -NonInteractive, -ExecutionPolicy, ByPass, -File, C:\TeamCity\buildAgent\temp\buildTmp\powershell1172738450403842208.ps1
[19:46:50][Step 1/1] Feeds used:
[19:46:50][Step 1/1]   http://www.nuget.org/api/v2/
[19:46:50][Step 1/1] 
[19:46:51][Step 1/1]   GET https://www.nuget.org/api/v2/FindPackagesById()?id='xunit.runner.console'&semVerLevel=2.0.0
[19:46:51][Step 1/1]   OK https://www.nuget.org/api/v2/FindPackagesById()?id='xunit.runner.console'&semVerLevel=2.0.0 180ms
[19:46:51][Step 1/1] Package "xunit.runner.console.2.2.0" is already installed.
[19:46:52][Step 1/1] ##teamcity[buildStatus text='Method invocation failed because [System.Object[]
[19:46:52]
[Step 1/1] Value should end with "'"
Valid property list format is (name( )*=( )*'escaped_value'( )*)* where escape symbol is "|"
[19:46:52][Step 1/1] ] does not contain a method named 'Trim'.' status='FAILURE']
[19:46:52][Step 1/1] ##teamcity[message text='Method invocation failed because [System.Object[]
[19:46:52]
[Step 1/1] Value should end with "'"
Valid property list format is (name( )*=( )*'escaped_value'( )*)* where escape symbol is "|"
[19:46:52][Step 1/1] ] does not contain a method named 'Trim'.' status='ERROR']
[19:46:52][Step 1/1] Process exited with code 1
[19:46:52][Step 1/1] Process exited with code 1
[19:46:52][Step 1/1] Step Install Test runner, Create config, Run tests, Update coverage (PowerShell) failed

xUnit.net + dotCover meta-runner fails with mulitple exe's in xUnit NuGet package

If xUnit Console NuGet package contains multiple xunit.console.exe files, current code will include them all in the command line causing the xUnit execution to fail. For example, the standard xunit.runner.console.2.4.1 package contains exe's for net542, net46, net461, net462, etc.

May want to add a parameter for specific framework version or at least check for multiple results and just grab the first one (that's what I ended up doing).

Original code:

## get xunit runner from nuget package feed
Invoke-Expression "$nugetExe install xunit.runner.console -source $xUnitNuget"
$xunit = Join-Path $workingDir "xunit.runner.console.*\tools\$xUnitExe" | Resolve-Path

if (-not $xunit) {
    # Try finding xunit under framework specific folder
    $xunit = Join-Path $workingDir "xunit.runner.console.*\tools\net4*\$xUnitExe" | Resolve-Path
}

Workaround with check for multiple results (also include fix for space in path mentioned in #135:

## get xunit runner from nuget package feed
Invoke-Expression "& '$nugetExe' install xunit.runner.console -source $xUnitNuget"
$xunit = Join-Path $workingDir "xunit.runner.console.*\tools\$xUnitExe" -Resolve
if ($xunit.Length -gt 0) {$xunit = $xunit[0]}

if (-not $xunit) {
    # Try finding xunit under framework specific folder
    $xunit = Join-Path $workingDir "xunit.runner.console.*\tools\net4*\$xUnitExe" -Resolve
    if ($xunit.Length -gt 0) {$xunit = $xunit[0]}
}

Unable to load the service index for source

Hi,

We are using the extension; when running in our build, we are noticing the following error:

[Step 5/5] Step 1/1: Install Test runner, Create config, Run tests, Update coverage (Powershell) (4s)
[15:24:42][Step 1/1] PowerShell Executable: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
[15:24:42][Step 1/1] Working directory: C:\BuildAgent\work\7db49b1ba6aa4694
[15:24:42][Step 1/1] PowerShell arguments: [-NoProfile, -NonInteractive, -ExecutionPolicy, ByPass, -File, C:\BuildAgent\temp\buildTmp\powershell1783826750060090740.ps1]
[15:24:45][Step 1/1] Feeds used:
[15:24:45][Step 1/1] http://OUR_LOCAL_NEXUS_NUGET_FEED
[15:24:45][Step 1/1]
[15:24:45][Step 1/1] Unable to load the service index for source http://OUR_LOCAL_NEXUS_NUGET_FEED .
[15:24:45][Step 1/1] Key not valid for use in specified state.

[15:24:46][Step 1/1] No test assemblies found
[15:24:46][Step 1/1] Process exited with code 0

NuGet: 3.4.3.
TeamCity: 9.1.6
Compiler: Visual Studio 2015-SP2

Thanks pointers on how to fix this would greatly be appreciated.

-Long

Chocolatey complains about deprecated features

When "Update GitVersion" is checked in the TeamCity build step configuration, I am seeing two warning in the build log that seem to be coming from Chocolatey.

One warning says:

[14:23:19][Step 1/1] DEPRECATION NOTICE - choco update is deprecated and will be removed or
[14:23:19][Step 1/1] replaced in version 1.0.0 with something that performs the functions
[14:23:19][Step 1/1] of updating package indexes. Please use choco upgrade instead.

Another says:

[14:23:42][Step 1/1] WARNING: Write-ChocolateySuccess is deprecated. If you are the maintainer,
[14:23:42][Step 1/1] please remove it from your package file.

I have Chocolatey v0.9.9.12 (currently the latest) installed.

Here are these messages in their context:

[14:23:15][Step 1/1] Checking for updated version of GitVersion
[14:23:19][Step 1/1]
[14:23:19][Step 1/1] DEPRECATION NOTICE - choco update is deprecated and will be removed or
[14:23:19][Step 1/1] replaced in version 1.0.0 with something that performs the functions
[14:23:19][Step 1/1] of updating package indexes. Please use choco upgrade instead.
[14:23:19][Step 1/1] Upgrading the following packages:
[14:23:19][Step 1/1] gitversion.portable
[14:23:19][Step 1/1] By upgrading you accept licenses for the packages.
[14:23:23][Step 1/1] You have GitVersion.Portable v3.4.1 installed. Version 3.5.4 is available based on your source(s).
[14:23:31][Step 1/1]
[14:23:31][Step 1/1] GitVersion.Portable v3.5.4
[14:23:42][Step 1/1] Added C:\ProgramData\chocolatey\bin\gfv.exe shim pointed to '..\lib\gitversion.portable\tools\gitversion.exe'.
[14:23:42][Step 1/1] WARNING: Write-ChocolateySuccess is deprecated. If you are the maintainer,
[14:23:42][Step 1/1] please remove it from your package file.
[14:23:44][Step 1/1] ShimGen has successfully created a shim for GitVersion.exe
[14:23:44][Step 1/1] The upgrade of gitversion.portable was successful.
[14:23:44][Step 1/1]
[14:23:44][Step 1/1] Chocolatey upgraded 1/1 package(s). 0 package(s) failed.
[14:23:44][Step 1/1] See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Provision to download specific version of XUnit Console runner

Should we introduce a new parameter to specify the XUnit version to be downloaded internally, by the plugin on TeamCity Server. The main idea is not to use the latest version of XUnit as I have observed multiple issues across XUnit and .NetFramework. Restricting to a specific version will make sure that no issues come up.

So, NuGet seems to provide an option to download the specific version of Console Runner.
<NugetExe> install xunit.runner.console -source <XUnitSource> -version 2.1.0

Perhaps this new parameter could be an OPTIONAL parameter, which if empty would imply that the latest version should be fetched from NuGet.

So,
If Parameter value exists
<NugetExe> install xunit.runner.console -source <XUnitSource> -version <Version>

If Parameter value is empty,
<NugetExe> install xunit.runner.console -source <XUnitSource>

Please suggest if this would be a good feature to be introduced within the plugin ?

[xUnit.net + dotCover meta-runner] Error "Incorrect 'TargetExecutable' value"

TeamCity Professional 2018.1 (build 58245)
The error in "Step 1/1: Install Test runner, Create config, Run tests, Update coverage (PowerShell)":
[Step 1/1] Incorrect 'TargetExecutable' value 'C:\TeamCity\buildAgent\work\6fc5b5e66f19d062\xunit.runner.console.2.4.0\tools\net452\xunit.console.exe C:\TeamCity\buildAgent\work\6fc5b5e66f19d062\xunit.runner.console.2.4.0\tools\net46\xunit.console.exe C:\TeamCity\buildAgent\work\6fc5b5e66f19d062\xunit.runner.console.2.4.0\tools\net461\xunit.console.exe C:\TeamCity\buildAgent\work\6fc5b5e66f19d062\xunit.runner.console.2.4.0\tools\net462\xunit.console.exe C:\TeamCity\buildAgent\work\6fc5b5e66f19d062\xunit.runner.console.2.4.0\tools\net47\xunit.console.exe C:\TeamCity\buildAgent\work\6fc5b5e66f19d062\xunit.runner.console.2.4.0\tools\net471\xunit.console.exe C:\TeamCity\buildAgent\work\6fc5b5e66f19d062\xunit.runner.console.2.4.0\tools\net472\xunit.console.exe'

The problem is in the following code:

$xunit = Join-Path $workingDir "xunit.runner.console.*\tools\$xUnitExe" | Resolve-Path
    
if (-not $xunit) {
    # Try finding xunit under framework specific folder
     $xunit = Join-Path $workingDir "xunit.runner.console.*\tools\net4*\$xUnitExe" | Resolve-Path
}

When $xUnitExe is "xunit.console.exe" (as specified in readme.md) then Join-Path command will return multiple results for the "xunit.runner.console.\tools\net4\$xUnitExe" path.

As a fast solution can be specified the folder name for "Xunit Runner Executable" param:
"net461\xunit.console.exe".

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.