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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 7 additions & 0 deletions packages/framework/pr_tools/PullRequestLinuxDriverTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ 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",
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=")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can lose the Default= if it doesn't have a value.


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 @@ -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 @@ -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,22 @@ 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)

with patch('trilinosprhelpers.TrilinosPRConfigurationBase.create_package_enables_file') as m_call:
pr_config.prepare_test()

expected_call_count = 0
self.assertEqual(m_call.call_count, expected_call_count)


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