How does Microsoft Test Manager run automated Generic Tests? - testing

I'm using Microsoft Test Manager and I have linked a test case to a generic test in Visual Studio. A lab environment is configured. When I run the test, the test agent only copies the *.generictest file from the build servers drop location. The proper test application (and some config files) are not copied to the test server. Adding the path of the missing files via test settings (advanced -> deployment) doesn't help, because the path depends on the current server build. So a static link is not really useful.
Is there any other possibility to include the appropriate files?

Related

VSTS Build and Selenium

I am attempting to use Selenium to do some UI testing for a .net web app i am working on.
Every build fails with ether no Tests to run in the new configuration or #[warning]DistributedTests: Error : Test run directory 'C:\temp\' does not contain any assemblies that match the specified criteria: '***test*.dll'. Verify that the test run directory contains the target assemblies and the source filter is correct. in the deprecated version.
the test runs correctly when run from Visual Studio
Based on the error message, the test location is wrong, you need to specify the correct test location that contains the test assembly files (the path need to be accessible from test machine you specified).
Check Test Drop Location value if you are using Run Functional Tests task.

VSTS Test Assemblies - No test assemblies found

I'm attempting to run some selenium tests in my solution that are in a project called SA.SEPA.Web.UI.Selenium as part of a build definition in VSTS, but it is failing to run the Visual Studio Test task with the error...
No test assemblies found matching the pattern: **\*Selenium*.dll.
Search folder is set to - $(System.DefaultWorkingDirectory)
Preceding tasks are a nuget restore and build solution
Can anyone help?
You are specifying $(System.DefaultWorkingDirectory) as the search folder. By default (unless overridden), this points to the Source folder on the Agent.
If you are instructing MSBuild (using the OutDir parameter) to output your assemblies in a specific location then you should use that location.
Edit: If this is an On-premises Agent, it should also be running in interactive mode (not service) if you want to execute any UI tests
I ran into this same error but it was a different cause, so I'm adding my solution here.
I was getting the "no test assemblies found" error when trying to run Selenium tests with VSTS as part of a build.
My problem turned out to be that the test assemblies were not checked into change control (git, through VS2017), and therefore were not part of the build. The folders that contain the test assemblies were ignored during my original check-in by default. Once I added those folders to my repository, the build could find the tests and run them.

Unable to get Visual Studio Online to execute my nUnit tests

I have a solution with a number of nUnit tests that do not appear to run on Visual Studio Online servers. Here's what I've done so far:
Created a separate folder (outside of my branch structure) that has nUnit test adapter DLLs
Build controller is configured with a path to custom assemblies to point to nUnit folder that has adapter DLLs
Build's test Source is configured as:
" - Run tests in test sources matching *test*.dll;*test*.appx,Target platform: 'X64'"
Build controller reports during the build
Run optional script after MSBuild
Run optional script before Test
Runner Run VS Test Runner
Run Continuous Deployment
No test results afterwards.
No test results
No code coverage results
What am I doing wrong? Do nUnit tests require special attributes to run properly on VSO? Am I missing any other configuration settings?
I've followed this link when configuring: http://www.visualstudio.com/get-started/hosted-build-controller-vs#supplemental_binaries
Edit:
Test settings expanded as requested
Appreciate any help!
Well, I never setup a TFS build before, let alone an online one, until now (TeamCity fan), so I copied every single property from the screenshots and the only way I could get it to pseudo-"pass" (fully green, with no No test found. Make sure that installed test discoverers & executors warnings under Other Errors and Warnings) is when it didn't find any *test*.dll assemblies to load to begin with, rather than no [Test] methods to execute. Did you check your MSBuild log to make sure your test project assemblies are copied and match the pattern?
_CopyFilesMarkedCopyLocal:
Copying file from "C:\a\src\Alertera-Scheduler\packages\NUnit.2.6.3\lib\nunit.framework.dll" to "C:\a\bin\nunit.framework.dll".
Copying file from "C:\a\src\Alertera-Scheduler\packages\NUnit.2.6.3\lib\nunit.framework.xml" to "C:\a\bin\nunit.framework.xml".
CopyFilesToOutputDirectory:
Copying file from "obj\Debug\Alertera-Scheduler.Tests.dll" to "C:\a\bin\Alertera-Scheduler.Tests.dll".
Alertera-Scheduler.Tests -> C:\a\bin\Alertera-Scheduler.Tests.dll
Copying file from "obj\Debug\Alertera-Scheduler.Tests.pdb" to "C:\a\bin\Alertera-Scheduler.Tests.pdb".
Done Building Project "C:\a\src\Alertera-Scheduler\Alertera-Scheduler.Tests\Alertera-Scheduler.Tests.csproj" (default targets).
Done Building Project "C:\a\src\Alertera-Scheduler\Alertera-Scheduler.sln" (default targets).
Could you expand your Test source settings as well?
If you click Open Drop Folder (Build details in VS) > Diagnostics (tab in VSO) what does it say under Run VS Test Runner?
Run VS Test Runner 00:00:00
There were no matches for the search pattern C:\a\bin\*test2*.dll
There were no matches for the search pattern C:\a\bin\*test*.appx

