nixpkgs/pkgs/development/tools/toxiproxy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.4 KiB
Nix
Raw Normal View History

2023-10-12 17:08:39 +02:00
{ lib
, buildGoModule
, fetchFromGitHub
, testers
, toxiproxy
}:
2018-03-22 14:16:14 +01:00
2022-04-23 02:34:22 +02:00
buildGoModule rec {
pname = "toxiproxy";
2024-03-21 19:57:18 +01:00
version = "2.9.0";
2022-04-23 02:34:22 +02:00
2018-03-22 14:16:14 +01:00
src = fetchFromGitHub {
owner = "Shopify";
repo = "toxiproxy";
rev = "v${version}";
2024-03-21 19:57:18 +01:00
sha256 = "sha256-zwKeJ8LMMSSHvE0x0/9j3wBdAJG43RiGcszKz0B3dG8=";
2018-03-22 14:16:14 +01:00
};
2024-03-21 19:57:18 +01:00
vendorHash = "sha256-eSQvLsSWWypA5vXR/GiEf5j7TzzsL8ZFRPOeICsIrlY=";
2022-04-23 02:34:22 +02:00
excludedPackages = [ "test/e2e" ];
ldflags = [ "-s" "-w" "-X github.com/Shopify/toxiproxy/v2.Version=${version}" ];
2022-10-06 00:17:32 +02:00
# Fixes tests on Darwin
__darwinAllowLocalNetworking = true;
checkFlags = [
"-short"
"-skip=TestVersionEndpointReturnsVersion|TestFullstreamLatencyBiasDown"
];
2018-03-22 14:16:14 +01:00
postInstall = ''
mv $out/bin/cli $out/bin/toxiproxy-cli
2022-04-23 02:34:22 +02:00
mv $out/bin/server $out/bin/toxiproxy-server
2018-03-22 14:16:14 +01:00
'';
2023-10-12 17:08:39 +02:00
passthru.tests = {
cliVersion = testers.testVersion {
inherit version;
package = toxiproxy;
command = "${toxiproxy}/bin/toxiproxy-cli -version";
};
serverVersion = testers.testVersion {
inherit version;
package = toxiproxy;
command = "${toxiproxy}/bin/toxiproxy-server -version";
};
};
2018-03-22 14:16:14 +01:00
meta = {
2023-10-12 17:08:39 +02:00
changelog = "https://github.com/Shopify/toxiproxy/releases/tag/v${version}";
description = "Proxy for for simulating network conditions";
2022-04-23 02:34:22 +02:00
homepage = "https://github.com/Shopify/toxiproxy";
2018-03-22 14:16:14 +01:00
maintainers = with lib.maintainers; [ avnik ];
license = lib.licenses.mit;
2018-03-22 14:16:14 +01:00
};
}