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 {
|
2019-08-15 14:41:18 +02:00
|
|
|
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;
|
|
|
|
|
2024-03-21 23:39:57 +01:00
|
|
|
checkFlags = [
|
|
|
|
"-short"
|
|
|
|
"-skip=TestVersionEndpointReturnsVersion|TestFullstreamLatencyBiasDown"
|
|
|
|
];
|
2018-03-22 14:16:14 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
2020-04-28 03:50:57 +02:00
|
|
|
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}";
|
2020-10-11 07:55:05 +02:00
|
|
|
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 ];
|
2018-08-04 16:37:55 +02:00
|
|
|
license = lib.licenses.mit;
|
2018-03-22 14:16:14 +01:00
|
|
|
};
|
|
|
|
}
|