If so why should we use the architecture of test agent and test controller?
It depends on what tests you are refering to. The build agent can run Unit Tests. However, in order to Run Coded UI Tests, or Web Tests those would be scheduled on a Test Agent.
Only test agents can run tests.
you can have multiple build agents (and one controller) thus you can't do builds in parallel, is it the same for test agents? so you can have more than one test run going at the same time?
Related
I am setting up Test agents as part of build definition and now I want to run automation test case using TCM.exe, How can I pass the Test Environment name as an argument?
In TFS 2013 I did something like this-
start-Process -FilePath "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tcm.exe" -ArgumentList " run /create /title:Nightly Run /planid:1334 /suiteid:123 /configid:123456 /settingsname:Test_xyz_TestSettings /testenvironment:xyzFuntional /collection:http://xyz:8080/tfs/ppp /teamproject:aa /include"
because in 2013 we were setting test controller and test agent as part of lab management and we knew the name of the test environment.
My requirement is to publish automation result in MTM ,any other way is really appreciated .Please note i can not use Test Hub for Test result publishing.
Thanks
Based on your screenshot, you are using the Run functional Test but not TCM.exe.
VStest, MStest and TCM.exe are different tools (Refer to this thread for more info.).
The tests in your scenario supposed to be used to associate test runs with builds and actually using vstest. MTM is displaying test results that are associated with test plans/suites which are somewhat independent of builds.
You can try to use tcm.exe to get what you're after. It's a command line interface to running tests, similar to mstest, but it runs the tests through the infrastructure you set up in MTM. Here's the documentation page: http://msdn.microsoft.com/en-us/library/dd465192.aspx
However, you can also try to follow the steps mentioned in below link to publish the VStest or MStest test results to MTM :
Uploading automated test results to MTM made "easy"
Use TCM to upload the resulting TRX file
Note There is problem with VSTS (formerly VSO) that causes these automated tests to stay in a state of “In Progress”*
Sample TCM command line:
TCM run /publish /suiteid:ID# /configid:CONFIG# /resultowner:"USER" /resultsfile:"C:\DLL\testResults.trx" /collection:"TFS_COLLECTION_URL" /teamproject:"PROJECT_NAME"
UPDATE:
The infrastructure (e.g. Test Environment you mentioned here ) is set in MTM, If you run the test with tcm.exe, generally it will pick up the parameters automatically. But if run test with VSTest or MStest the parameters may need to be defined with Set up environments to run continuous test tasks with your build tasks ...
Whatever, based on your description I think below articles should helps:
Continuous Delivery with VSO: Executing Automated Web Tests with
Microsoft Test Manager
Continuous Delivery with TFS: Running Automated Web Tests with
MTM
I created a build definition that runs automated tests using MTM build environments and test suites. I recently created a Visual Studio Load Test, which can be added to a test suite just like any test method marked with the [TestMethod] attribute. However, when I run the build, I get no errors and it appears the aggregate tests don't run. Is there a way to make this work?
I found this article: https://blogs.msdn.microsoft.com/testingspot/2013/01/22/how-to-automatically-run-a-load-test-as-part-of-a-build/ which describes a way to do it, but I can't find a build template that matches what he describes, and it appears this only allows you to run a single load test.
Also, when you configure a test controller, there is an option to configure it for load testing, but to do this, you must unregister it from the Team Project Collection. If this is done, it appears the controller can no longer be used in an environments to run project automated tests. This defeats the purpose of what I want to do and makes it seem that Load Tests and Team Projects are mutually exclusive. Is this the case? If so, this is a big oversight. Load tests are the kind of thing you would like to run automatically. Thanks for the help.
You are unfortunately right. A test controller used for load testing cannot be used for other automated test execution 'at the same time'. In your scenario I would recommend that you setup a different test controller and agent for load testing and you would be able to queue it as a part of your build to achieve what you are looking for.
There is no special build process template for this case.
We use TeamCity with MsTest to manage and run an automation test suite for front-end testing of a WPF application.
Currently the test suite is running on one dedicated test agent (where TC is installed) and I'm now at a stage where I need to dramatically reduce the overall time it takes to run. I want to do this by adding another test agent to run the tests in parallel.
My test scenarios are large so I have them separated into approx 4 Specflow feature files that run in sequence. All these test scenarios are also categorised by their functional areas.
Firstly:
Is it possible to configure TeamCity to have one test agent managing the sending of tests to be run on each test agent? And then collating all results at the end!
Secondly:
And also keeping the categorised tests together that need to run in sequence?
I decided to use 2 separate project configurations in my TC setup. Each project is pointing at a different test agent using the Agent Requirements step. And I have simply divided up the test categories (that I have setup in my test scenarios anyhow) for each project (half and half).
Pro:
Simple solution and easy to maintain
Con:
Results for each build are separated in TC
I have been using the Build-Deploy-Test build workflow for TFS 2010 (see here http://msdn.microsoft.com/en-us/vstudio/gg131922.aspx) and have come up against a very annoying limitation.
Here is what I have done:
Setup a build to be queued
Configured it to restore to a test-ready snapshot
Added some deployment steps; in this case starting mongo db
I then came to the step where you configure which tests to run and hit an issue. Firstly you need configure a test plan with some test suites; a test suite consisting of test cases. The problem is that each test case can only be associated with a single unit test.
With having to create a test case per unit test, it means that every time a unit test is added a new test case must be created. Is there any way you can associate many unit tests with a test suite that can be ran in the Build-Deploy-Test build workflow.
One way around this problem is to update your test suite using the tcm.exe testcase /import /syncsuite: command. This command has to be run before test execution begins and a logical place to add it would be into the build template.
I suggest you to use Test List Editor in Test Tab on Visual Studio, create your differents lists of tests, organize your tests based on functionnal after that you can execute on your build list of tests by entering name of list.
link : http://msdn.microsoft.com/en-us/library/ms182463(v=vs.100).aspx
For configuring Build Definition, i suggets you to edit & select Automated Test Tab and insert list.
link : http://support.smartbear.com/articles/testcomplete/testcomplete-and-team-build/
I'm new to load testing in Visual Studio/MSTest, and I created a new Load Test recently to validate some high-traffic scenarios for a WCF service. I want to add this to the tests project for the service, but I don't want the test to be executed whenever I "Run All Tests in Solution" nor as part of our Continuous Integration build-verification process because a) it takes 5 minutes to run, and b) the service call that it is testing generates many thousands of email messages. Basically, I'd like to do the equivalent of adding the [Ignore] attribute to a unit test so that the load test is only executed when I explicitly choose to run it.
This MSDN Article ("How to: Disable and Enable Tests") suggests that the only to disable the test is to use Test Lists (.vsmdi files), but I don't have much experience with them, they seem like a hassle to manage, I don't want to have to modify our CI Build Definition, and this blog post says that Test Lists are deprecated in VS2012. Any other ideas?
Edit: I accepted Mauricio's answer, which was to put the load tests into a separate project and maintain separate solutions, one with the load tests and one without. This enables you to run the (faster-running) unit tests during development and also include the (slower-running) load tests during build verification without using test lists.
This should not be an issue for your CI Build Definition. Why?
To run unit tests as part of your build process you need to configure the build definition to point to a test container (usually a .dll file containint your test classes and methods). Load tests do not work this way, they are defined within .loadtest files (which are just xml files) that are consumed by the MSTest engine.
If you do not make any further changes to your CI Build definition the load test will be ignored.
If you want to run the test as part of a build, then you need to configure the build definition to use the .loadtest file.
Stay away from testlists. Like you said, they are being deprecated in VS11.
Edit: The simplest way to avoid running the load test as part of Visual Studio "Run All" tests is to create a different solution for your load tests.
Why don't you want to use Test Lists. I think is the best way to do that. Create different Test Lists for each test type (unit test, load test...) and then in your MSTest command run the Test List(s) you want:
MSTest \testmetadata:testlists.vsmdi \testlist:UnitTests (only UnitTests)
MSTest \testmetadata:testlists.vsmdi \testlist:LoadTests (only LoadTests)
MSTest \testmetadata:testlists.vsmdi \testlist:UnitTests \testlist:LoadTests (UnitTests & LoadTests)