Merge pull request #299160 from anthonyroussel/maintainer/steampipe

steampipe: enable tests on darwin

authored by Weijia Wang and committed by GitHub d3c4cab3 e9200ffe

+34 -16
+34 -16
pkgs/by-name/st/steampipe/package.nix
··· 3 3 fetchFromGitHub, 4 4 installShellFiles, 5 5 lib, 6 + makeWrapper, 6 7 nix-update-script, 7 - stdenv, 8 8 steampipe, 9 9 testers, 10 10 }: ··· 16 16 src = fetchFromGitHub { 17 17 owner = "turbot"; 18 18 repo = "steampipe"; 19 - rev = "v${version}"; 19 + rev = "refs/tags/v${version}"; 20 20 hash = "sha256-Oz1T9koeXnmHc5oru1apUtmhhvKi/gAtg/Hb7HKkkP0="; 21 21 }; 22 22 23 23 vendorHash = "sha256-U0BeGCRLjL56ZmVKcKqrrPTCXpShJzJq5/wnXDKax6g="; 24 24 proxyVendor = true; 25 25 26 - patchPhase = '' 27 - runHook prePatch 26 + postPatch = '' 28 27 # Patch test that relies on looking up homedir in user struct to prefer ~ 29 28 substituteInPlace pkg/steampipeconfig/shared_test.go \ 30 - --replace 'filehelpers "github.com/turbot/go-kit/files"' "" \ 31 - --replace 'filepaths.SteampipeDir, _ = filehelpers.Tildefy("~/.steampipe")' 'filepaths.SteampipeDir = "~/.steampipe"'; 32 - runHook postPatch 29 + --replace-fail 'filehelpers "github.com/turbot/go-kit/files"' "" \ 30 + --replace-fail 'filepaths.SteampipeDir, _ = filehelpers.Tildefy("~/.steampipe")' 'filepaths.SteampipeDir = "~/.steampipe"'; 33 31 ''; 34 32 35 - nativeBuildInputs = [ installShellFiles ]; 33 + nativeBuildInputs = [ 34 + installShellFiles 35 + makeWrapper 36 + ]; 36 37 37 - ldflags = [ "-s" "-w" ]; 38 + ldflags = [ 39 + "-s" 40 + "-w" 41 + ]; 38 42 39 - # panic: could not create backups directory: mkdir /var/empty/.steampipe: operation not permitted 40 - doCheck = !stdenv.isDarwin; 43 + doCheck = true; 44 + 45 + checkFlags = 46 + let 47 + skippedTests = [ 48 + # panic: could not create backups directory: mkdir /var/empty/.steampipe: operation not permitted 49 + "TestTrimBackups" 50 + # Skip tests that require network access 51 + "TestIsPortBindable" 52 + ]; 53 + in 54 + [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; 41 55 42 56 postInstall = '' 57 + wrapProgram $out/bin/steampipe \ 58 + --set-default STEAMPIPE_UPDATE_CHECK false \ 59 + --set-default STEAMPIPE_TELEMETRY none 60 + 43 61 INSTALL_DIR=$(mktemp -d) 44 62 installShellCompletion --cmd steampipe \ 45 63 --bash <($out/bin/steampipe --install-dir $INSTALL_DIR completion bash) \ ··· 56 74 updateScript = nix-update-script { }; 57 75 }; 58 76 59 - meta = with lib; { 77 + meta = { 78 + changelog = "https://github.com/turbot/steampipe/blob/v${version}/CHANGELOG.md"; 79 + description = "Dynamically query your cloud, code, logs & more with SQL"; 60 80 homepage = "https://steampipe.io/"; 61 - description = "select * from cloud;"; 62 - license = licenses.agpl3Only; 81 + license = lib.licenses.agpl3Only; 63 82 mainProgram = "steampipe"; 64 - maintainers = with maintainers; [ hardselius ]; 65 - changelog = "https://github.com/turbot/steampipe/blob/v${version}/CHANGELOG.md"; 83 + maintainers = with lib.maintainers; [ hardselius anthonyroussel ]; 66 84 }; 67 85 }