mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
bitbake: tests/fetch: add test for fetching shallow revs
[YOCTO #13586] (Bitbake rev: 566a6fe8c217c02f1ba5afc621ae9c3523f35d03) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
2d6a3655e9
commit
0b55d6c27e
@@ -1863,6 +1863,26 @@ class GitShallowTest(FetcherTest):
|
||||
with self.assertRaises(bb.fetch2.FetchError):
|
||||
self.fetch()
|
||||
|
||||
def test_shallow_fetch_missing_revs(self):
|
||||
self.add_empty_file('a')
|
||||
self.add_empty_file('b')
|
||||
fetcher, ud = self.fetch(self.d.getVar('SRC_URI'))
|
||||
self.git('tag v0.0 master', cwd=self.srcdir)
|
||||
self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
|
||||
self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
|
||||
self.fetch_shallow()
|
||||
|
||||
def test_shallow_fetch_missing_revs_fails(self):
|
||||
self.add_empty_file('a')
|
||||
self.add_empty_file('b')
|
||||
fetcher, ud = self.fetch(self.d.getVar('SRC_URI'))
|
||||
self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
|
||||
self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
|
||||
|
||||
with self.assertRaises(bb.fetch2.FetchError), self.assertLogs("BitBake.Fetcher", level="ERROR") as cm:
|
||||
self.fetch_shallow()
|
||||
self.assertIn("Unable to find revision v0.0 even from upstream", cm.output[0])
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def test_bitbake(self):
|
||||
self.git('remote add --mirror=fetch origin git://github.com/openembedded/bitbake', cwd=self.srcdir)
|
||||
|
||||
Reference in New Issue
Block a user