def main(args): pr_config = None # Banner print("+" + "=" * 78 + "+") print("|") print( "| T R I L I N O S P U L L R E Q U E S T D R I V E R S T A R T" ) print("|") if args.dry_run: print("| D R Y R U N M O D E E N A B L E D") print("|") print("+" + "=" * 78 + "+") print("") if 'standard' == args.test_mode: pr_config = trilinosprhelpers.TrilinosPRConfigurationStandard(args) elif 'installation' == args.test_mode: pr_config = trilinosprhelpers.TrilinosPRConfigurationInstallation(args) else: raise KeyError("ERROR: Unknown test mode, {}, was provided.".format( args.test_mode)) pr_config.prepare_test() status = pr_config.execute_test() print("PullRequestLinuxDriverTest.py main()> Done.") return status
def test_TrilinosPRConfigurationStandardPython3(self): """ Test the Standard Configuration - Change args to enable: - pullrequest_build_name = "Trilinos-pullrequest-python_3" - dry_run = True - Change args to enable dry_run mode. """ args = self.dummy_args() args.pullrequest_build_name = "python-3" pr_config = trilinosprhelpers.TrilinosPRConfigurationStandard(args) # prepare step ret = pr_config.prepare_test() self.assertEqual(ret, 0) self.mock_cpu_count.assert_called() self.assertTrue( Path(os.path.join(args.workspace_dir, "packageEnables.cmake")).is_file()) os.unlink(os.path.join(args.workspace_dir, "packageEnables.cmake")) self.assertTrue( Path( os.path.join(args.workspace_dir, "package_subproject_list.cmake")).is_file()) os.unlink( os.path.join(args.workspace_dir, "package_subproject_list.cmake"))
def test_TrilinosPRConfigurationStandardPython3(self): """ Test the Standard Configuration - Change args to enable: - pullrequest_build_name = "Trilinos_pullrequest_python_3" - dry_run = True - Change args to enable dry_run mode. """ args = self.dummy_args() args.pullrequest_build_name = "Trilinos_pullrequest_python_3" pr_config = trilinosprhelpers.TrilinosPRConfigurationStandard(args) # prepare step ret = pr_config.prepare_test() self.assertEqual(ret, 0) self.mock_cpu_count.assert_called()
def test_TrilinosPRConfigurationStandardDryRun(self): """ Test the Standard Configuration - Change args to enable dry_run mode. """ args = self.dummy_args() args.dry_run = True pr_config = trilinosprhelpers.TrilinosPRConfigurationStandard(args) # prepare step ret = pr_config.prepare_test() self.assertEqual(ret, 0) self.mock_cpu_count.assert_called() # execute step ret = pr_config.execute_test() self.assertEqual(ret, 0)
def test_TrilinosPRConfigurationStandardExec(self): """ Test the Standard Configuration """ print("") args = self.dummy_args() pr_config = trilinosprhelpers.TrilinosPRConfigurationStandard(args) # prepare step ret = pr_config.prepare_test() self.assertEqual(ret, 0) self.mock_cpu_count.assert_called() # execute step ret = pr_config.execute_test() self.mock_chdir.assert_called_once() self.mock_subprocess_check_call.assert_called() self.assertEqual(ret, 0)
def test_TrilinosPRConfigurationStandardExec(self): """ Test the Standard Configuration """ print("") args = self.dummy_args() pr_config = trilinosprhelpers.TrilinosPRConfigurationStandard(args) # prepare step ret = pr_config.prepare_test() self.assertEqual(ret, 0) self.mock_cpu_count.assert_called() # execute step ret = pr_config.execute_test() self.mock_chdir.assert_called_once() self.mock_subprocess_check_call.assert_called() self.assertEqual(ret, 0) self.assertTrue(Path(os.path.join(args.workspace_dir, "generatedPRFragment.cmake")).is_file()) os.unlink(os.path.join(args.workspace_dir, "generatedPRFragment.cmake"))