Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framework: Remove generation of packageEnables fragment file for Framework tests #13633

Merged
2 changes: 1 addition & 1 deletion .github/workflows/AT2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,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 @@ -270,6 +270,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 @@ -196,6 +196,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 @@ -267,6 +267,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 @@ -501,7 +508,7 @@ def pullrequest_build_name(self):
elif self.arg_dashboard_build_name != "__UNKNOWN__":
output = self.arg_dashboard_build_name
else:
output = self.arg_pr_genconfig_job_name
output = self.arg_pr_genconfig_job_name
return output


Expand Down Expand Up @@ -623,7 +630,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 @@ -734,6 +740,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 @@ -799,16 +806,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 @@ -697,6 +698,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
Loading