All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Urs Fässler" <urs.fassler@bbv.ch>
To: "bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>
Subject: [PATCH 3/7] fetch2/git: add tests to capture existing behavior wrt. naming of git shallow tarball
Date: Mon, 15 Oct 2018 13:43:19 +0000	[thread overview]
Message-ID: <20181015134255.4634-4-urs.fassler@bbv.ch> (raw)
In-Reply-To: <20181015134255.4634-1-urs.fassler@bbv.ch>

The mapping of the URLs to the local shallow tarballs is not obvious. For
easier understanding, we add this tests to explicitly showing the mapping.

Signed-off-by: Urs Fässler <urs.fassler@bbv.ch>
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
---
 lib/bb/tests/fetch.py | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index dcc4d8ce..79be1be0 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -546,6 +546,41 @@ class TarballNamingTest(FetcherTest):
         self.assertIn(self.mirror_tarball, dir)
 
 
+class GitShallowTarballNamingTest(FetcherTest):
+    def setUp(self):
+        super(GitShallowTarballNamingTest, self).setUp()
+        self.recipe_url = "git://git.openembedded.org/bitbake"
+        self.recipe_tarball = "gitshallow_git.openembedded.org.bitbake_82ea737-1_master.tar.gz"
+        self.mirror_url = "git://github.com/openembedded/bitbake.git"
+        self.mirror_tarball = "gitshallow_github.com.openembedded.bitbake.git_82ea737-1_master.tar.gz"
+
+        self.d.setVar('BB_GIT_SHALLOW', '1')
+        self.d.setVar('BB_GENERATE_SHALLOW_TARBALLS', '1')
+        self.d.setVar('SRCREV', '82ea737a0b42a8b53e11c9cde141e9e9c0bd8c40')
+
+    def setup_mirror_rewrite(self):
+        self.d.setVar("PREMIRRORS", self.recipe_url + " " + self.mirror_url + " \n")
+
+    @skipIfNoNetwork()
+    def test_that_the_tarball_is_named_after_recipe_url_when_no_mirroring_is_used(self):
+        fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
+
+        fetcher.download()
+
+        dir = os.listdir(self.dldir)
+        self.assertIn(self.recipe_tarball, dir)
+
+    @skipIfNoNetwork()
+    def test_that_the_mirror_tarball_is_created_when_mirroring_is_used(self):
+        self.setup_mirror_rewrite()
+        fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
+
+        fetcher.download()
+
+        dir = os.listdir(self.dldir)
+        self.assertIn(self.mirror_tarball, dir)
+
+
 class FetcherLocalTest(FetcherTest):
     def setUp(self):
         def touch(fn):
-- 
2.19.1


  parent reply	other threads:[~2018-10-15 15:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 13:43 [PATCH 0/7] Add symlinks for git (shallow) tarballs when name differs due to mirror rewrite rules Urs Fässler
2018-10-15 13:43 ` [PATCH 1/7] fetch2/git: add tests to capture existing behavior wrt. naming of clone directories Urs Fässler
2018-10-15 13:43 ` Urs Fässler [this message]
2018-10-15 13:43 ` [PATCH 2/7] fetch2/git: add tests to capture existing behavior wrt. naming of mirror tarball Urs Fässler
2018-10-15 13:43 ` [PATCH 4/7] fetch2/git: use intention revealing names for premirror tests Urs Fässler
2018-10-15 13:43 ` [PATCH 5/7] fetch2: extract the function which ensures that a valid symlink exists Urs Fässler
2018-10-15 13:43 ` [PATCH 6/7] fetch2: add symlinks for mirror tarballs Urs Fässler
2018-10-15 13:43 ` [PATCH 7/7] fetch2: add symlink for shallow " Urs Fässler
2018-10-16 20:19 ` [PATCH 0/7] Add symlinks for git (shallow) tarballs when name differs due to mirror rewrite rules Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181015134255.4634-4-urs.fassler@bbv.ch \
    --to=urs.fassler@bbv.ch \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.