diff --git a/testing/dav_test b/testing/dav_test index 394ed657..cefea0ac 100755 --- a/testing/dav_test +++ b/testing/dav_test @@ -26,6 +26,7 @@ my $case; my $helpmeplease = 0; my $testmode = 'DAVICAL'; my $save_location = "/var/log/davical"; +my $request_id; # Hash for eval'd Perl code to store long lived variables in my %evaled; @@ -75,7 +76,7 @@ die "You need to run this from the testing directory!\n" unless -d "tests"; # Heuristics to work out if we should make $save_location elsewhere. We want -# /var/log/davical for the CI rig, but within the test directories for localo +# /var/log/davical for the CI rig, but within the test directories for local # runs. Do we? if ($ENV{USER} ne 'testrunner') { $save_location = "tests/$suite/results/"; @@ -84,6 +85,11 @@ if ($ENV{USER} ne 'testrunner') { $save_location = "tests/$suite/results/"; } +# Record the request_ids from the web server. +my $request_id_file = "$save_location/$case.request_id"; +open(my $REQUEST_ID_FILE, "> $request_id_file") + || die "Failed to open $request_id_file for writing"; + my $datafile = $testdef; $datafile =~ s{\.test$}{}; push @arguments, "--header", 'X-DAViCal-Testcase: '.$datafile; @@ -314,9 +320,10 @@ while( ) { } } -if ( ! defined $url && ! defined $script && ! defined $sql_statement ) { +if ( ! defined $url && ! defined $script && ! defined $sql_statement + && ! defined $perl_code ) { print < ) { my $line = $_; + # Grab the web server request_id for later reference + if ($line =~ /^Request-ID: (.*?)$/) { + $ENV{REQUEST_ID} = $1; + $request_id = $1; + print $REQUEST_ID_FILE "$1\n"; + } + foreach my $replacement ( @$replacements ) { $line =~ s/$replacement->{'pattern'}/$replacement->{'replacement'}/; } diff --git a/testing/run_regressions.sh b/testing/run_regressions.sh index c046c722..5e7856c6 100755 --- a/testing/run_regressions.sh +++ b/testing/run_regressions.sh @@ -68,8 +68,13 @@ check_result() { cat "${REGRESSION}/diffs/${TEST}" echo "=======================================" fi - valid_answer=0 + if [ -s "${REGRESSION}/results/${TEST}.request_id" ]; then + echo -e "\nLogging for the request(s) in this test will be in the Apache error log for\nthese request ID(s):\n" + cat "${REGRESSION}/results/${TEST}.request_id" + fi + + valid_answer=0 while [ $valid_answer -eq 0 ]; do if [ "${ACCEPT_ALL}" = "" ] ; then read -p "[${TEST}] Accept new result [e/s/r/v/f/m/x/y/w/N/q/?]? " ACCEPT