Nuevas actividades de workflow en Team Foundation Build 11 Beta

Actividades para las construcciones automatizadas… ¡nunca son suficientes! Team Foundation Build 11 Beta viene con 69 actividades de workflow, lo que representa no menos de 28 nuevas con respecto a la versión 2010. De ellas, 14 están pensadas para usarlas en la personalización de nuestras construcciones automatizadas, prácticamente documentadas por completo, y listas para ser utilizadas.

Todas estas actividades están muy bien explicadas en la  documentación disponible en MSDN, pero voy a hacer un pequeño resumen, más que nada para ayudarme a recordarlas Winking smile.

GetCommonLocalPath y GetCommonServerPath

Dada una colección de rutas locales o de servidor, estas actividades devuelven la ruta común de mayor longitud para todas ellas.

IsNotNull<T> y IsNull<T>

Comprueban si una expresión Visual Basic es no nula o nula, respectivamente.

QueryShelvesets

Hace una consulta sobre el servidor de control de versiones, y devuelve una lista de conjuntos de cambios aplazados (shelvesets) que cumplen el criterio dado. El criterio puede definirse mediante el nombre del conjunto de cambios aplazado y el propietario.

RunTests

Esta es quizá una de las actividades más interesantes de las nuevas. Nos permite ejecutar pruebas usando el nuevo Visual Studio Test Runner, que a su vez nos da soporte para el uso de frameworks de pruebas unitarias distintos a (pero incluyendo) MSTest, como NUnit o xUnit. Esta actividad es utilizada en la misma plantilla DefaultTemplate.11.1.xaml para ejecutar las pruebasm si especificamos Visual Studio Test Runner, en el cuadro de diálogo Test Source,  en la pestaña Process de la ventana de definición de la construcción automatizada.

Aquí podemos ver el lugar donde se puede seleccionar el Test runner, que por defecto es Visual Studio Test Runner:

image_thumb6

Y aquí es donde la actividad RunTests es utilizada en la plantilla de construcción automatizada DefaultTemplate.11.1.xaml:

image_thumb1

TfGet, TfResolve, TfShelve, TfUnshelve, TfUndo, y TfWorkfold

Estas actividades son “wrappers” a los correspondientes comandos de tf.exe, que nos proporcionan más formas útiles de interactuar con el servidor de control de versiones desde una construcción automatizada. 

WriteBuildTestError

Escribe un mensaje de error de test en el log de la construcción automatizada, el cual también aparece en la vista de resultados de la construcción automatizada:

image_thumb3

WriteCustomSummaryInformation

Escribe un mensaje en la vista “Build summary” (el resumen de la ejecución de la construcción automatizada). Este mensaje puede incluir hipervínculos, y es posible especificar la sección dentro del “build summary” donde aparecerá el mensaje. El resultado tiene este aspecto:

image_thumb2

New workflow activities in Team Foundation Build 11 Beta

Build activities… you just can’t get enough! Team Foundation Build 11 Beta comes with 69 workflow activities, which represents no less than 28 new ones compared to the 2010 version. From these, 14 of them are intended for use in build customizations, almost fully documented, and ready to be used.

All these activities are nicely explained in the available documentation at MSDN, but I’m going to make a brief summary, mostly for helping myself to remember them Winking smile.

GetCommonLocalPath and GetCommonServerPath

Given a collection or either local or server paths, these activities will return the lowest-level common parent folder of all of them.

IsNotNull<T> and IsNull<T>

Test if a Visual Basic expression is either not null or null.

QueryShelvesets

Queries the version control server and returns a list of shelvesets which met the given criteria. The criteria can be defined using the shelveset name and the owner.

RunTests

This is maybe one of the most interesting activities among the new ones. It allows us to run tests using the new Visual Studio Test Runner, which in turn lets us to use unit testing frameworks other than (but including) MSTest, such as NUnit or xUnit. This activity is used by the DefaultTemplate.11.1.xaml itself to run the tests if we specify the Visual Studio Test Runner, under the Test Source dialog, in the Process tab of the build definition window.

Here we can see the place where we can choose the Test runner, which is Visual Studio Test Runner by default:

image

And here is the place where the RunTests activity is used inside the DefaultTemplate.11.1.xaml build process template:

image

TfGet, TfResolve, TfShelve, TfUnshelve, TfUndo, and TfWorkfold

These activities are wrappers to the corresponding tf.exe commands, giving us more useful ways to interact with the version control server from the build process. 

WriteBuildTestError

Writes a test error message in the build log, which appears also in the build results window:

image

WriteCustomSummaryInformation

Writes a message into the build summary. This message can include hyperlinks, and you can specify the section inside the build summary where the message will appear. The result looks like this:

image