Calendar

<<  mars 2010  >>
lumamejevesadi
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

(juin 5, 2009 08:58)

As I explained some time ago, I was writing an article about Continuous Integration in the Microsoft.NET world for the (french-speaking) website http://www.developpez.com/.

The article has been phased as follows :

First Part (published on March 4th - available online here) - 43 pagesSecond Part (published on June 5th - available online here) - 62 pages
  • Quick introduction to continuous integration
    • Why do we want Continuous Integration
    • What is Continuous Integration
    • What do we call BVTs
  • Quick presentation of the tools needed for Continuous Integration (in the Microsoft.NET world)
    • MsTest
    • Static Code Analysis
    • MsBuild
    • TfsBuild
  • Unit Test : Writing unit tests with MsTest
    • Structure of a test class
    • Checking the correctness of a test
    • Testing the non public API
  • Unit Test : Executing tests with MsTest
    • Via Visual Studio 
    • Thru Command line
  • Unit Test : Configuring tests
    • Test Runs naming
    • Code Coverage
    • Deploying files
    • TimeOut
  • Unit Test : Managing the tests
    • Via the "Test View"
    • Via the "Test Editor"
  • Unit Test : Additional attributes
    • Behavioral attributes
    • Informational attributes
  • Static Code Analysis : Presentation
    • Activate the analysis
    • Running the analysis
    • Explication of the rule naming
    • Parameterizing the analysis
  • Static Code Analysis : Correcting the errors
    • Correcting one error
    • Correcting several errors
    • Grouping the rules suppression in a global file
  • Static Code Analysis : Limitations
  • Quick introdution to MsBuild
  • First steps with MsBuild - Writing a basic project file
    • Its structure
    • What is a task ? a target ?
    • Creating and executing a project file
  • Going further with MsBuild
    • Ensure the project file is valid
    • Properties and PropertyGroup
      • How to statically & dynamically create them ? To use them ?
      • Order of declaration
      • Updating the value
      • Delaying the creation of a PropertyGroup
    • Items and ItemGroup
      • Same detail as for Properties
    • Executing a project file in command line
      • Choosing the target to execute
      • Overriding properties
      • Playing with verbosity
    • Using .NET 3.5 tasks
    • Playing with Targets
      • Control the execution order
      • Explicit call of a target : 3 techniques and their differences
      • Passing input and output parameters to a target
  • Refactor a project file
    • .targets files
    • Importing files from Source Control
  • Create your own tasks
    • A simple one, with inputs (mandatory or not), with outputs
    • Raising errors
    • Debugging your task
  • Quick introduction to Team Foundation Server
  • TFS & Continuous Integration
    • Create, edit and execute a build
    • Parameter a build
    • Which target can you override ?
  • Managing TFS
    • Destroying, Undoing and listing files
    • Presentation of TFS Power Tools
  • Tips & Tricks

To read this article, just go to http://dotnet.developpez.com/ or directly to my webpage on this site : http://pedautreppe.developpez.com/.

Note that these article are available only in french for now, but do not hesitate to leave comments here if you think the content is interesting and that it could be interesting that I translate it.

(mars 4, 2009 10:01)

 I have been a long time without publishing anything on this blog.

The reason was simple, I was simply preparing a 80 pages article about Continuous Integration in the Microsoft.NET world for the (french-speaking) website http://www.developpez.com. This article is now almost finished and will be phased as following :

  • First Part (being published today - available online here)
    • Quick introduction to continuous integration
      • Why do we want Continuous Integration
      • What is Continuous Integration
      • What do we call BVTs
    • Quick presentation of the tools needed for Continuous Integration (in the Microsoft.NET world)
      • MsTest
      • Static Code Analysis
      • MsBuild
      • TfsBuild
    • Unit Test : Writing unit tests with MsTest
      • Structure of a test class
      • Checking the correctness of a test
      • Testing the non public API
    • Unit Test : Executing tests with MsTest
      • Via Visual Studio 
      • Thru Command line
    • Unit Test : Configuring tests
      • Test Runs naming
      • Code Coverage
      • Deploying files
      • TimeOut
    • Unit Test : Managing the tests
      • Via the "Test View"
      • Via the "Test Editor"
    • Unit Test : Additional attributes
      • Behavioral attributes
      • Informational attributes
    • Static Code Analysis : Presentation
      • Activate the analysis
      • Running the analysis
      • Explication of the rule naming
      • Parameterizing the analysis
    • Static Code Analysis : Correcting the errors
      • Correcting one error
      • Correcting several errors
      • Grouping the rules suppression in a global file
    • Static Code Analysis : Limitations
  • Second Part (will be published probably in a month)
    • Deep presentation of MsBuild
      • Basic description
      • What are the tasks, targets, properties, items
      • How to create some custom tasks
    • Deep presentation of TfsBuild
      • Presentation of a build file
      • Which event can we use in a build file 

