[bitbake-devel] [PATCH] fetch/git: Change to use clearer ssh url syntax for broken servers

Olof Johansson olof.johansson at axis.com
Fri Jan 15 16:18:53 UTC 2016


On 16-01-15 15:04 +0000, Richard Purdie wrote:
> I have also double checked this and I agree, the bitbucket servers do
> now seem to work as you'd expect.
> 
> I swear I had problems originally but I can't figure out what those
> were so I will revert the patch.

Thanks!

> My point about improving the selftests if there are url formats you
> depend upon stands though.

While I'm happy to contribute such a change, I'm not fond of the
structure of the bitbake tests. They are a lot of times system
tests that require access to remote servers etc.

And in this case, the manipulation happens in the git fetcher,
and it has no unit tests at all (not including indirect system
testing). E.g., the following trivial patch to the URLHandle
tests would not catch this issue:

  --- a/bitbake/lib/bb/tests/fetch.py
  +++ b/bitbake/lib/bb/tests/fetch.py
  @@ -644,7 +644,8 @@ class URLHandle(unittest.TestCase):
  ...
  -       "git://git.openembedded.org/bitbake;branch=@foo" : ('git', 'git.openembedded.org', '/bitbake', '', '', {'branch': '@foo'})
  +       "git://git.openembedded.org/bitbake;branch=@foo" : ('git', 'git.openembedded.org', '/bitbake', '', '', {'branch': '@foo'}),
  +       "git://git.example.org:1234/bitbake" : ('git', 'git.example.org:1234', '/bitbake', '', '', {}),
  ...

I did try to add unittests for the git fetcher at one point, but
the patches were rejected because I made changes to the git
fetcher itself, in order to simplify testing. In this case, the
behavior is isolated to _get_repo_url, which is side effect free,
so again, I'm happy to try adding tests for this particular case.

Could also mention that the bb.fetch2.URI class' unittest suite
does have tests for various variations, including port numbers,
and it was designed to be side-effect free in order to make unit
testing simple. Adapting this would give some testing for free.


Anyways, I'll hopefully have a patch ready for review early next
week. Have a nice weekend :)

-- 
olofjn



More information about the bitbake-devel mailing list