At the end of a build
- we aggregate all relevant information
- we insert this information into an SQL Server table
Viewing the results
To view the results we have created a simple Excel file.
- In Excel we get the latest 100 results from the BuildServer table. Here we have opted to have this query refresh itself every 30 minutes (checkbox when creating the query).
- We've created a pivot graph on this data showing the results of the build.
- To get the pivot graphs automatically refresh when the query is refreshed, we've used a vba script.
In a nutshell, that's about it. Open the Excel file on the computer connected to your LCD and the results get refreshed every 30 minutes.
Scripts
Aggregating and inserting is done with following batchfile.
FOR /F "tokens=3 delims=:" %%A in ('FIND /c "Fatal:" "%Temp%\Build.txt"') DO SET FatalErrors=%%A
FOR /F "tokens=3 delims=:" %%A in ('FIND /c "Error:" "%Temp%\Build.txt"') DO SET Errors=%%A
FOR /F "tokens=3 delims=:" %%A in ('FIND /c "Warning:" "%Temp%\Build.txt"') DO SET Warnings=%%A
FOR /F "tokens=3 delims=:" %%A in ('FIND /c "Hint:" "%Temp%\Build.txt"') DO SET Hints=%%A
FOR /F "tokens=3 delims=:" %%A in ('FIND /c " at " "%Temp%\TestRun.txt"') DO SET TestFailures=%%A
sqlcmd -S<YourServer> -d<YourDatabase> -U<UserName> -P<Password> -Q"INSERT INTO dbo.BuildServer (Initials, CreatedOn, FatalErrors, Errors, Warnings, Hints, TestFailures) VALUES ('%Initialen%', GETDATE(), %FatalErrors%, %Errors%, %Warnings%, %Hints%, %TestFailures%)"
Vba script to refresh all Pivot tables
Private Sub Worksheet_Change(ByVal Target As Range)
Dim pt As PivotTable
Dim ws As Worksheet
For Each ws In Application.Worksheets
For Each pt In ws.PivotTables
pt.RefreshTable
Next pt
Next ws
End Sub