Skip to content

Commit

Permalink
Added a script to analyze logs and included it in the build
Browse files Browse the repository at this point in the history
  • Loading branch information
abnanda1 committed Apr 8, 2013
1 parent 60af948 commit f853acd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions build/AnalyzeLogs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
param([Parameter(Mandatory=$true)][string]$LogPath)

function Get-FileName($line)
{
$index = $_.IndexOf("log:");
return $_.Substring(0, $index) + "log"
}

New-Item $LogPath\LogAnalysis -type directory -force

# UnobservedTask exceptions
gci -recurse $LogPath\*.log | select-string "unobserved" | group Filename | select Name | out-string -width 1000 > $LogPath\LogAnalysis\unobserved_exceptions.log

# ObjectDisposed exceptions
gci -recurse $LogPath\*.log | select-string "disposed" | group Filename | select Name | out-string -width 1000 > $LogPath\LogAnalysis\ode_exceptions.log

# Network errors exceptions
gci -recurse $LogPath\*.log | select-string "unexpected" | group Filename | select Name | out-string -width 1000 > $LogPath\LogAnalysis\unexpected.log

# Connection Forcibly closed Errors
gci -recurse $LogPath\*.log | select-string "An existing connection was forcibly closed" | group Filename | select Name | out-string -width 1000 > $LogPath\LogAnalysis\connection_closed.log
4 changes: 4 additions & 0 deletions build/Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
Condition=" '$(OS)' == 'Windows_NT'"/>
</Target>

<Target Name="AnalyzeLogs" DependsOnTargets="RunFunctionalTests">
<Exec Command='powershell -NoProfile -ExecutionPolicy Bypass $(ProjectRoot)\build\AnalyzeLogs.ps1 "$(TestResultsPath)"' ContinueOnError="true" />
</Target>

<Target Name="RunUnitTests" DependsOnTargets="BuildNetUnitTests">
<MSBuild Projects="%(JsTestProjects.Identity)"
Targets="pipelinePreDeployCopyAllFilesToOneFolder"
Expand Down

0 comments on commit f853acd

Please sign in to comment.