diff --git a/.github/workflows/AT2.yml b/.github/workflows/AT2.yml index c72e311ad456..1409523db6ba 100644 --- a/.github/workflows/AT2.yml +++ b/.github/workflows/AT2.yml @@ -385,7 +385,7 @@ jobs: --ctest-driver /home/runner/_work/Trilinos/Trilinos/cmake/SimpleTesting/cmake/ctest-driver.cmake \ --ctest-drop-site sems-cdash-son.sandia.gov/cdash \ --filename-subprojects ./package_subproject_list.cmake \ - --filename-packageenables ./packageEnables.cmake \ + --skip-create-packageenables \ - name: Summary if: ${{ !cancelled() }} shell: bash -l {0} diff --git a/packages/framework/pr_tools/PullRequestLinuxDriver.sh b/packages/framework/pr_tools/PullRequestLinuxDriver.sh index d491f2dfd7bc..4198a87db296 100755 --- a/packages/framework/pr_tools/PullRequestLinuxDriver.sh +++ b/packages/framework/pr_tools/PullRequestLinuxDriver.sh @@ -274,6 +274,11 @@ then test_cmd_options+=( "--use-explicit-cachefile ") fi +if [[ ${GENCONFIG_BUILD_NAME} == *"framework"* ]] +then + test_cmd_options+=( "--skip-create-packageenables ") +fi + test_cmd="${PYTHON_EXE:?} ${REPO_ROOT:?}/packages/framework/pr_tools/PullRequestLinuxDriverTest.py ${test_cmd_options[@]}" # Call the script to launch the tests diff --git a/packages/framework/pr_tools/PullRequestLinuxDriverTest.py b/packages/framework/pr_tools/PullRequestLinuxDriverTest.py index 9bcefc2c5691..54e0e8bd8731 100755 --- a/packages/framework/pr_tools/PullRequestLinuxDriverTest.py +++ b/packages/framework/pr_tools/PullRequestLinuxDriverTest.py @@ -188,6 +188,14 @@ def parse_args(): default=default_filename_packageenables, help="{} Default={}".format(desc_package_enables, default_filename_packageenables)) + optional.add_argument('--skip-create-packageenables', + dest="skip_create_packageenables", + action="store_true", + default=False, + help="Skip the creation of the packageEnables.cmake fragment file generated by " + \ + "the TriBITS infrastructure indicating which packages are to be enabled based on file " + \ + "changes between a source and target branch. Default=False") + desc_subprojects_file = "The subprojects_file is used by the testing infrastructure. This parameter " + \ "allows the default, generated file, to be overridden. Generally this should " + \ "not be changed from the defaults." diff --git a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py index 3b585ad6eca6..9587b1f5fa97 100644 --- a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py +++ b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py @@ -278,6 +278,13 @@ def arg_filename_packageenables(self): """ return self.args.filename_packageenables + @property + def arg_skip_create_packageenables(self): + """ + This property controls whether the creation of a packageEnables.cmake fragment file + should be skipped. + """ + return self.args.skip_create_packageenables @property def arg_workspace_dir(self): @@ -634,7 +641,6 @@ def create_package_enables_file(self, dryrun=False): job_name = self.arg_pr_jenkins_job_name enable_map_entry = self.get_multi_property_from_config("ENABLE_MAP", job_name, delimeter=" ") - # Generate files using ATDM/TriBiTS Scripts if enable_map_entry is None: cmd = [os.path.join( self.arg_workspace_dir, @@ -745,6 +751,7 @@ def prepare_test(self): self.message("--- arg_ctest_driver = {}".format(self.arg_ctest_driver)) self.message("--- arg_ctest_drop_site = {}".format(self.arg_ctest_drop_site)) self.message("--- arg_ccache_enable = {}".format(self.arg_ccache_enable)) + self.message("--- arg_skip_create_packageenables = {}".format(self.arg_skip_create_packageenables)) self.message("") self.message("--- concurrency_build = {}".format(self.concurrency_build)) self.message("--- concurrency_test = {}".format(self.concurrency_test)) @@ -811,16 +818,22 @@ def prepare_test(self): self.message("| E N V I R O N M E N T S E T U P C O M P L E T E") self.message("+" + "-"*68 + "+") - self.message("+" + "-"*68 + "+") - self.message("| G e n e r a t e `packageEnables.cmake` S T A R T I N G") - self.message("+" + "-"*68 + "+") + if self.arg_skip_create_packageenables: + self.message("+" + "-"*68 + "+") + self.message("| S K I P P I N G `packageEnables.cmake` G E N E R A T I O N") + self.message("+" + "-"*68 + "+") - self.create_package_enables_file(dryrun=self.args.dry_run) + else: + self.message("+" + "-"*68 + "+") + self.message("| G e n e r a t e `packageEnables.cmake` S T A R T I N G") + self.message("+" + "-"*68 + "+") - self.message("+" + "-"*68 + "+") - self.message("| G e n e r a t e `packageEnables.cmake` C O M P L E T E D") - self.message("+" + "-"*68 + "+") - self.message("") + self.create_package_enables_file(dryrun=self.args.dry_run) + + self.message("+" + "-"*68 + "+") + self.message("| G e n e r a t e `packageEnables.cmake` C O M P L E T E D") + self.message("+" + "-"*68 + "+") + self.message("") return 0 diff --git a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py index 1f8038c6eaf5..d585aa7a0fb3 100644 --- a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py +++ b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py @@ -54,6 +54,15 @@ def execute_test(self): if not self.args.dry_run: gc.write_cmake_fragment() + if self.arg_skip_create_packageenables: + print("Optional --skip_create_packageenables found. " + + "Creating dummy packageEnables.cmake and package_subproject_list.cmake " + + "for CTest drivers.") + with open(self.arg_filename_packageenables, 'w'): + pass + with open(self.arg_filename_subprojects, 'w'): + pass + # Execute the call to ctest. verbosity_flag = "-VV" if "BUILD_NUMBER" in os.environ: diff --git a/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationBase.py b/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationBase.py index 0d48f8d5b190..d1772481534a 100755 --- a/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationBase.py +++ b/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationBase.py @@ -225,6 +225,7 @@ def dummy_args(self): ctest_drop_site="testing.sandia.gov", filename_packageenables="../packageEnables.cmake", filename_subprojects="../package_subproject_list.cmake", + skip_create_packageenables=False, mode="standard", req_mem_per_core=3.0, max_cores_allowed=12, @@ -682,6 +683,21 @@ def test_TrilinosPRConfigurationBase_prepare_test(self): self.assertEqual(ret, 0) + def test_TrilinosPRConfigurationBase_prepare_test_skip_create_package_enables_file(self): + """ + Test that the prepare_test method does not call the member function create_package_enables_file + when skip_create_packageenables is True + """ + args = self.dummy_args() + args.skip_create_packageenables = True + pr_config = trilinosprhelpers.TrilinosPRConfigurationBase(args) + + pr_config.create_package_enables_file = Mock() + pr_config.prepare_test() + + pr_config.create_package_enables_file.assert_not_called() + + def test_TrilinosPRConfigurationBase_prepare_test_FAIL(self): """ Test the prepare_test method where it would fail due to diff --git a/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationInstallation.py b/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationInstallation.py index 4eac6b0ceeda..551a57aff301 100755 --- a/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationInstallation.py +++ b/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationInstallation.py @@ -168,6 +168,7 @@ def dummy_args(self): ctest_drop_site="testint.sandia.gov", filename_packageenables="../packageEnables.cmake", filename_subprojects="../package_subproject_list.cmake", + skip_create_packageenables=False, mode="standard", req_mem_per_core=3.0, max_cores_allowed=12, diff --git a/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationStandard.py b/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationStandard.py index 9a722b30cce8..47586711a32d 100755 --- a/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationStandard.py +++ b/packages/framework/pr_tools/trilinosprhelpers/unittests/test_TrilinosPRConfigurationStandard.py @@ -167,6 +167,7 @@ def dummy_args(self): ctest_drop_site="testing.sandia.gov", filename_packageenables="../packageEnables.cmake", filename_subprojects="../package_subproject_list.cmake", + skip_create_packageenables=False, mode="standard", req_mem_per_core=3.0, max_cores_allowed=12, diff --git a/packages/framework/pr_tools/unittests/test_PullRequestLinuxDriverTest.py b/packages/framework/pr_tools/unittests/test_PullRequestLinuxDriverTest.py index c02193f18a28..46cf59176cd8 100755 --- a/packages/framework/pr_tools/unittests/test_PullRequestLinuxDriverTest.py +++ b/packages/framework/pr_tools/unittests/test_PullRequestLinuxDriverTest.py @@ -80,6 +80,7 @@ def setUp(self): workspace_dir='/dev/null/Trilinos_clone', filename_packageenables='../packageEnables.cmake', filename_subprojects='../package_subproject_list.cmake', + skip_create_packageenables=False, test_mode='standard', req_mem_per_core=3.0, max_cores_allowed=12,