Fix test failures and unused imports after combining PRs

Co-authored-by: Snider <631881+Snider@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-02 06:12:37 +00:00
parent 75a9ba9ef4
commit 3aea1d7d1a
5 changed files with 13 additions and 12 deletions

6
go.mod
View file

@ -7,6 +7,7 @@ require (
github.com/Snider/Borg v0.0.2 github.com/Snider/Borg v0.0.2
github.com/Snider/Poindexter v0.0.0-20251229183216-e182d4f49741 github.com/Snider/Poindexter v0.0.0-20251229183216-e182d4f49741
github.com/adrg/xdg v0.5.3 github.com/adrg/xdg v0.5.3
github.com/ckanthony/gin-mcp v0.0.0-20251107113615-3c631c4fa9f4
github.com/gin-contrib/cors v1.7.6 github.com/gin-contrib/cors v1.7.6
github.com/gin-gonic/gin v1.11.0 github.com/gin-gonic/gin v1.11.0
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0
@ -17,6 +18,7 @@ require (
github.com/swaggo/files v1.0.1 github.com/swaggo/files v1.0.1
github.com/swaggo/gin-swagger v1.6.0 github.com/swaggo/gin-swagger v1.6.0
github.com/swaggo/swag v1.16.6 github.com/swaggo/swag v1.16.6
golang.org/x/text v0.31.0
) )
require ( require (
@ -25,7 +27,6 @@ require (
github.com/Snider/Enchantrix v0.0.2 // indirect github.com/Snider/Enchantrix v0.0.2 // indirect
github.com/bytedance/sonic v1.14.0 // indirect github.com/bytedance/sonic v1.14.0 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect github.com/bytedance/sonic/loader v0.3.0 // indirect
github.com/ckanthony/gin-mcp v0.0.0-20251107113615-3c631c4fa9f4 // indirect
github.com/cloudflare/circl v1.6.1 // indirect github.com/cloudflare/circl v1.6.1 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect github.com/cloudwego/base64x v0.1.6 // indirect
github.com/ebitengine/purego v0.9.0 // indirect github.com/ebitengine/purego v0.9.0 // indirect
@ -70,11 +71,10 @@ require (
go.yaml.in/yaml/v3 v3.0.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.20.0 // indirect golang.org/x/arch v0.20.0 // indirect
golang.org/x/crypto v0.45.0 // indirect golang.org/x/crypto v0.45.0 // indirect
golang.org/x/mod v0.29.0 // indirect golang.org/x/mod v0.30.0 // indirect
golang.org/x/net v0.47.0 // indirect golang.org/x/net v0.47.0 // indirect
golang.org/x/sync v0.18.0 // indirect golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.38.0 // indirect golang.org/x/sys v0.38.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/tools v0.38.0 // indirect golang.org/x/tools v0.38.0 // indirect
google.golang.org/protobuf v1.36.9 // indirect google.golang.org/protobuf v1.36.9 // indirect
) )

View file

@ -6,7 +6,6 @@ import (
"path/filepath" "path/filepath"
"runtime" "runtime"
"testing" "testing"
"time"
) )
// setupTestManager creates a new Manager and a dummy executable for tests. // setupTestManager creates a new Manager and a dummy executable for tests.
@ -133,8 +132,9 @@ func TestListMiners_Good(t *testing.T) {
m.miners["xmrig-test"] = miner m.miners["xmrig-test"] = miner
m.mu.Unlock() m.mu.Unlock()
miners = m.ListMiners() finalMiners := m.ListMiners()
if len(miners) != 1 { expectedCount := initialCount + 1
t.Errorf("Expected 1 miner, but got %d", len(miners)) if len(finalMiners) != expectedCount {
t.Errorf("Expected %d miners, but got %d", expectedCount, len(finalMiners))
} }
} }

View file

@ -1,7 +1,6 @@
package mining package mining
import ( import (
"context"
"testing" "testing"
) )

View file

@ -119,11 +119,14 @@ func TestXMRigMiner_Start_Stop_Bad(t *testing.T) {
func TestXMRigMiner_CheckInstallation(t *testing.T) { func TestXMRigMiner_CheckInstallation(t *testing.T) {
tmpDir := t.TempDir() tmpDir := t.TempDir()
dummyExePath := filepath.Join(tmpDir, "xmrig") // Use "miner" since that's what NewXMRigMiner() sets as ExecutableName
executableName := "xmrig" executableName := "miner"
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
executableName += ".exe" executableName += ".exe"
dummyExePath = filepath.Join(tmpDir, executableName) }
dummyExePath := filepath.Join(tmpDir, executableName)
if runtime.GOOS == "windows" {
// Create a dummy batch file that prints version // Create a dummy batch file that prints version
if err := os.WriteFile(dummyExePath, []byte("@echo off\necho XMRig 6.24.0\n"), 0755); err != nil { if err := os.WriteFile(dummyExePath, []byte("@echo off\necho XMRig 6.24.0\n"), 0755); err != nil {
t.Fatalf("failed to create dummy executable: %v", err) t.Fatalf("failed to create dummy executable: %v", err)

View file

@ -10,7 +10,6 @@ import (
"time" "time"
"github.com/Snider/Mining/pkg/logging" "github.com/Snider/Mining/pkg/logging"
"github.com/Snider/Mining/pkg/ueps"
"github.com/Snider/Poindexter" "github.com/Snider/Poindexter"
"github.com/adrg/xdg" "github.com/adrg/xdg"
) )