public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/glab] epel10: Fix test for s390x and ppc64le
@ 2026-11-17 13:13 Mikel Olasagasti Uranga
  0 siblings, 0 replies; only message in thread
From: Mikel Olasagasti Uranga @ 2026-11-17 13:13 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/glab
            Branch : epel10
            Commit : 68add7b2184fe253c0ce275084dcc7ed76f0f3e0
            Author : Mikel Olasagasti Uranga <mikel@olasagasti.info>
            Date   : 2026-11-04T23:33:38+01:00
            Stats  : +65/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/glab/c/68add7b2184fe253c0ce275084dcc7ed76f0f3e0?branch=epel10

            Log:
            Fix test for s390x and ppc64le

[skip changelog]

---
diff --git a/0001-test-binarymgr-allow-architecture-independent-test-f.patch b/0001-test-binarymgr-allow-architecture-independent-test-f.patch
new file mode 100644
index 0000000..588fae4
--- /dev/null
+++ b/0001-test-binarymgr-allow-architecture-independent-test-f.patch
@@ -0,0 +1,63 @@
+From 213f50468411dc28274bdc16913e272c465a0637 Mon Sep 17 00:00:00 2001
+From: Mikel Olasagasti Uranga <mikel@olasagasti.info>
+Date: Wed, 4 Nov 2026 22:14:00 +0100
+Subject: [PATCH] test(binarymgr): allow architecture-independent test fixtures
+
+Accept other architectures in testSpec while preserving amd64 normalization.
+This lets managed-binary tests run on s390x and ppc64le without skips or
+changes to production platform support.
+
+Add regression coverage for all four Fedora architectures.
+
+Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
+---
+ internal/binarymgr/manager_test.go | 25 ++++++++++++++++++++-----
+ 1 file changed, 20 insertions(+), 5 deletions(-)
+
+diff --git a/internal/binarymgr/manager_test.go b/internal/binarymgr/manager_test.go
+index ad9d942e6..507aa0fdc 100644
+--- a/internal/binarymgr/manager_test.go
++++ b/internal/binarymgr/manager_test.go
+@@ -39,19 +39,34 @@ func testSpec() Spec {
+ 		MaxCompatibleMajor: 8,
+ 		SupportedOS:        []string{"darwin", "linux", "windows"},
+ 		NormalizeArch: func(goos, goarch string) (string, error) {
+-			switch goarch {
+-			case "amd64":
++			if goarch == "amd64" {
+ 				return "x64", nil
+-			case "arm64":
+-				return "arm64", nil
+ 			}
+-			return "", ErrUnsupportedPlatform
++			return goarch, nil
+ 		},
+ 		AssetName:     func(os, arch string) string { return "test-" + os + "-" + arch },
+ 		InstalledName: func(os string) string { return "test" },
+ 	}
+ }
+ 
++func TestTestSpec_NormalizeArch(t *testing.T) {
++	t.Parallel()
++
++	for arch, want := range map[string]string{
++		"amd64":   "x64",
++		"arm64":   "arm64",
++		"s390x":   "s390x",
++		"ppc64le": "ppc64le",
++	} {
++		t.Run(arch, func(t *testing.T) {
++			t.Parallel()
++			got, err := testSpec().NormalizeArch("linux", arch)
++			require.NoError(t, err)
++			assert.Equal(t, want, got)
++		})
++	}
++}
++
+ func TestManager_isBinaryValid(t *testing.T) {
+ 	t.Parallel()
+ 
+-- 
+2.56.0
+

diff --git a/glab.spec b/glab.spec
index e4c4404..5c83901 100644
--- a/glab.spec
+++ b/glab.spec
@@ -21,6 +21,8 @@ Source0:        %{gosource}
 # Generated by go-vendor-tools
 Source1:        %{archivename}-vendor.tar.bz2
 Source2:        go-vendor-tools.toml
+# https://gitlab.com/gitlab-org/cli/-/merge_requests/4325
+Patch0:         0001-test-binarymgr-allow-architecture-independent-test-f.patch
 
 BuildRequires:  go-vendor-tools
 BuildRequires:  git-core

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-17 13:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 13:13 [rpms/glab] epel10: Fix test for s390x and ppc64le Mikel Olasagasti Uranga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox