Index: openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 16 Feb 2004 16:47:25 -0000 1.28 +++ openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 16 Feb 2004 16:49:21 -0000 1.29 @@ -1015,16 +1015,29 @@ namespace eval aa_test {} -ad_proc -public aa_test::parse_test_server_file { - {-name:required} +ad_proc -public aa_test::xml_report_dir {} { + # TODO: make this a parameter + return "/var/log/openacs-install" +} + +ad_proc -private aa_test::test_file_path { + {-install_file_path:required} +} { + set filename [file tail $install_file_path] + regexp {^(.+)-(.+)-(.+)\.xml$} $filename match hostname server + set test_path [file dirname $install_file_path]/${hostname}-${server}-testreport.xml + + return $test_path +} + +ad_proc -public aa_test::parse_install_file { + {-path:required} {-array:required} } { Processes the xml report outputted from install.sh for display. } { upvar 1 $array service - set path /var/log/openacs/test/$name - set tree [xml_parse -persist [template::util::read_file $path]] set root_node [xml_doc_get_first_node $tree] @@ -1037,7 +1050,7 @@ set service($entry) "n/a" } set service(path) $path - set service(filename) $name + set service(filename) [file tail $path] set service(parse_errors) {} set service(name) [xml_node_get_attribute $root_node "name"] @@ -1068,3 +1081,36 @@ set service(rebuild_cmd) "sh [file join $service(script_path) recreate.sh]" } + +ad_proc -public aa_test::parse_test_file { + {-path:required} + {-array:required} +} { + Processes the xml report with test result data for display. +} { + upvar 1 $array test + + set tree [xml_parse -persist [template::util::read_file $path]] + + set root_node [xml_doc_get_first_node $tree] + + # Get the total test case cound + set testcase_count_node [xml_node_get_children_by_name $root_node testcase_count] + set test(testcase_count) [xml_node_get_content $testcase_count_node] + + # Get the result counts by result type + foreach result_count_node [xml_node_get_children_by_name $root_node result_count] { + set result [xml_node_get_attribute $result_count_node result] + set count [xml_node_get_content $result_count_node] + set result_count($result) $count + } + set test(result_count) [array get result_count] + + # Get counts for failing test cases + foreach testcase_failure_node [xml_node_get_children_by_name $root_node testcase_failure] { + set testcase_id [xml_node_get_attribute $testcase_failure_node testcase_id] + set count [xml_node_get_content $testcase_failure_node] + set testcase_failure($testcase_id) $count + } + set test(testcase_failure) [array get testcase_failure] +} Index: openacs-4/packages/acs-automated-testing/www/admin/install/report.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/www/admin/install/Attic/report.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-automated-testing/www/admin/install/report.tcl 12 Feb 2004 12:59:47 -0000 1.1 +++ openacs-4/packages/acs-automated-testing/www/admin/install/report.tcl 16 Feb 2004 16:49:21 -0000 1.2 @@ -6,11 +6,19 @@ set context [list] multirow create servers path url name install_date error_total_count parse_errors -foreach file [glob /var/log/openacs-install/*.xml] { - parse_test_server_file -name [file tail $file] -array service +foreach path [glob [aa_test::xml_report_dir]/*-installreport.xml] { + aa_test::parse_install_file -path $path -array service + + set test_path [aa_test::test_file_path -install_file_path $path] + if { [file exists $test_path] } { + aa_test::parse_test_file -path $test_path -array test + array set testcase_failure $test(testcase_failure) + set service(num_errors) [llength [array names testcase_failure]] + } + multirow append servers \ $service(path) \ - "server?[export_vars { { name "$service(filename)" } }]" \ + [export_vars -base server { path }] \ $service(name) \ $service(install_end_timestamp) \ $service(num_errors) \ Index: openacs-4/packages/acs-automated-testing/www/admin/install/server.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/www/admin/install/Attic/server.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-automated-testing/www/admin/install/server.adp 12 Feb 2004 12:59:47 -0000 1.1 +++ openacs-4/packages/acs-automated-testing/www/admin/install/server.adp 16 Feb 2004 16:49:21 -0000 1.2 @@ -36,6 +36,32 @@ +

Test failures

+ + + none + + + + + + + + + + + + + +
Test caseFailure count
@testcase_failures.testcase_id@@testcase_failures.count@
+
+
+ +

+ Unknown. Server has no test report file at $test_path. +

+
+

Rebuild