Open merelcht opened 9 months ago
Copying some comments to here:
The original starter tests added before any of the tools work was done mocked all the git interactions. Maybe the tools tests should be setup in a different way. We already have e2e tests to test the full flow. I'm thinking maybe these shouldn't be interacting with the full on starter and git interaction but just unit test the inputs.
I agree most of it in principles, the tests that we have currently is slightly duplicate and arguably not a real "unit test". In addition, the tests runs way too slow, because it requires network travel to fetch the actual starters, which is why the original tests mock git and fetch the local one instead. This comes with additional cons because you cannot run the tests without internet (seems violating what unit tests should be).
I expected there will still be some coupling because the post_gen_hook.py
logic is defined in starters
side. I think this is the main problem and there is something that we can do about it.
See this post_gen_hook in spaceflights-pyspark and post_gen_hook in spaceflights-pysparks-viz. They are both executing the exact same main
function, I am pretty sure this is redundant because at this stage the correct starter has already been selected, so for sure viz
and pyspark
are selected if spaceflights-pyspark-viz
is cloned.
If we can unified this logic then maybe we can just keep one single mock_repo in kedro
instead of kedro-starters
, this will likely make development much easier too.
Bonus point: I wonder if the main
logic can moved into kedro
Description
The
test_starters.py
file has grown too much. It contains a huge amount of tests and when adding a new test it's not very clear where it should go. There's also inconsistency in how the test classes are divided. Some test valid and invalid only scenarios others contain a mix.Possible Implementation
This a suggestion of how the
test_starters.py
could be refactored:config.yml
filetest_starters.py
contains test related to the starters flow e.g. parsing of tools and thestarters list
command.conftest.py
This PR shows this break down of the
test_starters.py
tests: https://github.com/kedro-org/kedro/pull/3550Problems
❗ Currently this setup is not working because depending on how the tests are run (individually vs as part of the full test suite) there's an issue with the
.cookiecutter
cache.I've seen this locally several times as well.
Idea on how to fix this
The original starter tests added before any of the tools work was done mocked all the git interactions. Maybe the tools tests should be setup in a different way. We already have e2e tests to test the full flow. I'm thinking maybe these shouldn't be interacting with the full on starter and git interaction but just unit test the inputs.
Possible Alternatives
Move all tests that need starters to the
kedro-starters
repo.