02-16-2021 06:19 AM - edited 02-16-2021 06:20 AM
02-18-2021 10:16 AM
Thanks Vagn.
I think your logic in the AnalyseFolderProject subsequence will be very helpful.
02-19-2021 07:52 AM
Hello guys,
I allow myself to interfere in your discussion
I would like to be able to do the same thing but in python. Is it possible to call the Analyzer Engine directly?
Thank you in advance for your answers,
Guillaume.
02-19-2021 09:19 AM
Hi Guiforfor
I am not into python but if it is possible to do .NET call within python the answer is yes
02-19-2021 11:17 AM
I was thinking of doing the same as Teststand Engine in python :
Ref = win32com.client.Dispatch("TestStand.Engine")
But for AnalyzerEngine.
I will try your method anyway !
02-22-2021 07:35 AM
I have created powershell script some time ago for automation and it had one function for analyzer. Should still work. New process was started because analyzer sometimes tends to hang forever...
function Run-TSAnalyzer
{
Param
(
[Parameter(Mandatory=$True, Position=1, ValueFromPipeline=$false,
HelpMessage="Path to sequence analyzer project (tsaproj)).")]
[Alias('tsaproj')]
[System.String]
[ValidateScript({Test-Path $_ })]
$projectPath,
[Parameter(Mandatory=$True, Position=2, ValueFromPipeline=$false,
HelpMessage="Path to TS Analyzer exe.")]
[Alias('tas')]
[System.String]
[ValidateScript({Test-Path $_ })]
$analyzerPath,
[Parameter(Mandatory=$True, Position=3, ValueFromPipeline=$false,
HelpMessage="Path to analyzer raw log file")]
[Alias('log')]
[System.String]
$logPath,
[Parameter(Mandatory=$True, Position=3, ValueFromPipeline=$false,
HelpMessage="Path to analyzer junit log file")]
[Alias('junit')]
[System.String]
$junitLogPath,
[Parameter(Mandatory=$True, Position=3, ValueFromPipeline=$false,
HelpMessage="Path to analyzer junit transform file")]
[Alias('transform')]
[System.String]
$junitTransformPath,
[Parameter(Mandatory=$True, Position=5, ValueFromPipeline=$false,
HelpMessage="build timeout in secounds")]
[Alias('t')]
[System.Int32]
$timeoutSec
)
#format analyzer args
$arg = [string]::Format('"{0}" /analyze /report "{1}" /quit',$projectPath,$logPath)
#setup process
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $analyzerPath
$pinfo.RedirectStandardError = $true
$pinfo.RedirectStandardOutput = $true
$pinfo.UseShellExecute = $false
$pinfo.Arguments = $arg
$pinfo.CreateNoWindow = $false
$p = New-Object System.Diagnostics.Process
$p.StartInfo = $pinfo
$p.Start() | Out-Null
$errTask = $p.StandardError.ReadToEndAsync()
$outTask = $p.StandardOutput.ReadToEndAsync()
$done = $p.WaitForExit($timeoutSec*1000)
if ($done -eq $false)
{
$p.Kill()
throw 'TS sequence analyzer exceeded run timeout'
}
else
{
#convert raw ts log to junit log
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load($junitTransformPath)
$xslt.Transform($logPath,$junitLogPath)
if(-2,-1,1 -contains $p.ExitCode) {throw 'TS analyzer failed'}
else {Write-Host 'TS analyzer succeeded'}
}
}
03-16-2021 07:46 AM
Hello guys,
I am sorry to answer you so late.
Thank you for your answers.
I found a solution to what I was looking for:
- I create a workspace with all the files I want to analyze
- I create a project analyzer with this workspace. The project is created thanks to the AnalyzerEngine.
- I analyse the project by calling the SequenceAnalyzer from the command line.
I tried to directly analyze the project thanks to the AnalyzerEngine. But calling the StartAnalysis (with param 0, don't know why) it's crashing in python. In C#, this remains frozen at : "Preparing Analyzis".
I've tried everything but I can't get it to work, anyone have any idea what the problem is?
Thank you for your help !!!