nixpkgs-suyu/pkgs/servers/tracing/honeycomb/refinery/0001-add-NO_REDIS_TEST-env-var-that-disables-Redis-requir.patch
2022-11-22 11:22:31 -08:00

37 lines
965 B
Diff

From 301de689a1f7fae8ee6d0d5bbbe155a351b1b927 Mon Sep 17 00:00:00 2001
From: Jade Lovelace <jadel@mercury.com>
Date: Wed, 9 Nov 2022 11:02:02 -0800
Subject: [PATCH] add NO_REDIS_TEST env-var that disables Redis-requiring tests
---
internal/peer/peers_test.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/internal/peer/peers_test.go b/internal/peer/peers_test.go
index 5ec7f81..c64b1b4 100644
--- a/internal/peer/peers_test.go
+++ b/internal/peer/peers_test.go
@@ -2,6 +2,7 @@ package peer
import (
"context"
+ "os"
"testing"
"time"
@@ -26,6 +27,12 @@ func TestNewPeers(t *testing.T) {
t.Errorf("received %T expected %T", i, &filePeers{})
}
+ // Allow skipping test requiring redis, since Nix builds without redis
+ // available
+ if os.Getenv("NO_REDIS_TEST") != "" {
+ t.Skip("Skipping redis-requiring test");
+ }
+
c = &config.MockConfig{
GetPeerListenAddrVal: "0.0.0.0:8081",
PeerManagementType: "redis",
--
2.37.1