Skip to content

Commit

Permalink
honeycomb-refinery: init at 1.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade Lovelace authored and lf- committed Nov 13, 2022
1 parent 444a640 commit bb6bd44
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
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

38 changes: 38 additions & 0 deletions pkgs/servers/tracing/honeycomb/refinery/default.nix
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";
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ with pkgs;

hobbes = callPackage ../development/tools/hobbes { stdenv = gcc10StdenvCompat; };

honeycomb-refinery = callPackage ../servers/tracing/honeycomb/refinery { };

html5validator = python3Packages.callPackage ../applications/misc/html5validator { };

buildcatrust = with python3.pkgs; toPythonApplication buildcatrust;
Expand Down

0 comments on commit bb6bd44

Please sign in to comment.