Skip to content

Commit

Permalink
Merge Pull Request #13633 from achauphan/Trilinos/skip-package-enables
Browse files Browse the repository at this point in the history
Automatically Merged using Trilinos Pull Request AutoTester
PR Title: b'Framework: Remove generation of packageEnables fragment file for Framework tests'
PR Author: achauphan
  • Loading branch information
trilinos-autotester authored Dec 9, 2024
2 parents ce3cb6f + 49e08eb commit d1330c7
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/AT2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
5 changes: 5 additions & 0 deletions packages/framework/pr_tools/PullRequestLinuxDriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions packages/framework/pr_tools/PullRequestLinuxDriverTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d1330c7

Please sign in to comment.