Of course I gave here only a very short subtract of the agenda of the second part : I will detail it only when the article will be published.

To read this article, just go to http://dotnet.developpez.com or directly to my webpage on this site : http://pedautreppe.developpez.com.

Note that this article is available only in french for now, but do not hesitate to leave comments here if you think the content is interesting and that it could be interesting that I translate it.

(avril 7, 2008 08:00)

You may have noticed that the logging is different between TFS 2005 and TFS 2008. Indeed they have changed the verbosity level of the logging : it was normal for TFS 2005 and it is now diagnostic by default.

How can we control it to reset it to normal?

Simply by changing the value of some parameters that are sent to MSBuild. For that, you can simply edit the "TFSBuild.rsp" file that has been generated with your "TFSBuild.proj" file. See one example below :

# This is a response file for MSBuild

# Add custom MSBuild command line options in this file

 

# We can control here the "verbosity" level of the logging. The possible values are :

#     quiet

#     minimal

#     normal

#     detailed

#     diagnostic

/fileloggerparameters:Verbosity=minimal

How can you know the possible switch you can set here and their values ? Simply check the MSBuild help. You can also refer to the blog of Aaron Hallberg and his post about verbosity.

(mars 18, 2008 09:00)

It was possible under Visual Source Safe, but not under TFS 2005.

It has been added in TFS 2008. How to use it ?

tf destroy itemspec

tf destroy $/MyTeamproject/MyItemToDestroy

(mars 10, 2008 08:43)

Few days ago, I was needing to be able to retrieve some informations about the builds we had launched. I was so needing to work with the TFS API.

To do this, you must have Visual Studio and a Team Explorer installed.

  1. Create a new application (a console application for example)
  2. Add a reference to the DLLs
    1. Microsoft.TeamFoundation.Build.Client
    2. Microsoft.TeamFoundation.Build.Common
    3. Microsoft.TeamFoundation.Client
    4. Microsoft.TeamFoundation.Common
You can find these DLLs in the folder "Program Files\Microsoft Visual Studio X.X\Common7\IDE\Private Assemblies
And after you can very simply interrogate the TFS API as for example :

string tfsUrl = "http://YourTFS:8080";

string teamProject = "Your Team Project Name";

string teamBuildType = "The name of your team build";

 

//Connect to the Team Foundation Server using the credentials

//of the currently logged person

TeamFoundationServer server = TeamFoundationServerFactory.GetServer(tfsUrl);

//Access the build service

BuildStore buildStore = server.GetService(typeof(BuildStore)) as BuildStore;

//and get the list of builds

BuildData[] buildDatas = buildStore.GetListOfBuilds(teamProject, teamBuildType);

 

//Iterate on all your builds

foreach ( BuildData buildData in buildDatas )

{

   PlatformFlavorData[] platforms = buildStore.GetPlatformFlavorsForBuild(buildData.BuildUri);

 

   // Iterate, for a specific build,

   // on all the build platform and flavor you have defined

   foreach ( var platformFlavor in platforms )

   {

      TestResultData[] testResults = buildStore.GetTestResultsForBuild(buildData.BuildUri, platformFlavor.PlatformName, platformFlavor.FlavorName);

 

      foreach ( TestResultData testResultData in testResults )

      {

         /* Here for each build platform and flavor

         * you are iterating on the test results

         */

      }

   }

}

Quite easy no ?

Juste one things to know : this code will work, whatever the version of your Visual Studio and TFS. But all the class you use here are deprecated under TFS 2008 (but will still work).

So how to do the same thing using the new TFS 2008's classes ? To be seen in a future post ! ;-)

Powered by BlogEngine.NET 1.2.0.0 | Theme by Pierre-Emmanuel Dautreppe