Hi Mike,
On 23/04/2020 08:53, Mike Kelsey wrote:
Howdy! In Framework PR #3294, I am adding some new functionality to
'exts_list', to allow the 'git_config' dictionary to be used for
downloading
sources for an extension. This modification is in easyblock.py itself,
which makes me just a bit nervous about merging :-)
No need to be nervous about it, it'll be thoroughly reviewed by someone
familiar with the framework.
I've tested it personally to see that it works, but I would really like to
have a proper unit test in place.
Adding a unit test is a strong requirement, we don't merge changes in
framework without having them covered by the unit tests (which goes for
both bug fixes and enhancements/new features).
I read the documentation
(Unit-tests.html) but that seems more aimed at how end-users can _run_ the
unit tests and interpret their results.
Indeed, we don't have clear documentation on how to add a unit test
(that would even be quite difficult to put together, I think, because
there's a lot of "if"s there).
I also reviewed test/framework/easyblock.py, but that's sufficiently long
and complex that I'm not entirely sure where to start breaking, er,
"enhancing" it. Should I write a new test
('test_extensions_download'?) for
this? Should I just add to 'test_extensions_step'?
If I do write a new test, I'm not sure where to "register" it so it gets
executed.
Adding a test is probably most appropriate here. Any method with a name
starting with "test_" will be picked up automatically, no need to
register it.
Whether test/framework/easyblock.py is the right place depends a bit on
what your PR does.
It may be easier to add a test in toy_build.py (which has a toy
application that can be used for performing actual installations,
including ones with extensions).
Is this something the long-time experts would prefer to handle themselves?
It would be great to have you as a contributor tackle this, but this may
be asking a lot, certainly since this is the first time you're diving
into framework.
Let's follow up on this in the PR itself, or if you're up for it, via
the EasyBuild Slack (it's easier to have some back & forth there).
regards,
Kenneth
-- Mike Kelsey