Ncover reporting exec with ccnet - cruisecontrol.net

i'm using the following exec for Ncover reportng
"C:\Program Files\NCover\NCover.Console.exe"
"C:\Program Files\NUnit 2.4.8\bin\nunit-console.exe"
//w C:\CCNET\build\TA\BusinessLogic\"
//x C:\CCNET\build\TA\BusinessLogic\Artifacts\ncover\bll-alog-coverage.xml"
//l "C:\CCNET\build\TA\BusinessLogic\Artifacts\ncover\bll-alog-.log"
" "C:\CCNET\build\TA\BusinessLogic\BLL\TA.BusinessLogic.TimeAttendance.AttendLog.Tests\bin\Debug\TA.BusinessLogic.TimeAttendance.AttendLog.Tests.exe "
and
C:\CCNET\build\TA\BusinessLogic\Artifacts\dao-coverage.xml
but after building ,Ncover in webdash board seems to be empty

If you use exec task for ncover you will need to manually merge the ouput file from ncover as shown in http://docs.ncover.com/how-to/continuous-integration/cruisecontrol-net/
But did you try using the ncover tasks directly in ccnet instead of an exec task? see : http://confluence.public.thoughtworks.org/display/CCNET/NCover+Reporting+Task and http://confluence.public.thoughtworks.org/display/CCNET/NCover+Profiler+Task
You will also need to have the proper xsl script in your dashboard.config and ccservice.exe.config files.

the new site for ccnet is http://www.cruisecontrolnet.org/projects/ccnet
ncover reporting task
http://www.cruisecontrolnet.org/projects/ccnet/wiki/NCover_Reporting_Task
ncover profiler task
http://www.cruisecontrolnet.org/projects/ccnet/wiki/NCover_Profiler_Task

Related

Rerunning failed scenarios with Selenide/Cucumber - no rerun.txt file

I writing automation tests with Cucumber/Selenide and I want to rerun failed scenarios.
This is part of my project with only two small tests (one is failing) to demonstrate behavior: https://github.com/mtpx/cucumberRerun
I read how to do it on How to rerun the failed scenarios using Cucumber? and https://medium.com/#belek.bagishbekov/how-to-rerun-failed-test-cases-in-cucumber-b7fe9b1dcf9c
In my application.feature test runner(ApplicationTest) in #CucumberOptions's plugins section I have line: "rerun:rerun/failed_scenarios.txt", according to previous urls it should generate text file with failed scenario, but after test execution with 'mvn clean test' (with failed scenarios) - there's no any rerun.txt file.
Do You know what is wrong here? Why after build i dont have rerun.txt file?
I using Selenide instead of Selenium, maybe problem is here?
Create another scenario file as shown below. Let's say this as FailedScenarios.java. Whenever you notice any failed scenario run this file. This file will use target/rerun.txt as an input for running the scenarios.
This line is require:
features = "#target/rerun.txt",
Full CucumberOptions
#CucumberOptions(
monochrome = true,
features = "#target/rerun.txt", //Cucumber picks the failed scenarios from this file
format = {"pretty", "html:target/site/cucumber-pretty",
"json:target/cucumber.json"}
)
public class FailedScenarios {
}
You can use rerun file path other than target if you need to run failed Scenario also trigger from maven , In that case change the path in both file you main runner and failed test runner
problem solved :)
In pom i had line:
-Dcucumber.options="--plugin io.qameta.allure.cucumberjvm.AllureCucumberJvm"
This line overrides all plugins information in TestRunner

Azure worker role gets published with the wrong service configuration

I'm trying to get the "publish to azure" functionality in VS2013 going for my worker-role cloud-service project.
The problem I'm having is that no matter what I change the service configuration settings to the application is always deployed with the Localservice configuration
My .azurePubxml:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AzureCredentials>{"ServiceManagementEndpoint":"https:\/\/management.core.windows.net\/","SubscriptionId":"redacted"}</AzureCredentials>
<AzureDeleteDeploymentOnFailure>False</AzureDeleteDeploymentOnFailure>
<AzureDeploymentLabel>MyWorkerRole</AzureDeploymentLabel>
<AzureDeploymentReplacementMethod>AutomaticUpgrade</AzureDeploymentReplacementMethod>
<AzureSlot>Staging</AzureSlot>
<AzureEnableRemoteDesktop>True</AzureEnableRemoteDesktop>
<AzureEnableWebDeploy>False</AzureEnableWebDeploy>
<AzureFallbackToDeleteAndRecreateIfUpgradeFails>False</AzureFallbackToDeleteAndRecreateIfUpgradeFails>
<AzureHostedServiceLabel>MyLabel</AzureHostedServiceLabel>
<AzureHostedServiceName>MyService</AzureHostedServiceName>
<AzureEnableIntelliTrace>False</AzureEnableIntelliTrace>
<AzureEnableProfiling>False</AzureEnableProfiling>
<AzureServiceConfiguration>Staging</AzureServiceConfiguration>
<AzureSolutionConfiguration>Staging</AzureSolutionConfiguration>
<AzureStorageAccountLabel>webstorage</AzureStorageAccountLabel>
<AzureStorageAccountName>webstorage</AzureStorageAccountName>
<AzureAppendTimestampToDeploymentLabel>True</AzureAppendTimestampToDeploymentLabel>
</PropertyGroup>
</Project>
As you can see, the AzureServiceConfiguration is set to Staging.
If i look at the output from the build I can see these lines:
Target "ResolveServiceConfiguration" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Windows Azure Tools\2.6\Microsoft.WindowsAzure.targets" from project "path-to.ccproj" (target "CoreResolveServiceModel" depends on it):
3> Task "Message"
3> Target Profile: Local
3> Task "Message"
3> Service Configurations: ServiceConfiguration.Staging.cscfg;ServiceConfiguration.Production.cscfg;ServiceConfiguration.Local.cscfg
3> Task "Message"
3> Looking for a service configuration file named: ServiceConfiguration.Local.cscfg
3> Task "FindInList"
3> Task "Message"
3> Source Service Configuration: ServiceConfiguration.Local.cscfg
3> Task "Message"
3> Target Service Configuration: bin\Staging\ServiceConfiguration.cscfg
The end-result is that the ServiceConfiguration.Local.cscfg is used in the deployment instead of ServiceConfiguration.Staging.cscfg.
What does work though is to change the Service Configuration setting to staging under Development->Run/debug.
But this setting controls which configuration file is used when I run the app locally, so naturally I don't want to mess with it.
Also, if I use the Project->Package... option and choose staging I get the correct package and the correct config file generated.
I've also tried bulding manually with msbuild from commandline, works great as well.
Tried updating to azure sdk 2.6 in hopes that it would solve it, but no difference.
Should also say that I have this working in my web-role project. But for external reasons I had to split the worker-role to its own cloud project.
Update Some more info, I took a another closer look at the build log and found this:
1>------ Build started: Project: MyProject, Configuration: Debug Any CPU ------
1>Build started 6/5/2015 5:15:03 PM.
1>Building with tools version "12.0".
1>Target "_CheckForInvalidConfigurationAndPlatform" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "path_to_project.csproj" (entry point):
1>Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ).
1>Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ).
1>Using "Message" task from assembly "Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>Task "Message"
1> Task Parameter:Text=Configuration=Debug
1> Task Parameter:Importance=Low
1> Configuration=Debug
So it seems that neither
<AzureServiceConfiguration>Staging</AzureServiceConfiguration>
<AzureSolutionConfiguration>Staging</AzureSolutionConfiguration>
from the .azurePubxml are actually being used as input to the build script.
It all seems to boil down to, where is the Publish to Azure function pulling its parameters from, if not from the .azurePubxml file?
Never got this working fully in VS2013 but now I've gone up to VS2015 and publish to Azure works as expected again.

IIS WebDeploy using MS Build Fails with error MSB4044 -ConcatFullServiceUrlWithSiteName task

In setting up a Jenkins deployment job, I kept running into this error when trying to deploy a Visual Studio 2012 Web project via the command line.
error MSB4044: The "ConcatFullServiceUrlWithSiteName" task was not given a value for the required parameter "SiteAppName"
For reference, here are the parameters that I used:
/p:Configuration=Release /t:Rebuild /p:VisualStudioVersion=11.0 /p:PublishProfile="DeployToDevServer"
/p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish
/P:AllowUntrustedCertificate=True /p:MSDeployPublishMethod=WMSvc
/p:MsDeployServiceUrl=https://devmachine.server.com:8172/MsDeploy.axd
/p:username=domainhere\adminuserhere /p:password=adminpasshere
Note: It would deploy just fine if I chose Publish... from inside the project.
After much googling, and finally comparing a project that would deploy with the one that wouldn't, I finally figured it out after I opened the .csproj files with a text editor and compared them.
In the project that worked, I found this section:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
And it had this line:
<DeployIisAppPath>Default Web Site/sitenamehere</DeployIisAppPath>
I added this same line to the non-working project, changed the sitename, and it worked.
Hope this helps someone else.
You could pass this DeployIisAppPath as parameter to Jenkins, like this:
p:DeployIisAppPath=Default Web Site/sitenamehere
This would allow you to have different sitenames on different machines. While in your example (with CSPROJ modification) you would be obliged to have one IIS site name on all target machines

Cruisecontrol.net with UCM Clearcase - How to?

