public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rclone] epel9: Fix tests failing with Go 1.25
@ 2026-10-11 9:46 Mikel Olasagasti Uranga
0 siblings, 0 replies; only message in thread
From: Mikel Olasagasti Uranga @ 2026-10-11 9:46 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rclone
Branch : epel9
Commit : 0db9494f18b1364dc612bf05855ce9b442eb9cfb
Author : Mikel Olasagasti Uranga <mikel@olasagasti.info>
Date : 2026-05-02T13:17:09+02:00
Stats : +68/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rclone/c/0db9494f18b1364dc612bf05855ce9b442eb9cfb?branch=epel9
Log:
Fix tests failing with Go 1.25
---
diff --git a/0001-Fix-test-with-1.25.patch b/0001-Fix-test-with-1.25.patch
new file mode 100644
index 0000000..136bf05
--- /dev/null
+++ b/0001-Fix-test-with-1.25.patch
@@ -0,0 +1,67 @@
+From 2096915ad6a91f193f3815deb71180d026253816 Mon Sep 17 00:00:00 2001
+From: Mikel Olasagasti Uranga <mikel@olasagasti.info>
+Date: Sat, 2 May 2026 00:20:43 +0200
+Subject: [PATCH] Fix test with 1.25
+
+Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
+---
+ backend/huaweidrive/huaweidrive_test.go | 18 ++++++++++++++----
+ fs/mimetype.go | 1 +
+ 2 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/backend/huaweidrive/huaweidrive_test.go b/backend/huaweidrive/huaweidrive_test.go
+index a5285f2ab..71a16c9a6 100644
+--- a/backend/huaweidrive/huaweidrive_test.go
++++ b/backend/huaweidrive/huaweidrive_test.go
+@@ -427,14 +427,24 @@ func TestMimeTypeDetection(t *testing.T) {
+
+ for _, tc := range testCases {
+ t.Run(tc.filename, func(t *testing.T) {
+- detected := mime.TypeByExtension(path.Ext(tc.filename))
++ ext := path.Ext(tc.filename)
++ raw := mime.TypeByExtension(ext)
++ detected := raw
+ if detected == "" {
+ detected = "application/octet-stream"
+ }
+
+- // Check if detected MIME type is in the list of expected types
++ // Go 1.25 and earlier use a small builtin extension table; types such as .txt and .zip
++ // come from the OS MIME DB (/usr/share/mime/globs2, /etc/mime.types). Minimal RPM
++ // buildroots often have no mapping, so TypeByExtension returns "". That matches
++ // huaweidrive upload logic, which keeps application/octet-stream when lookup is empty.
++ acceptable := append([]string(nil), tc.expectedMimes...)
++ if raw == "" && ext != "" {
++ acceptable = append(acceptable, "application/octet-stream")
++ }
++
+ found := false
+- for _, expected := range tc.expectedMimes {
++ for _, expected := range acceptable {
+ if detected == expected {
+ found = true
+ break
+@@ -442,7 +452,7 @@ func TestMimeTypeDetection(t *testing.T) {
+ }
+
+ if !found {
+- t.Errorf("expected one of MIME types %v for %q, got %q", tc.expectedMimes, tc.filename, detected)
++ t.Errorf("expected one of MIME types %v for %q, got %q", acceptable, tc.filename, detected)
+ }
+ })
+ }
+diff --git a/fs/mimetype.go b/fs/mimetype.go
+index 44d423738..7185db777 100644
+--- a/fs/mimetype.go
++++ b/fs/mimetype.go
+@@ -15,6 +15,7 @@ func init() {
+ mimeType string
+ extensions string
+ }{
++ {"text/plain", ".txt"},
+ {"audio/flac", ".flac"},
+ {"audio/mpeg", ".mpga,.mpega,.mp2,.mp3,.m4a"},
+ {"audio/ogg", ".oga,.ogg,.opus,.spx"},
+--
+2.54.0
+
diff --git a/rclone.spec b/rclone.spec
index 50672a8..f775d28 100644
--- a/rclone.spec
+++ b/rclone.spec
@@ -19,6 +19,7 @@ Source0: %{gosource}
# Generated by go-vendor-tools
Source1: %{archivename}-vendor.tar.bz2
Source2: go-vendor-tools.toml
+Patch: 0001-Fix-test-with-1.25.patch
BuildRequires: go-vendor-tools
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-11 9:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11 9:46 [rpms/rclone] epel9: Fix tests failing with Go 1.25 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