Skip to contentSkip to conversation

support/testing: add github download helper testing

PATCH In review Romain Naour 2 participants 3 messages Nov 28, 2021 – Dec 6, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 support/testing: add github download helper testing

Back in 2013, a github download helper has been introduced to cope with changes in github download-URL's [1][2].

Since then a testing infrastructure has been introduced in Buildroot but no tests has been added to check if the github download helper is still working.

It was reported recently [3] that the github helper doesn't work anymore using tags. Buildroot is not the only project having the issue, see Github feedback discussions [4].

Add tests for direct archive download (archives uploaded by maintainers), download from a git tag and git hash using the github helper. Make sure that Buildroot doesn't use BR2_BACKUP_SITE
(http://sources.buildroot.net).

[1] https://bugs.busybox.net/show_bug.cgi?id=6302
[2] c7c7d0697c00e45bcfad15b027f5c66005f4c005
[3] https://bugs.busybox.net/show_bug.cgi?id=14396
[4] https://github.com/github/feedback/discussions/8149

---
Currently the github-helper-tag test is failing due to [1].

---
 .../download/br2-external/github/Config.in    |  0
 .../br2-external/github/external.desc         |  1 +
 .../download/br2-external/github/external.mk  |  1 +
 .../github-helper-hash.hash                   |  3 ++
 .../github-helper-hash/github-helper-hash.mk  | 11 +++++
 .../github-helper-tag/github-helper-tag.hash  |  3 ++
 .../github-helper-tag/github-helper-tag.mk    | 11 +++++
 .../github-release/github-release.hash        |  3 ++
 .../package/github-release/github-release.mk  | 12 ++++++
 .../testing/tests/download/test_gitforge.py   | 41 +++++++++++++++++++
 10 files changed, 86 insertions(+)
 create mode 100644 support/testing/tests/download/br2-external/github/Config.in
 create mode 100644 support/testing/tests/download/br2-external/github/external.desc
 create mode 100644 support/testing/tests/download/br2-external/github/external.mk
 create mode 100644 support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.hash
 create mode 100644 support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk
 create mode 100644 support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.hash
 create mode 100644 support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.mk
 create mode 100644 support/testing/tests/download/br2-external/github/package/github-release/github-release.hash
 create mode 100644 support/testing/tests/download/br2-external/github/package/github-release/github-release.mk
 create mode 100644 support/testing/tests/download/test_gitforge.py
support/testing/tests/download/br2-external/github/Config.in new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
support/testing/tests/download/br2-external/github/external.desc new file +1 -0
new file mode 100644
index 0000000000..b8beea8839
@@ -0,0 +1 @@
+name: GITHUB
support/testing/tests/download/br2-external/github/external.mk new file +1 -0
new file mode 100644
index 0000000000..e4e5524ceb
@@ -0,0 +1 @@
+include $(sort $(wildcard $(BR2_EXTERNAL_GITHUB_PATH)/package/*/*.mk))
support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.hash new file +3 -0
new file mode 100644
index 0000000000..a941060b31
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  4064739881453831bceeae81af8947cbd6c1fe03e052ac17b82ae5b3360d83f8  github-helper-hash-e2fba6457bd9d9c720540332eaf0c1f8c29eab00.tar.gz
+sha256  9755181e27175cb3510b4da8629caa406fb355a19aa8e7d55f06bf8ab33323c4  COPYING
support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk new file +11 -0
new file mode 100644
index 0000000000..e1fa5aabc2
@@ -0,0 +1,11 @@
+################################################################################
+#
+# github-helper-hash
+#
+################################################################################
+
+GITHUB_HELPER_HASH_VERSION = e2fba6457bd9d9c720540332eaf0c1f8c29eab00
+GITHUB_HELPER_HASH_SITE = $(call github,buildroot,buildroot,$(GITHUB_HELPER_HASH_VERSION))
+GITHUB_HELPER_HASH_LICENSE_FILES = COPYING
+
+$(eval $(generic-package))
support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.hash new file +3 -0
new file mode 100644
index 0000000000..466d2ac401
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  959a953bbd91e6ed6db8d63a45a986400878b6bb486455231b2976218301c3d2  github-helper-tag-2021.02.tar.gz
+sha256  9755181e27175cb3510b4da8629caa406fb355a19aa8e7d55f06bf8ab33323c4  COPYING
support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.mk new file +11 -0
new file mode 100644
index 0000000000..b1ff66d817
@@ -0,0 +1,11 @@
+################################################################################
+#
+# github-helper-tag
+#
+################################################################################
+
+GITHUB_HELPER_TAG_VERSION = 2021.02
+GITHUB_HELPER_TAG_SITE = $(call github,buildroot,buildroot,$(GITHUB_HELPER_TAG_VERSION))
+GITHUB_HELPER_TAG_LICENSE_FILES = COPYING
+
+$(eval $(generic-package))
support/testing/tests/download/br2-external/github/package/github-release/github-release.hash new file +3 -0
new file mode 100644
index 0000000000..78a25dd271
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  f4cb17b21928e36ec27de5c5294dea6ec1de4acd7ee6c56d6ecc75319cbcaefa  systemd-bootchart-233.tar.xz
+sha256  dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  LICENSE.LGPL2.1
support/testing/tests/download/br2-external/github/package/github-release/github-release.mk new file +12 -0
new file mode 100644
index 0000000000..34409e1cad
@@ -0,0 +1,12 @@
+################################################################################
+#
+# github-release
+#
+################################################################################
+
+GITHUB_RELEASE_VERSION = 233
+GITHUB_RELEASE_SITE = https://github.com/systemd/systemd-bootchart/releases/download/v$(GITHUB_RELEASE_VERSION)
+GITHUB_RELEASE_SOURCE = systemd-bootchart-$(GITHUB_RELEASE_VERSION).tar.xz
+GITHUB_RELEASE_LICENSE_FILES = LICENSE.LGPL2.1
+
+$(eval $(generic-package))
support/testing/tests/download/test_gitforge.py new file +41 -0

41 lines not on this page · raw message

Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 support/testing: add gitlab download helper testing

Like for the github helper, add some tests to test the download of Gitlab's generated tarball.

[1] f83826c90daf9cdb5a6196d2d2830eea8c2f0e09

Cc Thomas Petazzoni <[email protected]>
Cc Yann E. MORIN <[email protected]>
---
 .../tests/download/br2-external/gitlab/Config.in     |  0
 .../tests/download/br2-external/gitlab/external.desc |  1 +
 .../tests/download/br2-external/gitlab/external.mk   |  1 +
 .../gitlab-helper-hash/gitlab-helper-hash.hash       |  3 +++
 .../package/gitlab-helper-hash/gitlab-helper-hash.mk | 12 ++++++++++++
 .../package/gitlab-helper-tag/gitlab-helper-tag.hash |  3 +++
 .../package/gitlab-helper-tag/gitlab-helper-tag.mk   | 11 +++++++++++
 .../package/gitlab-release/gitlab-release.hash       |  3 +++
 .../gitlab/package/gitlab-release/gitlab-release.mk  | 12 ++++++++++++
 support/testing/tests/download/test_gitforge.py      |  8 ++++++++
 10 files changed, 54 insertions(+)
 create mode 100644 support/testing/tests/download/br2-external/gitlab/Config.in
 create mode 100644 support/testing/tests/download/br2-external/gitlab/external.desc
 create mode 100644 support/testing/tests/download/br2-external/gitlab/external.mk
 create mode 100644 support/testing/tests/download/br2-external/gitlab/package/gitlab-helper-hash/gitlab-helper-hash.hash
 create mode 100644 support/testing/tests/download/br2-external/gitlab/package/gitlab-helper-hash/gitlab-helper-hash.mk
 create mode 100644 support/testing/tests/download/br2-external/gitlab/package/gitlab-helper-tag/gitlab-helper-tag.hash
 create mode 100644 support/testing/tests/download/br2-external/gitlab/package/gitlab-helper-tag/gitlab-helper-tag.mk
 create mode 100644 support/testing/tests/download/br2-external/gitlab/package/gitlab-release/gitlab-release.hash
 create mode 100644 support/testing/tests/download/br2-external/gitlab/package/gitlab-release/gitlab-release.mk
support/testing/tests/download/br2-external/gitlab/Config.in new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
support/testing/tests/download/br2-external/gitlab/external.desc new file +1 -0
new file mode 100644
index 0000000000..eafc8a43ff
@@ -0,0 +1 @@
+name: GITLAB
support/testing/tests/download/br2-external/gitlab/external.mk new file +1 -0
new file mode 100644
index 0000000000..8de1203231
@@ -0,0 +1 @@
+include $(sort $(wildcard $(BR2_EXTERNAL_GITLAB_PATH)/package/*/*.mk))
support/testing/tests/download/br2-external/gitlab/package/gitlab-helper-hash/gitlab-helper-hash.hash new file +3 -0
new file mode 100644
index 0000000000..79684e9742
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  28f3b63454a7de6d8fb154dfa1e2e203afeb34db006661329e273137f8fe3dce  gitlab-helper-hash-21a378a7858460809ffef1c96a07a493d709730c.tar.gz
+sha256  309875d925041d909bc705473d6c4b7905272aea15c1c2389088c26c161bae1f  license.txt
support/testing/tests/download/br2-external/gitlab/package/gitlab-helper-hash/gitlab-helper-hash.mk new file +12 -0
new file mode 100644
index 0000000000..44a156118e
@@ -0,0 +1,12 @@
+################################################################################
+#
+# gitlab-helper-hash
+#
+################################################################################
+
+GITLAB_HELPER_HASH_VERSION = 21a378a7858460809ffef1c96a07a493d709730c
+GITLAB_HELPER_HASH_SITE = $(call gitlab,solarus-games,solarus,$(GITLAB_HELPER_HASH_VERSION))
+
+GITLAB_HELPER_HASH_LICENSE_FILES = license.txt
+
+$(eval $(generic-package))
support/testing/tests/download/br2-external/gitlab/package/gitlab-helper-tag/gitlab-helper-tag.hash new file +3 -0
new file mode 100644
index 0000000000..1c50bc3c8f
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  ef08b22999431b7f81f9b74408221b8a5a3ab5b0f646a835443a3c37cb2fb979  gitlab-helper-tag-1.6.5.tar.gz
+sha256  309875d925041d909bc705473d6c4b7905272aea15c1c2389088c26c161bae1f  license.txt
support/testing/tests/download/br2-external/gitlab/package/gitlab-helper-tag/gitlab-helper-tag.mk new file +11 -0
new file mode 100644
index 0000000000..fb2fc49c82
@@ -0,0 +1,11 @@
+################################################################################
+#
+# gitlab-helper-tag
+#
+################################################################################
+
+GITLAB_HELPER_TAG_VERSION = 1.6.5
+GITLAB_HELPER_TAG_SITE = $(call gitlab,solarus-games,solarus,v$(GITLAB_HELPER_TAG_VERSION))
+GITLAB_HELPER_TAG_LICENSE_FILES = license.txt
+
+$(eval $(generic-package))
support/testing/tests/download/br2-external/gitlab/package/gitlab-release/gitlab-release.hash new file +3 -0
new file mode 100644
index 0000000000..7031d1b34a
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 12b88efa4d0d95af08db05a50b3dcb217c0eb2bfc67b483779e33d498ddb2f95  iucode-tool_2.3.1.tar.xz
+sha256 ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  COPYING
support/testing/tests/download/br2-external/gitlab/package/gitlab-release/gitlab-release.mk new file +12 -0
new file mode 100644
index 0000000000..2510ac634b
@@ -0,0 +1,12 @@
+################################################################################
+#
+# gitlab-release
+#
+################################################################################
+
+GITLAB_RELEASE_VERSION = 2.3.1
+GITLAB_RELEASE_SITE = https://gitlab.com/iucode-tool/releases/raw/master
+GITLAB_RELEASE_SOURCE = iucode-tool_$(GITLAB_RELEASE_VERSION).tar.xz
+GITLAB_RELEASE_LICENSE_FILES = COPYING
+
+$(eval $(generic-package))
support/testing/tests/download/test_gitforge.py +8 -0
index c2d98d0853..e1ac35ec67 100644
@@ -39,3 +39,11 @@ class TestGitHub(GitforgeTestBase):
         self.check_download("github-helper-hash")
         self.check_download("github-release")
 
+
+class TestGitLab(GitforgeTestBase):
+    br2_external = [infra.filepath("tests/download/br2-external/gitlab")]
+
+    def test_run(self):
+        self.check_download("gitlab-helper-hash")
+        self.check_download("gitlab-helper-tag")
+        self.check_download("gitlab-release")
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Romain Naour
Quoted 16 lines · Romain Naour

Back in 2013, a github download helper has been introduced to cope with changes in github download-URL's [1][2].

Since then a testing infrastructure has been introduced in Buildroot but no tests has been added to check if the github download helper is still working.

It was reported recently [3] that the github helper doesn't work anymore using tags. Buildroot is not the only project having the issue, see Github feedback discussions [4].

Add tests for direct archive download (archives uploaded by maintainers), download from a git tag and git hash using the github helper. Make sure that Buildroot doesn't use BR2_BACKUP_SITE
(http://sources.buildroot.net).

Quoted 7 lines

[1] https://bugs.busybox.net/show_bug.cgi?id=6302
[2] c7c7d0697c00e45bcfad15b027f5c66005f4c005
[3] https://bugs.busybox.net/show_bug.cgi?id=14396
[4] https://github.com/github/feedback/discussions/8149

Series applied to master, thanks.

support/testing/tests/download/br2-external/github/Config.in

Quoted 28 lines

---
Currently the github-helper-tag test is failing due to [1].

---
  .../download/br2-external/github/Config.in    |  0
  .../br2-external/github/external.desc         |  1 +
  .../download/br2-external/github/external.mk  |  1 +
  .../github-helper-hash.hash                   |  3 ++
  .../github-helper-hash/github-helper-hash.mk  | 11 +++++
  .../github-helper-tag/github-helper-tag.hash  |  3 ++
  .../github-helper-tag/github-helper-tag.mk    | 11 +++++
  .../github-release/github-release.hash        |  3 ++
  .../package/github-release/github-release.mk  | 12 ++++++
  .../testing/tests/download/test_gitforge.py   | 41 +++++++++++++++++++
  10 files changed, 86 insertions(+)

create mode 100644 support/testing/tests/download/br2-external/github/Config.in
create mode 100644 support/testing/tests/download/br2-external/github/external.desc
create mode 100644 support/testing/tests/download/br2-external/github/external.mk
create mode 100644 support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.hash create mode 100644 support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk create mode 100644 support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.hash create mode 100644 support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.mk create mode 100644 support/testing/tests/download/br2-external/github/package/github-release/github-release.hash create mode 100644 support/testing/tests/download/br2-external/github/package/github-release/github-release.mk create mode 100644 support/testing/tests/download/test_gitforge.py

support/testing/tests/download/br2-external/github/Config.in new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2

Personally, I would have added Config.in options here, but since they're not
actually used in the test, I guess they're redundant.

Quoted 29 lines
support/testing/tests/download/br2-external/github/external.desc new file +1 -0
new file mode 100644
index 0000000000..b8beea8839
@@ -0,0 +1 @@
+name: GITHUB
support/testing/tests/download/br2-external/github/external.mk new file +1 -0
new file mode 100644
index 0000000000..e4e5524ceb
@@ -0,0 +1 @@
+include $(sort $(wildcard $(BR2_EXTERNAL_GITHUB_PATH)/package/*/*.mk))
support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.hash new file +3 -0
new file mode 100644
index 0000000000..a941060b31
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  4064739881453831bceeae81af8947cbd6c1fe03e052ac17b82ae5b3360d83f8  github-helper-hash-e2fba6457bd9d9c720540332eaf0c1f8c29eab00.tar.gz
+sha256  9755181e27175cb3510b4da8629caa406fb355a19aa8e7d55f06bf8ab33323c4  COPYING
support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk new file +0 -0
new file mode 100644
index 0000000000..e1fa5aabc2

support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk line 8

Quoted 8 lines
support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk new file +8 -0
@@ -0,0 +1,11 @@
+################################################################################
+#
+# github-helper-hash
+#
+################################################################################
+
+GITHUB_HELPER_HASH_VERSION = e2fba6457bd9d9c720540332eaf0c1f8c29eab00
+GITHUB_HELPER_HASH_SITE = $(call github,buildroot,buildroot,$(GITHUB_HELPER_HASH_VERSION))

Might be a good idea to use something with a smaller tarball, but OTOH it's
nice that it's something we control.

We could actually create a repo just for this.

Regards,
Arnout

Quoted 94 lines
support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk new file +3 -0
+GITHUB_HELPER_HASH_LICENSE_FILES = COPYING
+
+$(eval $(generic-package))
support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.hash new file +3 -0
new file mode 100644
index 0000000000..466d2ac401
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  959a953bbd91e6ed6db8d63a45a986400878b6bb486455231b2976218301c3d2  github-helper-tag-2021.02.tar.gz
+sha256  9755181e27175cb3510b4da8629caa406fb355a19aa8e7d55f06bf8ab33323c4  COPYING
support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.mk new file +11 -0
new file mode 100644
index 0000000000..b1ff66d817
@@ -0,0 +1,11 @@
+################################################################################
+#
+# github-helper-tag
+#
+################################################################################
+
+GITHUB_HELPER_TAG_VERSION = 2021.02
+GITHUB_HELPER_TAG_SITE = $(call github,buildroot,buildroot,$(GITHUB_HELPER_TAG_VERSION))
+GITHUB_HELPER_TAG_LICENSE_FILES = COPYING
+
+$(eval $(generic-package))
support/testing/tests/download/br2-external/github/package/github-release/github-release.hash new file +3 -0
new file mode 100644
index 0000000000..78a25dd271
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  f4cb17b21928e36ec27de5c5294dea6ec1de4acd7ee6c56d6ecc75319cbcaefa  systemd-bootchart-233.tar.xz
+sha256  dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  LICENSE.LGPL2.1
support/testing/tests/download/br2-external/github/package/github-release/github-release.mk new file +12 -0
new file mode 100644
index 0000000000..34409e1cad
@@ -0,0 +1,12 @@
+################################################################################
+#
+# github-release
+#
+################################################################################
+
+GITHUB_RELEASE_VERSION = 233
+GITHUB_RELEASE_SITE = https://github.com/systemd/systemd-bootchart/releases/download/v$(GITHUB_RELEASE_VERSION)
+GITHUB_RELEASE_SOURCE = systemd-bootchart-$(GITHUB_RELEASE_VERSION).tar.xz
+GITHUB_RELEASE_LICENSE_FILES = LICENSE.LGPL2.1
+
+$(eval $(generic-package))
support/testing/tests/download/test_gitforge.py new file +31 -0
new file mode 100644
index 0000000000..c2d98d0853
@@ -0,0 +1,41 @@
+import os
+import shutil
+
+import infra
+
+
+class GitforgeTestBase(infra.basetest.BRConfigTest):
+    config = \
+        """
+        BR2_BACKUP_SITE=""
+        """
+
+    def setUp(self):
+        super(GitforgeTestBase, self).setUp()
+
+    def tearDown(self):
+        self.show_msg("Cleaning up")
+        if self.b and not self.keepbuilds:
+            self.b.delete()
+
+    def check_download(self, package):
+        # store downloaded tarball inside the output dir so the test infra
+        # cleans it up at the end
+        dl_dir = os.path.join(self.builddir, "dl")
+        # enforce we test the download
+        if os.path.exists(dl_dir):
+            shutil.rmtree(dl_dir)
+        env = {"BR2_DL_DIR": dl_dir}
+        self.b.build(["{}-dirclean".format(package),
+                      "{}-legal-info".format(package)],
+                     env)

support/testing/tests/download/test_gitforge.py line 41

Quoted 10 lines
support/testing/tests/download/test_gitforge.py new file +10 -0
+
+
+class TestGitHub(GitforgeTestBase):
+    br2_external = [infra.filepath("tests/download/br2-external/github")]
+
+    def test_run(self):
+        self.check_download("github-helper-tag")
+        self.check_download("github-helper-hash")
+        self.check_download("github-release")
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot