-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...racing/honeycomb/refinery/0001-add-NO_REDIS_TEST-env-var-that-disables-Redis-requir.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
From 301de689a1f7fae8ee6d0d5bbbe155a351b1b927 Mon Sep 17 00:00:00 2001 | ||
From: Jade Lovelace <[email protected]> | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ lib, buildGoModule, fetchFromGitHub }: | ||
|
||
buildGoModule rec { | ||
pname = "honeycomb-refinery"; | ||
version = "1.19.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "honeycombio"; | ||
repo = "refinery"; | ||
rev = "v${version}"; | ||
hash = "sha256-SU9JbyUuBMqPw4XcoF5s8CgBn7+V/rHBAwpXJk373jg="; | ||
}; | ||
|
||
NO_REDIS_TEST = true; | ||
|
||
patches = [ | ||
# Allows turning off the one test requiring a Redis service during build. | ||
# We could in principle implement that, but it's significant work to little | ||
# payoff. | ||
./0001-add-NO_REDIS_TEST-env-var-that-disables-Redis-requir.patch | ||
]; | ||
|
||
excludedPackages = [ "cmd/test_redimem" ]; | ||
|
||
ldflags = [ "-s" "-w" "-X main.BuildID=${version}" ]; | ||
|
||
vendorHash = "sha256-0M05JGLdmKivRTN8ZdhAm+JtXTlYAC31wFS82g3NenI="; | ||
|
||
doCheck = true; | ||
|
||
meta = with lib; { | ||
homepage = "https://github.com/honeycomb/refinery"; | ||
description = "A tail-sampling proxy for OpenTelemetry"; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ lf- ]; | ||
mainProgram = "refinery"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters