Jenkins MSTest Issue - hudson

I have configured Jenkins as the CI for a project which is using Mercurial as the source control management. I'm using MSTest plugin in Jenkins to see the test results and I have written a bat command to generate test result file
del results.trx
mstest /testcontainer:Example\TestProject1\bin\debug\TestProject2.dll /resultsfile:results.trx
it gives an error in console saying File "Example\TestProject1\bin\debug\TestProject2.dll" not found"
when every build happens a folder is created under %WORKSPACE% having a new name (SYSTEM_My_Computer_Name 2011-06-08 13_04_11). In that the test dll is in a directory called out. How can I get path to that dll, because the directory name is changed for every build?
It is working fine when I used a absolute url like "c:\Example\TestProject1\bin\debug\TestProject2.dll"
How can we refer the newly built dll ?
Do I need to add test dll file in to the repository ?

Jenkins run bat files with %WORKSPACE% as the current directory.
As the error message indicates, the relative path to the test container is wrong. I can think of two things that can be the issue here:
The folder structure under %WORKSPACE% does not match your relative path. Adding a cd by its own in the bat file will reveal on the build output where this is. You can also use the links in the Jenkins web ui to browse the workspace.
You are building a different msbuild target in Jenkins, for example release. Then \bin\debug might not exist.

The folder "SYSTEM_My_Computer_Name 2011-06-08 13_04_11" is not created by Jenkins during the build, but it is created by the mstest when it is running the test. The root folder when the mstest is invoked is the workspace root folder, so the testcontainer file should be specify from the workspace root.
For example, say if the dll file is under C:\jenkins\jobs\\workspace\TestProject1\bin\debug\TestProject2.dll(assume your jenkins is installed under c:\jenkins).
The command should be (relative to the workspace root folder):
mstest /testcontainer:TestProject1\bin\debug\TestProject2.dll /resultsfile:results.trx

Related

Where does the downloaded file go when execute robot framework using Jenkins

I need one help,
I am Executing a script of robot framework using Jenkins, as per the flow the script should download one XLS and validate the data using Pandas.
When I am executing the script using Jenkins and searching the downloaded file in a hardcoded path i.e. "C:\Users\Administrator\Downloads" the file is not found.
but when executing it manually the file downloaded on the same path
Can anyone please help me by telling me where do Jenkins stores all the downloaded files?
PS : I am using Google Chrome as web browser
For each job Jenkins runs, it creates a workspace directory, usually at:
$JENKINS_HOME/workspace/(Name of the Job)
The scripts (and robotframework's in this case) are run there, as the root directory. Most probably the downloaded file will be in a path from there (or an error should have occurred because the Jenkins user does not have access to the C:\Users... path).
There is a step in the Jenkins job, which is to archive (download) files from workspace, to Jenkins database, to be shown as "artifacts". Even the screenshots images or videos recording, must be registered in that step, so they can be viewed on the Report and Log in Jenkins (Robot Framework Plugin).

Warning: Could not find file C:\Users\Harsh Jain\Downloads\com.mysql.jdbc_5.1.5.jar\co

I am getting this error while running the Student Management System project in netbeans Ide project in made in java,jsp,html.Please help me
Your project's build has a dependency on the Java ARchive (.jar file) com.mysql.jdbc_5.1.5
There are two possibilities that I see here, without further details on what you have done so far:
1) You already downloaded the jar, but when you specified the path where your build process is gonna look for that file you had an error in your path ... make sure you have a jar file in C:\Users\Harsh Jain\Downloads\com.mysql.jdbc_5.1.5.jar or C:\Users\Harsh Jain\Downloads\com.mysql.jdbc_5.1.5.jar\com.mysql.jdbc_5.1.5.jar (I'm thinking you might have copied the name of the jar file twice in your path).
2) If you have not manually downloaded that file, then you should do so. You can find that version at http://www.java2s.com/Code/Jar/c/Downloadcommysqljdbc515jar.htm (or elsewhere). Once downloaded, make sure to copy/unzip the actual JAR file to your C:\Users\Harsh Jain\Downloads folder.
Once you have ensured the file is actually on your system AND in the right path, run the build again.

Azure AppService deploy.cmd using the wrong file

I am trying to configure continuous deployment to a test server on Azure. The app is an ASP.Net application, but in this case that shouldn't really matter.
My build process (team city) produces a folder that has everything needed to deploy (minus some connection string info). If you point IIS at that directory it works great. If you FTP that directory up to Azure it also works.
I am tracking each of these builds in git and pushing them up to Github. So I am trying to use Azure deployment option to deploy from github. Everything is in git. The /bin folder included.
Kudu shouldn't need to do anything but a pull from git and copy all the files to wwwroot.
So I've set my .deployment file to be this:
[config]
project = .
Every time I do that, though, the deployment gives me the message:
Using cached version of deployment script (command: 'azure -y --no-dot-deployment -r "D:\home\site\repository" -o "D:\home\site\deployments\tools" --aspWAP "D:\home\site\repository\MyProj.csproj" --no-solution').
And it runs some generic autogenerated deploy.cmd.
If I delete the deploy.cmd from the cache, it regenerates some generic one.
And, most importantly, in doing all this, the WRONG ASSEMBLY IS BEING DEPLOYED!!
My app depends on System.Web.Helpers.dll. The correct version of this DLL is in github. I've verified this multiple times.
Kudu, however, is grabbing an OLDER one from NuGet and deploying that. And, of course, I get the dreaded YSOD error about not being able to load that file.
What do I need to do to make Kudu just copy the files from my github repository to wwwroot and nothing else?
I wound up getting it to deploy by hand editing the autogenerated deploy.cmd file that lives at \home\site\deployments\tools\deploy.cmd in kudu.
I commented out the 2 autogenerated lines of:
:: 1. Restore NuGet packages
:: 2. Build to the temporary path
(commented out all the code underneath them, too)
And then hand-edited the 3rd section to run kudu sync from the DEPLOYMENT_SOURCE instead of the temp file like this:
:: 3. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
IF !ERRORLEVEL! NEQ 0 goto error
)

What is .rds_delta file?

I see a file in the root folder of my Tizen project called .rds_delta that contains what appears to be change commands for something. A Google search reveals nothing. Does anyone know what this file is for and if it should be kept in the Git repository, or should we add this to .gitignore?
.rds_delta file:
#delete
#add
#modify
res/wgt/author-signature.xml
res/wgt/config.xml
res/wgt/signature1.xml
It was a file that inform application installer what is changed in your app between one package build and second one. This is needed to quick application install from SDK.
Some official link: https://developer.tizen.org/development/training/native-application/application-development-process/running-applications
In my opinion it shouldn't be throw into Git repository.

Ant script generate a findbugs_result.xml, but the hudson can not display on main interface. why?

Findbugs script in build.xml:
Findbugs checks Coding...
Findbugs checks Coding...
genetate a findbugs_result.xml.
Download Findbugs plugin for hudson.
Enter findbugs_result.xml path for hudson.
But hudson can not display on main interface. why?
I've found some annoying inconsistencies in the way Hudson stores paths; sometimes you use the overall workspace directory for the Hudson job and other times you have to use the path to the code that the job checks out of source control. For example, if your code gets checked out to MyProject under your workspace directory, and then the test XML files go into MyProject/target/test-reports, try specifying the path with and without the MyProject at the beginning of the path.