Build in TFS with multiple project is not taking the correct transformation web config

I have a solution in VS2010 and it has three project, two of these projects have web config file, the projects have web config transformation for each environment (dev, test and prod).
At the process for TFS build option, I have the at the MSBuild Arguments : /p:DeployOnBuild=True
Everything looks good, the drop folder, the zip files and all structure for the final deployment. The issue I am facing the web config for test and prod is not created correctly after the final deployment, I could see at the drop folders the file projectName.SetParameters.xml, it contains the values for development when the build has been QUEUE for Test and Prod. One of the project has the correct web config (test and prod) but the other project has always the dev webconfig.
Is it a bug in the MS Build? What am I missing in the build parameters?
When I create a build deployment package the web config transformation creates the correct web config file, no issues with this process, but I do not want to use build deployment package to deploy my solution.
Any help will be appreciated.
Thank you.
In your Build Definition you probably defined the Configurations to use. Part of that also defines something like Any CPU or x86. As it turns out the solution the Platform "Any CPU" has a space where in the project files the Platform Any CPU does not have a space.
I found the best way to get around this was to leave the Platform blank and only put in the configuration name. VS will pop up a warning letting you know that there is data missing, you can just hit "Yes" to save it anyways. Alternatively you can just type in your configurations like the following |Release,|Debug.
The pattern is [PlatformName]|[ConfigurationName],[PlatformName]|[ConfigurationName],...

TFS 2010 Build Publish via file system

I've got a fairly large MVC2 project in TFS which gets built automatically on checkin (Continuous Integration)
At present, the fully built version is dumped on a network share on our dev IIS server. \\Server\wwwrootLatest
TFS of course creates lots of sub-folders since it's just doing a build, it isn't even aware that it's drop directory is a wwwroot.
This means that to actually USE the build, we need to go and manually create an IIS App which points at the appropriate directory - which defeats the whole object of the exercise.
When we do a manual publish to that server, we use "File System" as the method and just overwrite the files in the UNC share \\Server\wwwroot
(When publishing to other environments, we use full-on MSDeploy.)
What I'd like to do is convince TFS to do a "File system" publish after the build completes and duplicate what we do on a manual publish eg:
Drop directory is \\Server\Build which would result in something like \\Server\Build\Project\Date.Rev\
After that is complete, we want it to publish to \\Server\wwwrootLatest - we can then set up the App once which will always contain the latest version but will still have a full history if required.
The only examples I've been able to find use MSBuild commands in the build definition (fine) but all use MSDeploy to do a full-on publish. I'm not sure how to automate what I want to do
Any help appreciated.
In your drop folder a folder named _PublishedWebsites is generated automatically. It contains files you need to put in wwwroot. You can use CopyDirectory build activity to copy them automatically.