I have created a task group for build pipeline. One of the steps in it is "Publish Build Artifacts" with path to publish as $(Build.ArtifactStagingDirectory) and "Artifact publish location" as "Azure Pipelines/TFS" (the other option being "A file share".
Once my build is successful, I want to "release". I created a new set of task group to first install NUnit Console runner, than Install NUnit3 Test adapter (both powershell scripts).
My next step is to run "Visual Studio Test Platform Installer" after which I want to run all my tests to make sure they are passing. In this step one of the required parameters is "Search Folder".
If I give it the value $(System.DefaultWorkingDirectory), it works fine. But it feels like I should be using a variable that's specific to the build and not system level.
Can someone please clarify what I should be using? Am I thinking right that the system level variable would be too low and I should be using something closer to the build artifacts? when I use Build.ArtifactStagingDirectory, it fails saying it could not find my test dlls.
You can keep use the variable System.DefaultWorkingDirectory, is not "system" scope variable, in each pipeline the value will point to correct artifacts.
More info you can find here.
Related
SUMMARIZE THE PROBLEM:
I'm using Visual Studio 2015 for some project and what I'm trying to do is to run a batch file which is going to open an app(whatever app). The problem is that the VS2015 is going to get stuck in the build process until my app is going to be close.
The batch is working perfectly fine. You could try this just with a batch something like:
start notepad.exe
Or whatever you want, it doesn't really matter what's the application you are going to open here.
WHAT I'VE TRIED:
I've tried already some alternatives like...
Run the bat from the post-build event with "call", "start" or with none of them.
I've added "exit 0" on the end of the file(batch)
Also, I've tried to create 2 batch files. One was the original one and the second one was calling the first one. So I've added the second one at the post-build event. Nothing changes, of course.
WHAT I AM TRYING TO OBTAIN:
On the end, all that I'm trying to obtain is just a batch with is going to open an application after the build/rebuild of the project is done without getting stuck somewhere there.
It's going to stay in this "Build" process even though the build is "Build Succeed"
Unfortunately I believe all processes spun off by the build have to be joined and returned successfully for VS to consider the build a success. Instead, is it possible in your use-case to attach the batch file to the execution step of your project? In the project settings you can modify the command line arguments to spin off your batch file before executing your project executable. Is there any issues with this approach?
I found this too, would this help: Visual Studio post build events stuck waiting for executable to finish before running app in debug mode
I need to create kind of builder for my Universal Windows App (UWP) application, that would load some configuration into it, build it and create app store package. Is there any way to build UWP app from command line, without associating it with the store and using Visual Studio at all?
There is WinAppDeployCmd, but it can be used to install builded appx package on device and I need tool like that to generate that package.
UPDATE
I've managed to build it and create app packages with command line, here is command I used:
msbuild "path to .csproj file" /p:OutDir=output_dir /p:AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM" /p:BuildAppxUploadPackageForUap=true
It's working but not as it should apparently. I can not install generated appx package on my phone (and emulator). I just get error
Failure reason: Failed to start deployment. Failure text: Install failed. Please contact your software vendor. (0x80073cf9)
I found many solutions for Windows 10 PC version, but there is only one solution I found for Windows 10 Mobile and this "solution" is to hard reset the phone, but I do not want to do that. Is there any other way?
And there is one more problem. This command doesn't work with parameter /p:Configuration=Release; and it only builds with Debug configuration, but I believe this is not related to previous error, because it doesn't work with Visual Studio either.
UPDATE
I could not find another solution, so I did the 'hard reset' of my phone and now it is working. It's sad, but I hope the reason is the Windows 10 Mobile OS is still in beta version.
Step 1 : See, you need to install .NET Framework installer from the below link. https://www.microsoft.com/en-us/download/details.aspx?id=30653
Step 2 : Go to C: drive and find where msbuild.exe is. You will find more msbuild. But mostly it will be in the location like C:\Windows\Microsoft.NET\Framework\v4.0.30319.
Step 3: Open the CMD in administrator and point to the location which is mentioned in Step 2.
Step 4 : Paste this. msbuild.exe "YourCompleteProjectPath.sln" /t:rebuild
See this for reference : https://msdn.microsoft.com/en-us/library/ms164311%28v=vs.85%29.aspx
I've got a TeamCity build configuration with two steps currently:
MSBuild
Execute powershell sciprt
I want to add another one:
Run QUnit tests
Inside Visual Studio I use Chutzpah to run my QUnit tests. It seems that there is no "Runner type" appropriate though for QUnit tests, and because I do see one for NUnit I'm left wondering if I'm looking at this right.
Should I get a TeamCity extension to add a "Runner type" for QUnit tests? Should I create a powershell script that runs chutzpah-console? And if so how should I make sure the test output is picked up by TeamCity (do I need the /nunit2 or /junit flag?)?
I've done some research, allow me to share...
I've applied my Google-fu but that leads to a blog post with complicated QUnit tests with special TeamCity messages (or perhaps I misunderstood?) and a blog post on using a command-line build step to call PhantomJS that uses a rather contrived html file that seems like overkill to me if I'm already using Chutzpah in Visual Studio anyways (or perhaps I misunderstood)?
I've gone through the Chutzpah Full Documentation but as far as CI goes it only has a section on TFS Build, nothing on TeamCity or CI in general. I've carefully looked through the command line options documentation, and it does have one relevant option:
/teamcity :Forces TeamCity mode (normally auto-detected)
This suggests that you normally don't need to do anything to get things working, but that's certainly not the case: my sln (or better: csproj) contains several js files with QUnit tests, but TeamCity shows no tests.
So, how do I get TeamCity to run QUnit tests in the (c)leanest way possible / how do I use Chutzpah in a TeamCity build step?
No need for "service messges" or custom html files that go into a special PhantomJS call if you're already using Chutzpah. Here's one (other) way to do it in a (c)lean way.
There is no specific runner type for this type of build step. But no need for a custom Powershell script either: it'll be one line of script only. You can just use a Command Line step to invoke Chutzpah. To be more complete, assuming you've got TeamCity running already on a Windows machine, follow these steps:
Install chutzpah.console.exe. The easiest way is probably using chocolatey to install the Chutzpah package using this command in Powershell:
choco install chutzpah
This installs Chutzpah and makes sure the exe is in your path (you may need to reboot TeamCity parts to get this noticed!).
Note that alternatively you could also manually get chutzpah.console.exe on your CI server somehow (e.g. grab it from your dev machine) and reference it with a full path or place it in your path yourself.
Add a Command Line build step with a custom script like this:
chutzpah.console.exe "MyProject/UnitTestsSubDir"
E.g.:
And by some black magic this is all it takes: your tests will be run (see the build log) and TeamCity will pick up the test results.
I have eclipse and goclipse installed, all is well, I can run a console app in the IDE. It is possible to execute the unit tests in the IDE too?
The latest release of goclipse (0.7.6) does provide a means of doing testing using the "testing" package assuming you have followed the project structure recommended in C:/Go/doc/code.html in the installed file structure created when installing Go.
Using the Eclipse "run external tools" button create a new external tool configuration as follows:
on the Main tab the location is C:/Go/bin/go.exe
the argument is test
the working directory should point to the eclipse workspace folder containing the package that is to be tested (eg ${workspace_loc:/goProject/src/pnp}, where pnp is the name of the package NOT the name of the go file that contains the test).
You can now run the test by pressing the Run button in the usual manner, having given the configuration a sensible name eg: go test pnp. You can now add further tests to the package in different go files (or the same one) and all the tests will be carried out in a manner that is expected.
Yes it is if you make a makefile to do so... If you are asking if goclipse has a built in testing facility like JUnit for java the answer is no though.
The issue 5 was asking to "Integrate 'go test' into the IDE and developer workflow."
It now has just been closed (August 2015), with commit 9c3c858 (next release after 0.11.2), with the following documentation:
Each Go project has 3 built-in Build Targets, which are ways in how the project can be built.
These can be viewed and configured in the Project Explorer:
The modes are:
./... #build: The default build. Builds all Go packages present in the project (excluding test packages).
./... #build-tests: Builds all Go test packages present in the project.
./... #[run-tests]: Builds all and runs Go tests.
Each target can be enabled or disabled when for Eclipse project builds. (There is not much point to have both #build-tests and #[run-tests] enabled though.)
As part of my war on long build times (our C++ solution takes about an hour to build using Incredibuild!) I'm trying to find the build time hotspots.
I've enabled Build Times logging (Tools -> Options -> Projects and Solutions -> VC++ Project Settings -> Build Timing) on my machine and that does what I want (I've then written a script to pull those out for each project and dump them somewhere more useful).
The trouble is I can't make out CI builds do the same thing.
We're using CruiseControl.Net (although I'm in the process of trying to persuade the team to move to TeamCity). The overnight build does not use Incredibuild, so this is ideal for my logging purposes.
CC.Net runs as a service using a dedicated system account.
I've logged into the server and launched Visual Studio using the system account and applied the "Build Timing" setting.
But the builds don't show the Build Time.
so:
(a) Is there anything special about running VS from a service that may have an impact?
(b) Is there anything special about running it from CC.Net (we're using the DevEnv task to build the whole solution - default install location - matches the one I set the option in)?
(c) Is there any other way I can coerce it into logging the build times (other than using MSBuild, which would be a big job right now)?
This might not give the amount of detail you need, but you could add the statistics plugin to the dashboard. It contains a graph of project build duration.