Using Perl API to get Step Logs and write to a file
I am trying to get results from a step using the perl api. It appears
to be timing out, as it fails after about 300 seconds.
This is the portion of the Perl code that is failing. It is supposed
to take a build tag and return the results of the build step. It works
for smaller logs, but this one is several thousand lines and it appears
to be timing out.
my $build_id = shift;
my $i=0;
while (defined($builds->{startTime})) {
if($builds->{tag} eq $build_id )
{
my $results = $builds->getResults(); # get results for each
step
# For each step, check to see if it failed.
my $step_num = 0;
while( defined($results->) )
{
if( $results->->{description} =~ 'Build' || $results->
->{description} =~ 'build' )
{
# Open file with name build_tag.txt
my $fname = $builds->{tag}.".txt";
if(! -e $fname)
{
open OUTFILE, "> $fname", or die "Can't open $fname : $!";
my $log = $results->->getLogs(); ####FAILS
Buildforge version is 7.1.2.2-1-0111.
to be timing out, as it fails after about 300 seconds.
This is the portion of the Perl code that is failing. It is supposed
to take a build tag and return the results of the build step. It works
for smaller logs, but this one is several thousand lines and it appears
to be timing out.
my $build_id = shift;
my $i=0;
while (defined($builds->{startTime})) {
if($builds->{tag} eq $build_id )
{
my $results = $builds->getResults(); # get results for each
step
# For each step, check to see if it failed.
my $step_num = 0;
while( defined($results->) )
{
if( $results->->{description} =~ 'Build' || $results->
->{description} =~ 'build' )
{
# Open file with name build_tag.txt
my $fname = $builds->{tag}.".txt";
if(! -e $fname)
{
open OUTFILE, "> $fname", or die "Can't open $fname : $!";
my $log = $results->->getLogs(); ####FAILS
Buildforge version is 7.1.2.2-1-0111.
One answer
I am trying to get results from a step using the perl api. It appears
to be timing out, as it fails after about 300 seconds.
This is the portion of the Perl code that is failing. It is supposed
to take a build tag and return the results of the build step. It works
for smaller logs, but this one is several thousand lines and it appears
to be timing out.
my $build_id = shift;
my $i=0;
while (defined($builds->{startTime})) {
if($builds->{tag} eq $build_id )
{
my $results = $builds->getResults(); # get results for each
step
# For each step, check to see if it failed.
my $step_num = 0;
while( defined($results->) )
{
if( $results->->{description} =~ 'Build' || $results->
->{description} =~ 'build' )
{
# Open file with name build_tag.txt
my $fname = $builds->{tag}.".txt";
if(! -e $fname)
{
open OUTFILE, "> $fname", or die "Can't open $fname : $!";
my $log = $results->->getLogs(); ####FAILS
Buildforge version is 7.1.2.2-1-0111.
Hi Ray,
What does the error message that you get look like?
Brent Ulbricht
RTC Build Lead