How to use run method of run_random_tests class

Best Phoronix-test-suite code snippet using run_random_tests.run

run_random_tests.php

Source:run_random_tests.php Github

copy

Full Screen

...14 GNU General Public License for more details.15 You should have received a copy of the GNU General Public License16 along with this program. If not, see <http://www.gnu.org/licenses/>.17*/18class run_random_tests implements pts_option_interface19{20 const doc_section = 'Testing';21 const doc_description = 'This option will query OpenBenchmarking.org to run random benchmarks and result comparisons on the system. This test can be used for simply supplying interesting results from your system onto OpenBenchmarking.org, stressing your system with random workloads, seeding new OpenBenchmarking.org results, etc. Basic options are provided at start-up for tuning the randomness of the testing when running this command.';22 public static function run($r)23 {24 pts_client::$display->generic_heading('Random Test Execution');25 $allow_new_tests_to_be_installed = pts_user_io::prompt_bool_input('Allow new tests to be installed', true);26 $allow_new_dependencies_to_be_installed = $allow_new_tests_to_be_installed ? pts_user_io::prompt_bool_input('Allow new test external dependencies to be installed', false) : false;27 $limit_test_subsystem = pts_user_io::prompt_bool_input('Limit tests to a given subsystem', false);28 $limit_test_subsystem = $limit_test_subsystem ? pts_user_io::prompt_text_menu('Select subsystem(s) to test', pts_types::subsystem_targets(), true) : array();29 $upload_to_openbenchmarking = pts_user_io::prompt_bool_input('Auto-upload test results to OpenBenchmarking.org', true);30 while(1)31 {32 $to_test = array();33 if($limit_test_subsystem)34 {35 foreach($limit_test_subsystem as $test_type)36 {37 $tests = pts_openbenchmarking_client::popular_tests(-1, $test_type);38 $to_test = array_merge($to_test, $tests);39 }40 if(empty($to_test))41 {42 pts_client::$display->generic_sub_heading('No tests could be found to run.');43 return false;44 }45 shuffle($to_test);46 $to_test = array_slice($to_test, 0, rand(1, 12));47 }48 else if(rand(1, 6) == 2)49 {50 $ob_ids = pts_openbenchmarking_client::popular_openbenchmarking_results();51 $ob_type = rand(0, 1) == 1 ? 'recent_popular_results' : 'recent_results';52 if(isset($ob_ids[$ob_type]) && !empty($ob_ids[$ob_type]))53 {54 shuffle($ob_ids[$ob_type]);55 $to_test = array(array_pop($ob_ids[$ob_type]));56 }57 }58 if(empty($to_test))59 {60 // Randomly pick some installed tests61 $installed_tests = pts_tests::installed_tests();62 if($installed_tests > 3)63 {64 shuffle($installed_tests);65 $to_test = array_slice($installed_tests, 0, rand(1, 8));66 }67 if(!isset($to_test[2]) && $allow_new_tests_to_be_installed)68 {69 $available_tests = pts_openbenchmarking::available_tests();70 shuffle($available_tests);71 $to_test = array_merge($to_test, array_slice($available_tests, 0, rand(1, 10)));72 }73 }74 if(empty($to_test))75 {76 pts_client::$display->generic_sub_heading('No tests could be found to run.');77 return false;78 }79 echo PHP_EOL;80 pts_client::$display->generic_sub_heading('Tests To Run: ' . implode(', ', $to_test));81 // QUERY FROM OB82 $random_titles = array(83 phodevi::read_property('cpu', 'model') . ' Benchmarks',84 phodevi::read_property('system', 'operating-system') . ' Benchmarks',85 phodevi::read_property('system', 'operating-system') . ' Performance',86 phodevi::read_property('cpu', 'model') . ' Performance',87 phodevi::read_property('cpu', 'model') . ' + ' . phodevi::read_property('gpu', 'model') . ' + ' . phodevi::read_property('motherboard', 'identifier'),88 phodevi::read_property('motherboard', 'identifier') . ' On ' . phodevi::read_property('system', 'operating-system'),89 phodevi::read_property('cpu', 'model') . ' On ' . phodevi::read_property('system', 'operating-system'),90 phodevi::read_property('system', 'kernel') . ' + ' . phodevi::read_property('system', 'operating-system') . ' Tests');91 shuffle($random_titles);92 $title = array_pop($random_titles);93 if($limit_test_subsystem)94 {95 $subsystems_to_test = $limit_test_subsystem;96 $subsystems_to_avoid = array_diff(pts_types::subsystem_targets(), $subsystems_to_test);97 pts_client::pts_set_environment_variable('SKIP_TESTING_SUBSYSTEMS', implode(',', $subsystems_to_avoid));98 }99 if($allow_new_tests_to_be_installed)100 {101 pts_test_installer::standard_install($to_test, false, true, $allow_new_dependencies_to_be_installed);102 }103 $batch_mode_settings = array(104 'UploadResults' => false,105 'SaveResults' => true,106 'PromptForTestDescription' => false,107 'RunAllTestCombinations' => false,108 'PromptSaveName' => false,109 'PromptForTestIdentifier' => false,110 'OpenBrowser' => false111 );112 if($upload_to_openbenchmarking)113 {114 $batch_mode_settings['UploadResults'] = true;115 pts_openbenchmarking_client::override_client_setting('UploadSystemLogsByDefault', true);116 }117 $test_run_manager = new pts_test_run_manager($batch_mode_settings, 2);118 $test_run_manager->set_batch_mode($batch_mode_settings);119 if($test_run_manager->initial_checks($to_test) != false)120 {121 if($test_run_manager->load_tests_to_run($to_test))122 {123 // SETUP124 $test_run_manager->auto_save_results($title, null, 'Various open-source benchmarks by the ' . pts_core::program_title(true) . '.', true);125 $test_run_manager->auto_generate_results_identifier();126 echo PHP_EOL;127 pts_client::$display->generic_sub_heading(pts_client::cli_just_bold('Result File: ') . $test_run_manager->get_file_name());128 pts_client::$display->generic_sub_heading(pts_client::cli_just_bold('Result Identifier: ') . $test_run_manager->get_results_identifier());129 // BENCHMARK130 $test_run_manager->pre_execution_process();131 $test_run_manager->call_test_runs();132 $test_run_manager->post_execution_process();133 pts_results::remove_saved_result_file($test_run_manager->get_file_name());134 }135 }136 echo PHP_EOL;137 sleep(30);138 }139 }140}141?>...

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1$test = new run_random_tests();2$test->run();3$test = new run_random_tests();4$test->run();5$test = new run_random_tests();6$test->run();7$test = new run_random_tests();8$test->run();9$test = new run_random_tests();10$test->run();11$test = new run_random_tests();12$test->run();13$test = new run_random_tests();14$test->run();15$test = new run_random_tests();16$test->run();17$test = new run_random_tests();18$test->run();19$test = new run_random_tests();20$test->run();21$test = new run_random_tests();22$test->run();23$test = new run_random_tests();24$test->run();25$test = new run_random_tests();26$test->run();27$test = new run_random_tests();28$test->run();29$test = new run_random_tests();30$test->run();31$test = new run_random_tests();32$test->run();

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1$run_test = new run_random_tests();2$run_test->run();3$run_test = new run_random_tests();4$run_test->run();5$run_test = new run_random_tests();6$run_test->run();7$run_test = new run_random_tests();8$run_test->run();9$run_test = new run_random_tests();10$run_test->run();11$run_test = new run_random_tests();12$run_test->run();13$run_test = new run_random_tests();14$run_test->run();15$run_test = new run_random_tests();16$run_test->run();17$run_test = new run_random_tests();18$run_test->run();19$run_test = new run_random_tests();20$run_test->run();21$run_test = new run_random_tests();22$run_test->run();23$run_test = new run_random_tests();24$run_test->run();25$run_test = new run_random_tests();26$run_test->run();27$run_test = new run_random_tests();28$run_test->run();29$run_test = new run_random_tests();30$run_test->run();

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1require_once("run_random_tests.php");2$run = new run_random_tests();3$run->run();4require_once("run_random_tests.php");5$run = new run_random_tests();6$run->run();7require_once("run_random_tests.php");8$run = new run_random_tests();9$run->run();10require_once("run_random_tests.php");11$run = new run_random_tests();12$run->run();13require_once("run_random_tests.php");14$run = new run_random_tests();15$run->run();16require_once("run_random_tests.php");17$run = new run_random_tests();18$run->run();19require_once("run_random_tests.php");20$run = new run_random_tests();21$run->run();22require_once("run_random_tests.php");23$run = new run_random_tests();24$run->run();25require_once("run_random_tests.php");26$run = new run_random_tests();27$run->run();28require_once("run_random_tests.php");29$run = new run_random_tests();30$run->run();31require_once("run_random_tests.php");32$run = new run_random_tests();33$run->run();34require_once("run_random_tests.php");

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Phoronix-test-suite automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in run_random_tests

Trigger run code on LambdaTest Cloud Grid

Execute automation tests with run on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful