Changeset 27730 for other-projects


Ignore:
Timestamp:
06/28/13 20:21:41 (8 years ago)
Author:
ak19
Message:

More diffing issues detected when diffcol ran over the first Word and PDF tutorial. 1. Two ex.File.* fields differ, one to do with date/timestamp and another with permissions (the latter might be avoidable). These 2 ex.File.* metadata fields have been marked for ignoring. 2. The building generated tmp folders containing randomly named subfolders whose names consisted only of digits, possibly named using timestamps. These differ between builds and needed to be normalised also. One final issue remains, and that is that a ghostscript document, one on which the gs command failed, is converted to html with a different line-lengths or line-wraps on the CentOS in which the model col was generated and the Ubuntu on which the testcol was generated. This results in the entire content section of the doc.xml to be marked different between model and test.

Location:
other-projects/nightly-tasks/diffcol/trunk/diffcol
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nightly-tasks/diffcol/trunk/diffcol/diffcol.pl

    r27725 r27730  
    115115sub IndivTest
    116116{
    117     my ($strModelCol,$strTestCol) = @_;
     117    my ($strModelCol,$strTestCol,$strColName) = @_;
    118118    my @Errors = ();
    119119    my $intNumberOfErrors = 0;
     
    127127            my $strTestFolder = &FileUtils::filenameConcatenate($strTestCol,$strEachFolder);
    128128            $intNumberOfErrors = scalar(@Errors);
    129             push(@Errors,TestEach($strModelFolder,$strTestFolder,0));
     129            push(@Errors,TestEach($strModelFolder,$strTestFolder,0,$strColName));
    130130            $intNumberOfErrors = scalar(@Errors) - $intNumberOfErrors;
    131131            VobPrint("End Comparing \"$strEachFolder\"\n",0);
     
    404404        VobPrint("Detail Testing Start\n",$intLevel);
    405405    }
    406     push(@Errors,TestEach($strModelCol,$strTestCol,$intLevel));
     406    push(@Errors,TestEach($strModelCol,$strTestCol,$intLevel,$strColName));
    407407    $intNumberDiffs = scalar(@Errors) - $intNumberDiffs;
    408408
     
    564564sub TestEach
    565565{
    566     my ($strModel,$strTest,$intLevel) = @_;
     566    my ($strModel,$strTest,$intLevel,$strColName) = @_;
    567567    my @Errors = ();
    568568
     
    593593                if(!($strEachFile eq "log" || $strEachFile eq "earliestDatestamp" || $strEachFile =~ m/\.cfg$/g || $strEachFile =~ m/\.((g|j|l|b)db|idh|i.*|wa|td|tsd|ti|t|tl|w|jpe?g|gif|png)$/g))
    594594                {
    595                     push(@Errors,TestEach($strNewModel,$strNewTest,$intLevel));
     595                    push(@Errors,TestEach($strNewModel,$strNewTest,$intLevel,$strColName));
    596596                }
    597597                else
     
    613613                if(!($strEachFile eq "log" || $strEachFile eq "earliestDatestamp" || $strEachFile =~ m/\.cfg$/g || $strEachFile =~ m/\.((g|j|l|b)db|idh|i.*|wa|td|tsd|ti|t|tl|w|jpe?g|gif|png)$/g))
    614614                {
    615                     push(@Errors,TestEach($strNewModel,$strNewTest,$intLevel));
     615                    push(@Errors,TestEach($strNewModel,$strNewTest,$intLevel,$strColName));
    616616                }
    617617            }
     
    625625    else
    626626    {
    627         my $ignore_line_re = "<Metadata name=\"(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate|ImageSize)\">.*</Metadata>\\s*\\n*";
     627        my $ignore_line_re = "<Metadata name=\"(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate|ex.File.FileModifyDate|ex.File.FilePermissions|ImageSize)\">.*</Metadata>\\s*\\n*";   
     628       
    628629        my $strResult;
    629630
     
    643644        $model_contents =~ s/$ignore_line_re//g;
    644645        $test_contents =~ s/$ignore_line_re//g;
     646
     647        # tmp dirs have subdirs with random numbers in name, remove randomly named subdir portion of path
     648        $model_contents =~ s@(tmp[\\\/])(\d*[\\\/])@$1@g;
     649        $test_contents =~ s@(tmp[\\\/])(\d*[\\\/])@$1@g;
    645650       
     651        # remove all absolute paths upto collect folder from <Metadata /> elements
     652        $model_contents =~ s@(<Metadata name=\"[^\"]*\">(http:\/\/)?).*(collect[\\\/]$strColName)@$1$3@g;
     653        $test_contents =~ s@(<Metadata name=\"[^\"]*\">(http:\/\/)?).*(collect[\\\/]$strColName)@$1$3@g;
     654
     655
    646656            # equalise/normalise the two doc.xml files for OS differences, if there are any
    647657            my $testIsWin = &isDocXMLFileWindows($test_contents);
     
    687697        else
    688698        {
     699#           print STDERR "**** Diff is: $strResult\n"; # print any differences to the screen
     700
    689701            my $strOutput = "Difference Report:\n$strResult\n";
    690702            if ( $strOutputFormat eq "xml" ) {
     
    873885            if ($gv_strMode eq "Individual")
    874886            {
    875                 @ErrorsInEachCol = IndivTest($strModelCol,$strTestCol);
     887                @ErrorsInEachCol = IndivTest($strModelCol,$strTestCol,$strColName);
    876888            }
    877889            #----##
  • other-projects/nightly-tasks/diffcol/trunk/diffcol/gdbdiff.pm

    r27725 r27730  
    6666    # The total_numbytes field can vary depending on how many backslashes exist in the urls in the main body text, as each
    6767    # of these windows slashes get escaped with another backslash, and the resulting string is used as key into rel link db
    68     my $ignore_line_re = "\n<(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate|total_numbytes)>([^\n])*";
     68    my $ignore_line_re = "\n<(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate|ex.File.FileModifyDate|ex.File.FilePermissions|total_numbytes)>([^\n])*";
    6969    $model_text =~ s/$ignore_line_re//g;
    7070    $test_text =~ s/$ignore_line_re//g;
    7171
     72    # tmp dirs have subdirs with random numbers in name, remove subdir
     73    $model_text =~ s@(tmp[\\\/])(\d*[\\\/])@$1@g;
     74    $test_text =~ s@(tmp[\\\/])(\d*[\\\/])@$1@g;
    7275
    7376    # if the OS doesn't match and one of them is windows, extra work needs to be done to bring the db files
Note: See TracChangeset for help on using the changeset viewer.