summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/fetch.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2019-10-21 22:09:54 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-28 05:31:53 +0000
commit3a751d5564fc6ee9aef225653cc7b8630fd25a35 (patch)
treeea8b7ecc3029f8b7658ba28d0d42e89e92d5f1b6 /bitbake/lib/bb/tests/fetch.py
parentd52cb2f01aba670c9fc8c5087484246126de5649 (diff)
downloadpoky-3a751d5564fc6ee9aef225653cc7b8630fd25a35.tar.gz
bitbake: tests/fetch: add test for fetching shallow revs
[YOCTO #13586] (Bitbake rev: f7a973604fbfd1059875ff1fabb3f885df9c5b95) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-rw-r--r--bitbake/lib/bb/tests/fetch.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index a0b656b610..83fad3ff0d 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -1863,6 +1863,26 @@ class GitShallowTest(FetcherTest):
1863 with self.assertRaises(bb.fetch2.FetchError): 1863 with self.assertRaises(bb.fetch2.FetchError):
1864 self.fetch() 1864 self.fetch()
1865 1865
1866 def test_shallow_fetch_missing_revs(self):
1867 self.add_empty_file('a')
1868 self.add_empty_file('b')
1869 fetcher, ud = self.fetch(self.d.getVar('SRC_URI'))
1870 self.git('tag v0.0 master', cwd=self.srcdir)
1871 self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
1872 self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
1873 self.fetch_shallow()
1874
1875 def test_shallow_fetch_missing_revs_fails(self):
1876 self.add_empty_file('a')
1877 self.add_empty_file('b')
1878 fetcher, ud = self.fetch(self.d.getVar('SRC_URI'))
1879 self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
1880 self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
1881
1882 with self.assertRaises(bb.fetch2.FetchError), self.assertLogs("BitBake.Fetcher", level="ERROR") as cm:
1883 self.fetch_shallow()
1884 self.assertIn("Unable to find revision v0.0 even from upstream", cm.output[0])
1885
1866 @skipIfNoNetwork() 1886 @skipIfNoNetwork()
1867 def test_bitbake(self): 1887 def test_bitbake(self):
1868 self.git('remote add --mirror=fetch origin git://github.com/openembedded/bitbake', cwd=self.srcdir) 1888 self.git('remote add --mirror=fetch origin git://github.com/openembedded/bitbake', cwd=self.srcdir)