Archive for the ‘VSO’ Category
Automatically update test plan with build number, take 2
A while back I wrote a PowerShell script to automatically update a test plan with the latest build number (http://blogs.msmvps.com/molausson/2014/09/16/automatically-update-test-plan-with-build-number).
This script works well as long as the build server has permission to read and update test plans. But in some environments (such as when running on a hosted build agent in VSO) we need to do an explicit authentication. The solution I’ve choosen is to simply pass in credentials to the script and do an authentication before using the TFS API.
The script now takes two optional parameters if you want to authenticate, username and password, and you can just pass them in from the build definition. You can use ether basic authentication and pass both or use the safer option and pass a Personal Access Token (PAT) in which case you only pass the PAT as the password.
Here’s an example where you go to manage your credentials in Visual Studio Online. First go to your profile:
From the Security tab you can either create a Personal Access Token:
Press Add to create an access token:
Copy the PAT (it cannot be retrieved later):
If you want to use basic authentication go to the Alternate authentication section and fill in the secondary username and password:
With this you are ready to use the script. Download the latest version from here: https://github.com/tfsbuildextensions/CustomActivities/blob/master/Source/Scripts/UpdateTestPlanBuildNumber.ps1
Check in the script to Source control and update a Xaml build definition to use the script. In the following example I’ve used a PAT and only pass the token as the password:
Check out the old post if you want a step-by-step instruction on how to setup the build and test plan.
Visual Studio ALM Videos – ALM Potpurri (SWE)
För ett tag sedan spelade jag och Dag König på Microsoft in en serie filmer om Application Lifecycle Management med Visual Studio 2013 och TFS/Visual Studio Online. Förhoppningsvis finns det både smått och gott i samlingen av klipp som vi spelat in, är det något som saknas eller som du skulle vilja se? Lämna gärna en kommentar här eller på Channel 9.
Hela serien finns nu på Channel 9: https://channel9.msdn.com/Series/ALM-Potpurri
Här är en sammanfattning av innehållet i filmerna:
Ämne | Innehåll |
1. Intro ALM |
Vad står egentligen ALM för? Och vad står det för nuförtiden? Lyssna på Dag och Mathias reflektioner över hur TFS och ALM området utvecklats sedan produkten kom ut 2005, nästan tio år har gått och produkten har naturligtvis vuxit och förändrats på många sätt under åren. |
2. Intro Visual Studio Online |
Med Visual Studio Online har vi tillgång till en hel utvecklingsplattform i molnet. Detta innebär bland annat stöd för planering, versionshantering, byggautomatisering, testning och deployment. Vi kan ha en hel mjukvarufabrik igång med bara några knapptryckningar! I detta avsnitt får du veta mer om hur VSO fungerar och även se hur enkelt det är att signa upp sig och skapa sitt första projekt. |
3. Planering Backlog |
I detta avsnitt går vi igenom hur verktygen i TFS och Visual Studio Online kan användas för att skapa en backlog för produktutvecklingen. Vi tittar på hur man arbetar med hierarkier av uppgifter och går igenom principer för estimering och prioritering. |
4. Kravhantering |
Ärendesystemet i TFS är väldigt flexibelt. Men hur hanterar man egentligen sina krav i verktyget? Vi tar en titt och ser om stödet för produktplanering är rikt nog för att även hantera kravdokumentation. Med de nya funktionerna för texthantering och länkning så kommer nog även de mest omfattande kravspecar hitta ett hem i TFS. |
5. Sprintplanering |
För att ett team skall kunna arbeta effektivt krävs bra samarbete och bra processer. Även verktyg visar sig vara en viktigt komponent för att få till ett snabbt och smidigt arbetssätt. I detta avsnitt tar vi en titt på hur TFS hjälper teamet planera, få en översikt och kontinuerligt följa upp arbetet i en iteration på ett bra sätt. |
6. Team Wiki |
Det har länge saknats en bra lösning för mer informell dokumentation i TFS. Men med stödet för Markdown så kan vi nu skapa en wiki i vårt team projekt där vi lätt kan skapa allt från enkla sidor där vi dokumenterar procedurer till omfattande dokumentation kring utvecklingsprocessen. |
7. Team Explorer |
Mycket av arbetet i TFS sköter man nu i webklienten. Men som utvecklare är det smidigt att kunna hantera utvecklingsnära uppgifter direkt inifrån Visual Studio. I detta avsnitt tar vi en titt på hur Team Explorer funktionen används för att enkelt få åtkomst till funktioner i TFS. |
8. My Work |
Med funktionen My Work i Visual Studio får vi ett smidigt verktyg som förenklar arbetsflödet och gör det lättare att fokusera på en sak i taget. Du ser direkt vilka ärenden som är tilldelade dig och kan med det inbyggda stödet i TFS snabbt växla fokus i koden utan att behöva checka in eller skapa kodbrancher för att isolera arbetet. |
9. Testplanering |
Det är många som missat att TFS har riktigt bra stöd för testning. En av orsakerna har varit att vi tidigare haft en lokal klient för testning men nu har vi merparten av dess funktioner tillgängliga i TFS-webklienten. Vi tar en titt på hur testplanering går till i TFS där vi alltid har fokus på att arbeta nära produktutvecklingen, testningen är tätt kopplad både till planerings-, krav- och utvecklingsverktygen i TFS. |
10. Testkörning TCM |
I detta avsnitt tittar vi på hur TFS kan användas för att köra manuella tester och enkelt skapa buggar om man hittar avvikelser under testandet. Nytt sedan ett tag är att vi har stöd för detta i webklienten vilket gör att det är lätt att använda på alla plattformar och i alla miljöer. |
11. Utforskande test med MTM |
Även om mycket av testfunktionerna i TFS nu finns i webklienten så har vi en del som fortfarande testklienten (Microsoft Test Manager, MTM) gör bäst. I detta avsnitt tar vi en titt på hur vi genomför utforskande tester och skapar buggrapporter med rik datainsamling från systemet under test. |
12. Continuous Delivery |
På senare år har vi blivit allt bättre på våra olika specialiteter i utvecklingsarbetet. Men för att leveranserna skall gå snabbare och behålla god kvalitet är det viktigt att hela leveransprocessen fungerar bra. I detta avsnitt diskuterar vi vad continuous delivery är för något och hur detta synsätt hjälper oss få till fler och bättre releaser. |
13. TFS Build |
Byggsystemet i TFS är en av grundpelarna i produkten och något som varit med i många år. Men under åren har funktionerna ändrats så i detta avsnitt tar vi en titt på hur systemet fungerar idag. Vi visar hur du enkelt sätter upp en automatiserad byggprocess för din produkt (vi tittar till och med på hur du kommer igång med utökningar av den inbyggda processen). Med Visual Studio Online får du dessutom tillgång till en hel byggmiljö i molnet vilket gör att du är igång på bara några minuter. |
14. Intro RM |
För att få till en komplett lösning för continuous delivery behövs en lösning för deployment av systemet. I TFS har vi en produkt, Release Management för Visual Studio, som gör just detta. Och mer, det visar sig att RM inte bara är ett deploymentverktyg utan en komplett releasehanteringslösning som innefattar konfiguration av releaseflöden, deploymentprocesser, konfigurationshantering, behörighet och mer. I detta avsnitt går vi igenom vad RM är och hur du kommer igång med produkten. |
15. RM Deployment |
I detta avsnitt tittar vi på hur vi med Microsoft Release Management definierar en releaseprocess för en webapplikation. Vi kopplar deploymentverktyget till releaser gjorda i TFS build och skapar en releaselösning där alla (med behörighet såklart) kan hjälpa till att göra releaser. |
16. Visualisering av projektstatus |
En stor del av projektarbetet handlar om att hålla ordning på det vi arbetar med; aktiviteter, planer, testresultat, produktkvalitet för att ta några exempel. För att detta arbete inte ska ta onödigt mycket tid från utvecklingsarbetet så kan vi utnyttja funktioner för uppföljning och visualisering i TFS, tex. genom att ställa frågor mot TFS och visa resultatet som diagram på en dashboard. |
17. Testrapporter |
Som testledare (och andra i projektet för den delen med) så är det viktigt med bra stöd för uppföljning av testarbetet. I detta avsnitt tar vi en titt på rapportstödet i TFS som kan användas för att följa upp status på testplaner, utfall från testkörningar och status på buggar funna under testandet. Du får också se hur du kan spara ner testplan och resultatet från testkörningarna i olika format så du kan dela med dig eller spara undan som dokumentation från projektet. |
18. Quick load test |
En ny spännande funktion i Visual Studio Online är Quick Load Tests. Med denna funktion kan du superenkelt skapa ett lasttest som körs mot din applikation och direkt ger återkoppling på hur den beter sig under last. |
19. Load Test |
Om du någon gång provat att göra ett storskaligt lasttest så vet du att det är ett rätt stort projekt. Detta leder till att man inte genomför lasttester eller i alla fall inte så ofta som man skulle vilja (eller borde). Men med Visual Studio Online behöver det inte längre vara ett hinder, i VSO har vi tillgång till en omfattande infrastruktur för lasttestning. Med denna lösning kan vi fokusera på att skriva bra tester och analysera resultat. Infrastrukturen för lastgenerering använder vi sedan i VSO och sparar på så sätt både tid och pengar. |
20. Branchningsstrategier |
Versionshantering är något som vi (förhoppningsvis) tar för givet nuförtiden. Det är sällan ett hinder att checka in och ut filer från Visual Studio utan det bara finns där. Det som däremot kan vara utmanande är att hantera koden på ett sätt som inte skapar konflikter i arbetet och på så sätt drar ner på utvecklingstakten. I detta avsnitt diskuterar vi val av branchningsstrategier och hur rätt val rejält kan förenkla och snabba upp kodhanteringen. |
21. TFVC vs Git |
Hur viktigt är egentligen ett versionshanteringssystem? Och spelar det någon roll vilket man använder? På senare tid har det varit mycket snack om centraliserade kontra distribuerade versionshanteringssystem. I detta avsnitt tittar vi på likheter och skillnader mellan Team Foundation Version Control och Git, som är det två alternativ till versionshantering vi har i TFS idag. |
22. Application Insights |
Vet du hur din applikation fungerar i produktion? Får du tidiga larm om något börjar bete sig ovanligt? Med Application Insights har vi en funktion som låter oss få just denna typ av förståelse för våra system, något vi kan använda för att reagera snabbt på fel, få bättre verktyg för felsökning och inte minst även få insikt i hur våra användare använder systemet. |
23. Feedback |
En liten doldis i TFS plattformen är en spännande funktion för hantering av synpunkter från våra användare. Det är alltid intressant att få in användares åsikter om produkterna vi tar fram men vi är inte alltid bra på att samla in och återkoppla kring den feedback vi fått. Med detta verktyg har vi en klient som låter användare samla in information från tex. en testkörning och direkt skapa feedback ärenden i TFS. |
24. TCM vs MTM |
Arbetar du med testning och undrar när du skall använda Microsoft Test Manager eller test funktionerna i webklienten? I detta avsnitt diskuterar vi likheter och skillnader i verktygen och när det är en fördel att använda det ena över det andra. |
25. Spårbarhet |
En stor styrka i TFS är dess centrala lagringsplats för arbete vi gör under utvecklingsarbetet. Speciellt centralt är ärendesystemet som kan länka ihop saker man tar fram under utveckling och kan synliggöra det på ett bra sätt, exempelvis visa status på ärenden, kopplingar mellan ärenden och testresultat och även kopplingar mellan ärenden och källkod. Allt för att ge oss bättre inblick i hur våra produkter utvecklas över tid. |
Build Status Badge for TFS 2015 and VSO
A while back I wrote a post about how we can create a build bagde in TFS just like some of the other CI server can. It was actually really simple but since it was a custom extension it needed to be deployed outside of TFS, which of course is a bit of a pain.
With TFS 2015 RC and the new build system I’m happy to see there is now a new feature that let’s you get a build badge automatically!
To get a build badge you just need to enable it on the build vNext build definition:
Note how nice the url to the badge is presented:
With this you can easily include the build badge in any web page. I really like the new Markdown support so I would include it in your wiki by simply point to in the badge url:
Save and it renders nicely like this:
So with this my suggestion on Uservoice can be closed.
Presentation från Developer Roadshow (SWE)
Tack alla ni som kom på våra seminarium på Developer Roadshow för några veckor sedan. Totalt på alla orter blev det ca 500 besökare denna gång vilket såklart var väldigt roligt!
Nu finns presentationer från tillställningen klara, bara att ladda ner eller titta:
- Presentation: http://www.slideshare.net/Solidify-Sverige/solidify-continuous-delivery-2014
- Filmer: http://devroad.azurewebsites.net/
Vi har fått förfrågan on kodexempel från seminariet, återkommer snart med mer info om detta.
Build Status Badge for TFS and Visual Studio Online
With the new Markdown support in Visual Studio Online you can easily create a great project Wiki with information relevant to your team. One nice thing to have there is the build status(es), which for instance the AppVeyor build system provides as a small image – a build badge. Here’s how that could look in a Wiki page:
Adding the build badge is done by simply including an image element in the Markdown page:
I really like how easy it is to create mashups of different services to visualize data for the team using Markdown.
As for the build badge I think this is something that would be nice to have included in the product, if you think so too, vote on the following UserVoice suggestion:
But until that eventually happens we can always solve it ourselves. So what is needed to do this? It’s actually really simple, just write a service that looks up the build status and returns an image containing the badge.
In this example I’ve solved it by implementing a standard ASP.NET MVC application. I’ve used a controller that accepts a team project and build definition name as query string arguments:
http://<server>/build/badge?teamProject=<team-project>&buildDefinition=<build-definition>
for example;
http: //s-labtfs.cloudapp.net:9000/build/badge?teamProject=FeaturesInc&buildDefinition=FeaturesInc.CI
This request will return a .png image like this:
Ok, so how did I do this? Let’s look at the code.
To make it easy to generate the badge I’ve created 150×30 px images to draw the image. The Images folder contains a couple of images like the one below, which we’ll then draw the status text on.
The code to generate a badge image is implemented as a MVC controller action. The code below gets the details from the latest build, draws the badge image and finally returns it as an image/png stream as the result:
GetBadgeDetails is a small helper function to give us the data to render on the badge image:
Finally the DrawRoundedRectangle renders the bounding rectangle for the badge:
To get the build data we need a couple of references to TFS:
- Microsoft.TeamFoundation.Build.Client.dll
- Microsoft.TeamFoundation.Client.dll
The code to get the TFS build details is as simple as this:
That’s all. Build and deploy to your favorite IIS server and you’re ready to start serving build badges for your team!
Download the complete sample here.
Use Visual Studio Online + Markdown as your Wiki
With the latest deployment of VSO a bunch of great improvements for content editing was released. Take a look at http://www.visualstudio.com/en-us/news/2014-dec-17-vso for the complete list of additions.
The feature I’m most excited about in this update is the “Quick code editing” tools. With these changes we now have decent in-place editing capabilities in the VSO Web UI. It’s easy to add (new or upload) and edit files.
One thing I’ve been waiting for is the ability to use VSO for my team documentation in a Wiki-style way. Now the enchanced editing tools and the fact that VSO supports Markdown files I can finally do this in a good way. All my content is conveniently stored in version control, which makes authoring (using any tool) very easy. And I’ve got complete tracability as well, something that can be very useful when managing this kind of dynamic content.
Here is a quick walk-through just to show how easy it is to get started.
Add a welcome page
First we need to create a start page. Switch to the Welcome page on the VSO home page. Initially you will get a default page with an instruction on how to get started.
Click the Edit button and you will switch to the Markdown editor for the README.md file. In the example below I’ve added some initial content, including a link to the backlog for the team.
Use the preview tool to check out the layout before saving.
When you are happy with the page, save it and the README.md file will be added at the top-level in your repository.
Add content
Now with the start page in place it’s easy to add more content. If you add links to sub-pages you will get the option to automatically create them just like the welcome page.
Note: it’s a good idea to create a structure for your documents, in this case we’ll add the dev-handbook.md in the docs folder in source control.
Saving the README.md file now gives you a link to a page that doesn’t yet exist.
Click the link and you can add the page the same way as we did for the welcome page. When you have saved the file it also creates the folder structure for you:
Add images
Another nice feature in this VSO deployment is the ability to add files to version control directly from the web UI. This allows us to quickly add additional content, like for instance images, to the page. Select the node to add content to, right-click and select Add Files…
Next you can add new or existing items to that folder, in my case I’ll be adding a logo to our wiki.
I want the image on the welcome page so next I’ll edit the README.md file again and add a Markdown link to the image I’ve just uploaded to the repository.
Save the file and look at how nice the wiki looks with the image inplace.
Using external tools
If you want a richer editing experience then you can use any Markdown tool to author the content. The only big difference is that you need to sync the files in the repository yourself. But if you are a developer then using a TFVC or Git client is nothing new so that shouldn’t be a challenge. In the example below you can see what it looks like editing using MarkdownPad.
Happy editing!
PodCast: Vad kan man göra i Visual Studio Online? (SWE)
Förra veckan hade jag och Joachim Rossberg förmånen att vara med i Dag Königs Podcast-serie. Ämnet? Såklart något ALM-relaterat, denna gång pratade vi om Visual Studio Online (VSO) och vad denna molntjänst erbjuder oss som utvecklar mjukvara. Lyssna in på http://www.buzzfrog.se/index.php/2014/11/dev-cast-88-vad-kan-man-gra-i-visual-studio-online/ så får du höra vad vi kom fram till.