public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Mikel Olasagasti Uranga <mikel@olasagasti.info>
To: git-commits@fedoraproject.org
Subject: [rpms/rclone] epel9: Fix tests failing with Go 1.25
Date: Sun, 11 Oct 2026 09:46:07 GMT	[thread overview]
Message-ID: <179171196769.1.17249090226029558709.rpms-rclone-0db9494f18b1@fedoraproject.org> (raw)

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
 

                 reply	other threads:[~2026-10-11  9:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=179171196769.1.17249090226029558709.rpms-rclone-0db9494f18b1@fedoraproject.org \
    --to=mikel@olasagasti.info \
    --cc=git-commits@fedoraproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox