Summary
Description: Phoronix Test Suite open-source benchmarking development
Last Change: Fri 5/17/13 22:52
Recent Commits
>
--git a/pts-core/definitions/test-profile.xml b/pts-core/definitions/test-profile.xml
index 4e597f2..0b8e17b 100644
--- a/pts-core/definitions/test-profile.xml
+++ b/pts-core/definitions/test-profile.xml
@@ -182,7 +182,7 @@ PATH environment variable will contain each of the test directories below this t
<Define>
<Name>P_TEST_ESTIMATEDTIME</Name>
<Value>PhoronixTestSuite/TestProfile/EstimatedLength</Value>
- <Description>The estimated length (in minutes) that it takes this benchmark to run in total.</Description>
+ <Description>The estimated length (in seconds) that it takes this benchmark to run in total.</Description>
<Required>NO</Required>
</Define>
<Define>
diff --git a/pts-core/library/pts-functions_types.php b/pts-core/library/pts-functions_types.php
index 9cb905f..36a19ff 100644
--- a/pts-core/library/pts-functions_types.php
+++ b/pts-core/library/pts-functions_types.php
@@ -435,28 +435,7 @@ function pts_test_needs_updated_install($identifier)
$test_profile = new pts_test_profile($identifier);
// Checks if test needs updating
- return !pts_test_installed($identifier) || !pts_strings::version_strings_comparable($test_profile->get_test_profile_version(), $installed_test->get_installed_version()) || pts_test_checksum_installer($identifier) != $installed_test->get_installed_checksum() || $installed_test->get_installed_system_identifier() != phodevi::system_id_string() || pts_is_assignment("PTS_FORCE_INSTALL");
-}
-function pts_test_checksum_installer($identifier)
-{
- // Calculate installed checksum
- $test_resources_location = pts_tests::test_resources_location($identifier);
- $os_postfix = '_' . strtolower(OPERATING_SYSTEM);
-
- if(is_file($test_resources_location . "install" . $os_postfix . ".sh"))
- {
- $md5_checksum = md5_file($test_resources_location . "install" . $os_postfix . ".sh");
- }
- else if(is_file($test_resources_location . "install.sh"))
- {
- $md5_checksum = md5_file($test_resources_location . "install.sh");
- }
- else
- {
- $md5_checksum = null;
- }
-
- return $md5_checksum;
+ return !pts_test_installed($identifier) || !pts_strings::version_strings_comparable($test_profile->get_test_profile_version(), $installed_test->get_installed_version()) || $test_profile->get_installer_checksum() != $installed_test->get_installed_checksum() || $installed_test->get_installed_system_identifier() != phodevi::system_id_string() || pts_is_assignment("PTS_FORCE_INSTALL");
}
function pts_test_read_xml($identifier, $xml_option)
{
@@ -556,6 +535,7 @@ function pts_estimated_environment_size($identifier)
}
function pts_estimated_run_time($identifier, $return_total_time = true, $return_on_missing = true)
{
+ // TODO: to replace with pts_test_run_manager->get_estimated_run_time() or pts_test_profile->get_estimated_run_time()
// Estimate the time it takes (in seconds) to complete the given test
$estimated_lengths = array();
$estimated_total = 0;
diff --git a/pts-core/library/pts-includes-gui.php b/pts-core/library/pts-includes-gui.php
index dc01039..84a7e7d 100644
--- a/pts-core/library/pts-includes-gui.php
+++ b/pts-core/library/pts-includes-gui.php
@@ -160,6 +160,7 @@ function pts_test_download_files_locally_available($identifier)
foreach(pts_contained_tests($identifier, true, true, false) as $name)
{
$test_object_downloads = pts_test_install_request::read_download_object_list($name);
+ $test_profile = new pts_test_profile($name);
foreach($test_object_downloads as &$download_package)
{
@@ -169,7 +170,7 @@ function pts_test_download_files_locally_available($identifier)
}
}
- if(count($test_object_downloads) == 0 && !pts_is_base_test($name) && pts_test_checksum_installer($name) == null)
+ if(count($test_object_downloads) == 0 && !pts_is_base_test($name) && $test_profile->get_installer_checksum() == null)
{
$xml_parser = new pts_test_tandem_XmlReader($name);
$execute_binary = $xml_parser->getXMLValue(P_TEST_EXECUTABLE);
diff --git a/pts-core/library/pts-includes-run.php b/pts-core/library/pts-includes-run.php
index 11ef7c3..2663bdd 100644
--- a/pts-core/library/pts-includes-run.php
+++ b/pts-core/library/pts-includes-run.php
@@ -185,23 +185,20 @@ function pts_call_test_runs(&$test_run_manager, &$tandem_xml = null)
$loop_end_time = time() + $total_loop_time_seconds;
pts_client::$display->generic_heading("Estimated Run-Time: " . pts_date_time::format_time_string($total_loop_time_seconds, "SECONDS", true, 60));
- pts_set_assignment("EST_TIME_REMAINING", $total_loop_time_seconds);
do
{
for($i = 0; $i < $tests_to_run_count && $test_flag && time() < $loop_end_time; $i++)
{
$test_flag = pts_process_test_run_request($test_run_manager, $tandem_xml, $i);
- pts_set_assignment("EST_TIME_REMAINING", ($loop_end_time - time()));
}
}
while(time() < $loop_end_time && $test_flag);
}
else if(($total_loop_count = pts_client::read_env("TOTAL_LOOP_COUNT")) && is_numeric($total_loop_count))
{
- if(($estimated_length = pts_estimated_run_time($test_run_manager)) > 1)
+ if(($estimated_length = $test_run_manager->get_estimated_run_time()) > 1)
{
- pts_set_assignment("EST_TIME_REMAINING", ($estimated_length * $total_loop_count));
pts_client::$display->generic_heading("Estimated Run-Time: " . pts_date_time::format_time_string(($estimated_length * $total_loop_count), "SECONDS", true, 60));
}
@@ -210,22 +207,19 @@ function pts_call_test_runs(&$test_run_manager, &$tandem_xml = null)
for($i = 0; $i < $tests_to_run_count && $test_flag; $i++)
{
$test_flag = pts_process_test_run_request($test_run_manager, $tandem_xml, $i, ($loop * $tests_to_run_count + $i + 1), ($total_loop_count * $tests_to_run_count));
- pts_set_assignment("EST_TIME_REMAINING", ($test_run_manager->get_estimated_run_time_remaining($i + 1) + ($estimated_length * ($total_loop_count - $loop - 1))));
}
}
}
else
{
- if(($estimated_length = pts_estimated_run_time($test_run_manager)) > 1)
+ if(($estimated_length = $test_run_manager->get_estimated_run_time()) > 1)
{
- pts_set_assignment("EST_TIME_REMAINING", $estimated_length);
pts_client::$display->generic_heading("Estimated Run-Time: " . pts_date_time::format_time_string($estimated_length, "SECONDS", true, 60));
}
for($i = 0; $i < $tests_to_run_count && $test_flag; $i++)
{
$test_flag = pts_process_test_run_request($test_run_manager, $tandem_xml, $i, ($i + 1), $tests_to_run_count);
- pts_set_assignment("EST_TIME_REMAINING", $test_run_manager->get_estimated_run_time_remaining($i + 1));
}
}
diff --git a/pts-core/modules/gui_gtk_events.php b/pts-core/modules/gui_gtk_events.php
index c05159d..16411c2 100644
--- a/pts-core/modules/gui_gtk_events.php
+++ b/pts-core/modules/gui_gtk_events.php
@@ -148,7 +148,7 @@ class gui_gtk_events extends pts_module_interface
if(self::$test_run_count == $test_run_count)
{
$remaining_length = pts_estimated_run_time(self::$tests_remaining_to_run);
- $estimated_length = pts_estimated_run_time($test_result->get_test_profile()->get_identifier());
+ $estimated_length = $test_result->get_test_profile()->get_estimated_run_time();
if($estimated_length > 1)
{
diff --git a/pts-core/modules/phoromatic.php b/pts-core/modules/phoromatic.php
index 91dbc4c..26b7e9f 100644
--- a/pts-core/modules/phoromatic.php
+++ b/pts-core/modules/phoromatic.php
@@ -485,6 +485,8 @@ class phoromatic extends pts_module_interface
return false;
}
+ // TODO: need a way to get the estimated time remaining from the test_run_manager so we can pass that back to the update_system_status parameter so server can read it
+
phoromatic::update_system_status("Running " . $pts_test_result->get_test_profile()->get_identifier() . " For " . pts_read_assignment("PHOROMATIC_TITLE"));
}
public static function __event_user_error($user_error)
@@ -559,9 +561,9 @@ class phoromatic extends pts_module_interface
return self::read_xml_value($server_response, M_PHOROMATIC_GEN_RESPONSE) == M_PHOROMATIC_RESPONSE_TRUE;
}
- protected static function update_system_status($current_task)
+ protected static function update_system_status($current_task, $estimated_time_remaining = 0)
{
- $server_response = phoromatic::upload_to_remote_server(array("r" => "update_system_status", "a" => $current_task, "time" => round(pts_read_assignment("EST_TIME_REMAINING") / 60)));
+ $server_response = phoromatic::upload_to_remote_server(array("r" => "update_system_status", "a" => $current_task, "time" => $estimated_time_remaining));
return self::read_xml_value($server_response, M_PHOROMATIC_GEN_RESPONSE) == M_PHOROMATIC_RESPONSE_TRUE;
}
diff --git a/pts-core/objects/display_modes/pts_concise_display_mode.php b/pts-core/objects/display_modes/pts_concise_display_mode.php
index 6a8b20e..62cafa3 100644
--- a/pts-core/objects/display_modes/pts_concise_display_mode.php
+++ b/pts-core/objects/display_modes/pts_concise_display_mode.php
@@ -284,7 +284,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
array_shift($this->run_process_tests_remaining_to_run);
}
- $estimated_length = pts_estimated_run_time($test_result->get_test_profile()->get_identifier());
+ $estimated_length = $test_result->get_test_profile()->get_estimated_run_time();
if($estimated_length > 1)
{
echo $this->tab . "Estimated Test Run-Time: " . pts_date_time::format_time_string($estimated_length, "SECONDS", true, 60) . "\n";
diff --git a/pts-core/objects/pts_test_profile.php b/pts-core/objects/pts_test_profile.php
index aac4215..4e5dd28 100644
--- a/pts-core/objects/pts_test_profile.php
+++ b/pts-core/objects/pts_test_profile.php
@@ -206,6 +206,24 @@ class pts_test_profile
{
return $this->xml_parser->getXMLValue(P_TEST_MAX_LENGTH);
}
+ public function get_estimated_run_time()
+ {
+ // get estimated run-time (in seconds)
+
+ $installed_test = new pts_installed_test($this->identifier);
+ $this_length = $installed_test->get_average_run_time();
+
+ if(is_numeric($this_length) && $this_length > 0)
+ {
+ $estimated_time = $this_length;
+ }
+ else
+ {
+ $estimated_time = $this->xml_parser->getXMLValue(P_TEST_ESTIMATEDTIME);
+ }
+
+ return $estimated_time;
+ }
public function get_environment_testing_size()
{
return $this->xml_parser->getXMLValue(P_TEST_ENVIRONMENT_TESTING_SIZE, -1);
@@ -277,6 +295,27 @@ class pts_test_profile
return $supported;
}
+ public function get_installer_checksum()
+ {
+ // Calculate installed checksum
+ $test_resources_location = pts_tests::test_resources_location($this->identifier);
+ $os_postfix = '_' . strtolower(OPERATING_SYSTEM);
+
+ if(is_file($test_resources_location . "install" . $os_postfix . ".sh"))
+ {
+ $md5_checksum = md5_file($test_resources_location . "install" . $os_postfix . ".sh");
+ }
+ else if(is_file($test_resources_location . "install.sh"))
+ {
+ $md5_checksum = md5_file($test_resources_location . "install.sh");
+ }
+ else
+ {
+ $md5_checksum = null;
+ }
+
+ return $md5_checksum;
+ }
public function suites_containing_test()
{
$associated_suites = array();
diff --git a/pts-core/objects/pts_test_run_manager.php b/pts-core/objects/pts_test_run_manager.php
index f7c01db..2e8a3f3 100644
--- a/pts-core/objects/pts_test_run_manager.php
+++ b/pts-core/objects/pts_test_run_manager.php
@@ -189,22 +189,26 @@ class pts_test_run_manager
return $identifiers;
}
+ public function get_estimated_run_time()
+ {
+ return $this->get_estimated_run_time_remaining(0);
+ }
public function get_estimated_run_time_remaining($index = 0)
{
- $est_time = 0;
+ $estimated_time = 0;
if(isset($this->tests_to_run[$index]))
{
for($i = $index; $i < count($this->tests_to_run); $i++)
{
- $test_identifier = $this->tests_to_run[$i]->get_identifier(); // is a test_run_request
- $test_time = pts_estimated_run_time($test_identifier, true, false);
+ $identifier = $this->tests_to_run[$i]->get_identifier(); // is a test_run_request
- $est_time += $test_time;
+ $test_profile = new pts_test_profile($identifier);
+ $estimated_time += $test_profile->get_estimated_run_time();
}
}
- return $est_time;
+ return $estimated_time;
}
public function get_test_to_run($index)
{
diff --git a/pts-core/objects/pts_tests.php b/pts-core/objects/pts_tests.php
index c5d9c2c..b332982 100644
--- a/pts-core/objects/pts_tests.php
+++ b/pts-core/objects/pts_tests.php
@@ -275,7 +275,7 @@ class pts_tests
$test_profile = new pts_test_profile($identifier);
$test_version = $is_install ? $test_profile->get_test_profile_version() : $xml_parser->getXMLValue(P_INSTALL_TEST_VERSION);
- $test_checksum = $is_install ? pts_test_checksum_installer($identifier) : $xml_parser->getXMLValue(P_INSTALL_TEST_CHECKSUM);
+ $test_checksum = $is_install ? $test_profile->get_installer_checksum() : $xml_parser->getXMLValue(P_INSTALL_TEST_CHECKSUM);
$sys_identifier = $is_install ? phodevi::system_id_string() : $xml_parser->getXMLValue(P_INSTALL_TEST_SYSIDENTIFY);
$install_time = $is_install ? date("Y-m-d H:i:s") : $xml_parser->getXMLValue(P_INSTALL_TEST_INSTALLTIME);
$install_time_length = $is_install ? $this_duration : $xml_parser->getXMLValue(P_INSTALL_TEST_INSTALLTIME_LENGTH);
<
Copyright © 2013 by Phoronix Media