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

enable --trace by default #4250

Merged
merged 25 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion easybuild/tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX):
'skip_test_cases',
'skip_test_step',
'sticky_bit',
'trace',
'unit_testing_mode',
'upload_test_report',
'update_modules_tool_cache',
Expand All @@ -327,6 +326,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX):
'mpi_tests',
'pre_create_installdir',
'show_progress_bar',
'trace',
],
EMPTY_LIST: [
'accept_eula_for',
Expand Down
2 changes: 1 addition & 1 deletion easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def override_options(self):
'sticky-bit': ("Set sticky bit on newly created directories", None, 'store_true', False),
'sysroot': ("Location root directory of system, prefix for standard paths like /usr/lib and /usr/include",
None, 'store', None),
'trace': ("Provide more information in output to stdout on progress", None, 'store_true', False, 'T'),
'trace': ("Provide more information in output to stdout on progress", None, 'store_true', True, 'T'),
'umask': ("umask to use (e.g. '022'); non-user write permissions on install directories are removed",
None, 'store', None),
'update-modules-tool-cache': ("Update modules tool cache file(s) after generating module file",
Expand Down
212 changes: 123 additions & 89 deletions test/framework/easyblock.py

Large diffs are not rendered by default.

42 changes: 26 additions & 16 deletions test/framework/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ def test_exts_list(self):
self.assertEqual(exts_sources[3]['name'], 'ext-pi')
self.assertEqual(exts_sources[3]['version'], '3.0')

modfile = os.path.join(eb.make_module_step(), 'PI', '3.14' + eb.module_generator.MODULE_FILE_EXTENSION)
with self.mocked_stdout_stderr():
modfile = os.path.join(eb.make_module_step(), 'PI', '3.14' + eb.module_generator.MODULE_FILE_EXTENSION)
modtxt = read_file(modfile)
regex = re.compile('EBEXTSLISTPI.*ext1-1.0,ext2-2.0')
self.assertTrue(regex.search(modtxt), "Pattern '%s' found in: %s" % (regex.pattern, modtxt))
Expand Down Expand Up @@ -560,7 +561,8 @@ def test_extensions_templates(self):
self.prep()
ec = EasyConfig(self.eb_file)
eb = EasyBlock(ec)
eb.fetch_step()
with self.mocked_stdout_stderr():
eb.fetch_step()

# inject OS dependency that can not be fullfilled,
# to check whether OS deps are validated again for each extension (they shouldn't be);
Expand All @@ -569,7 +571,8 @@ def test_extensions_templates(self):
eb.cfg.rawtxt += "\nosdependencies = ['this_os_dep_does_not_exist']"

# run extensions step to install 'toy' extension
eb.extensions_step()
with self.mocked_stdout_stderr():
eb.extensions_step()

# check whether template values were resolved correctly in Extension instances that were created/used
toy_ext = eb.ext_instances[0]
Expand Down Expand Up @@ -1448,9 +1451,10 @@ def test_buildininstalldir(self):
self.prep()
ec = EasyConfig(self.eb_file)
eb = EasyBlock(ec)
eb.post_init()
eb.make_builddir()
eb.make_installdir()
with self.mocked_stdout_stderr():
eb.post_init()
eb.make_builddir()
eb.make_installdir()
self.assertEqual(eb.builddir, eb.installdir)
self.assertTrue(os.path.isdir(eb.builddir))

Expand Down Expand Up @@ -1970,7 +1974,8 @@ def test_external_dependencies(self):
os.environ['PI_PREFIX'] = '/test/prefix/PI'
os.environ['TEST_INC'] = '/test/prefix/test/include'
ec.toolchain.dry_run = True
ec.toolchain.prepare(deps=ec.dependencies(), silent=True)
with self.mocked_stdout_stderr():
ec.toolchain.prepare(deps=ec.dependencies(), silent=True)

self.assertEqual(os.environ.get('EBROOTBAR'), '/foo/bar')
self.assertEqual(os.environ.get('EBROOTFOO'), '/foo/bar')
Expand Down Expand Up @@ -3254,7 +3259,8 @@ def test_template_constant_dict(self):

# also check template values after running check_readiness_step (which runs set_parallel)
eb = EasyBlock(ec)
eb.check_readiness_step()
with self.mocked_stdout_stderr():
eb.check_readiness_step()

st.get_avail_core_count = orig_get_avail_core_count

Expand Down Expand Up @@ -4501,8 +4507,9 @@ def test_recursive_module_unload(self):
self.assertFalse(ec['recursive_module_unload'])
eb = EasyBlock(ec)
eb.builddir = self.test_prefix
eb.prepare_step()
eb.make_module_step()
with self.mocked_stdout_stderr():
eb.prepare_step()
eb.make_module_step()
modtxt = read_file(test_module)
fail_msg = "Pattern '%s' should be found in: %s" % (guarded_load_regex.pattern, modtxt)
self.assertTrue(guarded_load_regex.search(modtxt), fail_msg)
Expand All @@ -4520,8 +4527,9 @@ def test_recursive_module_unload(self):
self.assertTrue(ec_bis['recursive_module_unload'])
eb_bis = EasyBlock(ec_bis)
eb_bis.builddir = self.test_prefix
eb_bis.prepare_step()
eb_bis.make_module_step()
with self.mocked_stdout_stderr():
eb_bis.prepare_step()
eb_bis.make_module_step()
modtxt = read_file(test_module)
fail_msg = "Pattern '%s' should not be found in: %s" % (guarded_load_regex.pattern, modtxt)
self.assertFalse(guarded_load_regex.search(modtxt), fail_msg)
Expand All @@ -4532,8 +4540,9 @@ def test_recursive_module_unload(self):
update_build_option('recursive_mod_unload', True)
eb = EasyBlock(ec)
eb.builddir = self.test_prefix
eb.prepare_step()
eb.make_module_step()
with self.mocked_stdout_stderr():
eb.prepare_step()
eb.make_module_step()
modtxt = read_file(test_module)
fail_msg = "Pattern '%s' should not be found in: %s" % (guarded_load_regex.pattern, modtxt)
self.assertFalse(guarded_load_regex.search(modtxt), fail_msg)
Expand All @@ -4549,8 +4558,9 @@ def test_recursive_module_unload(self):
self.assertEqual(ec_bis['recursive_module_unload'], False)
eb_bis = EasyBlock(ec_bis)
eb_bis.builddir = self.test_prefix
eb_bis.prepare_step()
eb_bis.make_module_step()
with self.mocked_stdout_stderr():
eb_bis.prepare_step()
eb_bis.make_module_step()
modtxt = read_file(test_module)
fail_msg = "Pattern '%s' should be found in: %s" % (guarded_load_regex.pattern, modtxt)
self.assertTrue(guarded_load_regex.search(modtxt), fail_msg)
Expand Down
2 changes: 2 additions & 0 deletions test/framework/easystack.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def test_easystack_restore_env_after_each_build(self):
'--easystack',
test_es_path
]
self.mock_stdout(True)
stdout = self.eb_main(args, do_build=True, raise_error=True)
self.mock_stdout(False)
regex = re.compile(r"WARNING Loaded modules detected: \[.*gompi/2018.*\]\n")
self.assertFalse(regex.search(stdout), "Pattern '%s' should not be found in: %s" % (regex.pattern, stdout))

Expand Down