I am trying to configure Cruisecontrol.net for UCM Clearcase for the first time. Following is the sourceControl tag in the ccnet.config file:
<sourcecontrol type="clearCase">
<branch>123_India_Release</branch>
<autoGetSource>true</autoGetSource>
<viewName>admin_123_CRUISE</viewName>
<viewPath>$(ViewDirectory)</viewPath>
<useLabel>false</useLabel>
<useBaseline>false</useBaseline>
<executable>cleartool.exe</executable>
</sourcecontrol>
I constantly receive the following error:
ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control
operation failed: cleartool: Error: Not an object in a vob: "PATH TO
THE VIEW"
When I run cleartool from an arbitrary directory with the following parameters:
cleartool.exe lshist -r -nco -branch "123_India_Release" -since
05-Dec-2012.14:38:18 -fmt
I get the same error. But if I change the working directory to $(ViewDirectory) before running cleartool, it runs fine.
How should I make Cruisecontrol.net run cleartool.exe from the $(ViewDirectory)?
I have already tried adding <workingDirectory>$(ViewDirectory)</workingDirectory> tag before <executable>cleartool.exe</executable> but it did not work.
Any help would be appreciated.
EDIT 1:
As a workaround I have done the following:
<exec>
<executable>cleartool.exe</executable>
<baseDirectory>d:\Workspace\123_India_Release\VOB</baseDirectory>
<buildArgs>update -force</buildArgs>
<buildTimeoutSeconds>6000</buildTimeoutSeconds>
</exec>
I have added this to the tasks tag. I have configured an hourly trigger which does the following:
1) Update snapshot view
2) Build the VS 2010 solutions mentioned in the tasks tag.
The limitations are:
1) The trigger is hourly. I want it to be a commit based trigger.
2) This is a workaround
EDIT 2:
Further experimentation revealed that the ccnet.exe works fine. It does all that is needed. The issue is caused by the service ccservice.
I have stopped ccservice for now and started ccnet.exe. I plan to leave it running.
The View directory isn't enough: you must specify a vob.
See for instance:
"clearfsimport: Error: Not an object in a vob: "\"." (as an illustratio of that error message)
this thread (or this one): "You have to specify explicitly the VOB(s) to check for modification set"
The path should looks like:
<viewPath>Drive:\path\to\view\vobname</viewPath>
If your $(ViewDirectory) already references Drive:\path\to\view, then you could use:
<viewPath>$(ViewDirectory)\vobname</viewPath>

cruisecontrol <buildargs> nant parameter not being passed

I've been trying to use the param in my cruisecontrol build config file to no avail. When checking the cruisecontrol log file, whatever buildargs I try to pass are NOT passed to the call to nAnt.
Here's the nant task:
<nant>
<buildArgs>-D:CCFoo="Unknown" -D:foo="$(foo)"</buildArgs>
<executable>C:\MCR\Trunk\BuildLibrary\NAnt.exe</executable>
<baseDirectory>C:\MCR\Trunk\tek.Build</baseDirectory>
<buildFile>tek.build</buildFile>
<targetList>
<target>cc</target>
</targetList>
<buildTimeoutSeconds>1800</buildTimeoutSeconds>
</nant>
Here's what appears in the logfile for that call to nant:
2010-01-28 08:45:12,815 [TekWebsite:DEBUG] Starting process [C:\MCR\Trunk\BuildLibrary\NAnt.exe] in working directory [C:\MCR\Trunk\tek.Build] with arguments [-nologo -buildfile:tek.build -logger:NAnt.Core.XmlLogger -D:CCNetArtifactDirectory="C:\Program Files (x86)\CruiseControl.NET\server\builds" -D:CCNetBuildCondition=ForceBuild -D:CCNetBuildDate=2010-01-28 -D:CCNetBuildTime=08:45:12 -D:CCNetFailureUsers= -D:CCNetIntegrationStatus=Unknown -D:CCNetLabel=50 -D:CCNetLastIntegrationStatus=Failure -D:CCNetListenerFile="C:\Program Files (x86)\CruiseControl.NET\server\builds\ClarksWebsite_ListenFile.xml" -D:CCNetModifyingUsers= -D:CCNetNumericLabel=50 -D:CCNetProject=TekWebsite -D:CCNetProjectUrl=http://cor-str-mcr08/ccnet/server/local/project/TekWebsite/ViewProjectReport.aspx -D:CCNetRequestSource=Dashboard -D:CCNetWorkingDirectory="C:\Program Files (x86)\CruiseControl.NET\server" cc]
I'm thinking that maybe there's a config setting for cruisecontrol that tells it to ignore buildargs?
I've tried reordering the lines in the nant task, putting buildargs at the top as you see, and a few places in the middle and the bottom. I've tried the different syntaxes that are available for buildargs such as:
-D:CCFoo="Unknown"
-D:CCFoo=Unknown
-DCCFoo=Unknown
I figured this out - the ccnet.config file that's used by the ccnet daemon process won't reload the build config file until either:
a) the process is restarted OR
b) the ccnet.config file is altered or touched in some way.
So I just went into C:\Program Files (x86)\CruiseControl.NET\server.ccnet.config and added a space, saved and now the buildargs are being passed to nant. woohoo!
I had the exact same problem running some bat file but my reason was I has used:
<msbuild>
...
instead of
<exec>
...

Resources