How to customize the available Build Qualities in TFS2010

by Donovan Brown 26. September 2010 04:00

Problem:

The default build qualities provided by TFS2010 do not match our current process for build promotion.

Solution:

Customize the list of available build qualities in TFS2010.

Explanation:

From the Team Explorer window you can right click on the builds folder and select Manage Build Qualities from the context menu.

Tags: ,

Work

Where do I place pre-conditions for test cases in MTM

by Donovan Brown 25. September 2010 02:49

Problem:

I have preconditions for a test case in Microsoft Test Manager (MTM) but I don’t know where to store or how to notify the tester before executing the test.

Solution:

Attach a preconditions document to the first step of your test case or create the preconditions as a shared step.

Explanation:

When creating a Test Case in MTM you can have attachments on each test step in a test case.  One solution to the problem of preconditions is to attach a document that contains the preconditions to the first step of your test case.  Now when the tester begins the test case the first step will be presented with a link to the preconditions document.  From there the tester can simply click the link to open the document and perform the necessary preconditions for the test case.

This same method can be used for any post conditions as well be attaching a document to the final step of the test case.

Another option is to create the preconditions as shared steps and include them as the first step in the test case.

Tags: , ,

Work

How I learned WF 4.0 for Team Build

by Donovan Brown 11. September 2010 21:17

Problem:

I have to customize a TFS2010 Build and I don't know Windows Workflow 4.0.

Solution:

I watched the following video to quickly bring me up to speed on Windows Workflow 4.0 and then I read the workflow of the default build template.

http://msmvps.com/blogs/theproblemsolver/archive/2009/12/08/online-wf4-presentation-recordings.aspx

Tags: , ,

Work

How to change the name of a CodedUI method without Feature Pack 2.

by Donovan Brown 7. September 2010 03:28

 

Problem:

I want to change the name of a method generated by the Coded UI Builder.

Solution:

Modify the UI map and regenerate code.

Explanation:

I would suggest downloading Feature Pack 2. However, if you are not a MSDN subscriber you may not have access to FP2.

When you record using the Coded UI Test Builder or use an Existing Action Recording you may end up with method names you wish you could change.  We have all been taught to never modify a .Designer file because those are generated an may change at any time.  So the key is to update the value in the source of the code generation.

That is the .uitest file.  A .uitest file is an XML representation of the actions taken during the recording.  To change a method name you simply locate the TestStepMarkerAction element with the MarkerInformation attribute with the value of the method you wish to change.  Update the file with the desired method name then save and close the file.  Now we must cause the .Designer file to be regenerated to use the new method names.  From the Solution Explorer right click the .uitest file and select Edit with Coded UI Test Builder.  Once the Coded UI Test Builder opens simply click the Generate Code button and close the builder.  Now the .Designer file will contain the new method names.

 

 

 

Tags: ,

Work

How to override the connection string and target database of a database project

by Donovan Brown 7. September 2010 01:36

Problem:

I need to override the connection string and target database of a database project built with Team Build.

Solution:

Pass the TargetConnectionString and TargetDatabase parameters to team build.

Explanation:

Although Team Build in 2010 is Windows Workflow based at the end of the day MSBuild is still being called to perform the actual build. Project files in Visual Studio are just MSBuild project files.  Not only does this make building Visual Studio projects and solution very easy but it also allows us to pass parameters to our builds.  Any properties set in a project file can be overwritten by passing in parameters to MSBuild.  The parameters we need to override are TargetConnectionString and TargetDatabase.  On the Process Tab of the Team Build 2010 Build Definition wizard you can use the MSBuild Arguments parameter to pass in parameters to MSBuild.  For example I can pass in the following to override the values in the project file,

/p:TargetConnectionString="Data Source=.;Integrated Security=True;Pooling=False" /p:TargetDatabase=MyDatabase

This allows me to keep the project file in version control set to the values used for development and override them for build when I deploy to different environments. 

Tags: , ,

Work

How do I deploy Metadata during my database deploy

by Donovan Brown 6. September 2010 19:43

Problem:

I need to deploy Metadata with my database deploy.

Solution:

Add a script to perform the inserts of the metadata to the post deployment phase of a database deploy.

Explanation:

Metadata is data that must exist in your database for your application to execute.  I took a short cut using the Data Compare feature of Visual Studio to create the metadata script.  I deployed my database project to a new empty database. I then preformed a data compare from a database that had the desired data in it to my empty database and saved the resulting sql file as metadata.sql.  Now we simply need to have this file called during the post deployment phase of a database deploy.  I added the metadata.sql file to the Post-Deployment folder under scripts in my database project.  Then I opened Script.PostDeployment.sql and added the following line
:r .\MetaData.sql

Tags: ,

Work

How to deploy a Database Project with Team Build 2010

by Donovan Brown 6. September 2010 19:17

Problem:

I need to deploy a database project during a Team Build.

Solution:

Edit the dbproj file to include the Deploy target.

Explanation:

  1. Open the solution that contains the desired database project. 
  2. Right click on the database project and select properties. 
  3. Click the Deploy tab and verify the Deploy Action is set to "Create a deployment script (.sql) and deploy to the database, and the Target Database Settings are correct. 
  4. Now we need to update the .dbproj file to include the Deploy target.  From the Solution Explorer right click the database project and select "Unload Project". 
  5. Right click on the database project and select "Edit [database].dbproj" where [database] equals the name of your database project. This will open the .dbproj with an XML editor. 
  6. Update the DefaultTargets attribute of the Project element to "Build;Deploy". 
  7. Save and close the file then right click the database project and select "Reload Project". 
  8. Check in your database project.
  9. Queue your build. Your database will be built and deployed.

Tags: , ,

About the author

My name is Donovan Brown and I am a process consultant for Imaginet with a background in application development.  I also run one of the Nation’s fastest growing online registration sites for motorsports events DLBRacing.com.  When I am not writing software I race cars for fun.  DLBRacing.com has given me the opportunity to combine my two passions writing software and racing cars.

AdSense

Month List

AdSense