From 948727d87270294c444ff6aff736b60a491d0298 Mon Sep 17 00:00:00 2001 From: Mrinal Purohit Date: Sat, 30 Oct 2021 04:56:28 +0530 Subject: [PATCH] awscli: move nixos test to installCheckPhase --- nixos/tests/all-tests.nix | 1 - nixos/tests/awscli.nix | 17 ----------------- pkgs/tools/admin/awscli/default.nix | 16 ++++++++++------ 3 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 nixos/tests/awscli.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 63c307c09833..97596af9739f 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -32,7 +32,6 @@ in atop = handleTest ./atop.nix {}; avahi = handleTest ./avahi.nix {}; avahi-with-resolved = handleTest ./avahi.nix { networkd = true; }; - awscli = handleTest ./awscli.nix { }; babeld = handleTest ./babeld.nix {}; bat = handleTest ./bat.nix {}; bazarr = handleTest ./bazarr.nix {}; diff --git a/nixos/tests/awscli.nix b/nixos/tests/awscli.nix deleted file mode 100644 index e6741fcf1412..000000000000 --- a/nixos/tests/awscli.nix +++ /dev/null @@ -1,17 +0,0 @@ -import ./make-test-python.nix ({ pkgs, ...} : { - name = "awscli"; - meta = with pkgs.lib.maintainers; { - maintainers = [ nequissimus ]; - }; - - machine = { pkgs, ... }: - { - environment.systemPackages = [ pkgs.awscli ]; - }; - - testScript = - '' - assert "${pkgs.python3Packages.botocore.version}" in machine.succeed("aws --version") - assert "${pkgs.awscli.version}" in machine.succeed("aws --version") - ''; -}) diff --git a/pkgs/tools/admin/awscli/default.nix b/pkgs/tools/admin/awscli/default.nix index d11ed86e088c..0b9d6b473831 100644 --- a/pkgs/tools/admin/awscli/default.nix +++ b/pkgs/tools/admin/awscli/default.nix @@ -1,5 +1,4 @@ { lib -, nixosTests , python3 , groff , less @@ -34,9 +33,6 @@ with py.pkgs; buildPythonApplication rec { --replace "docutils>=0.10,<0.16" "docutils>=0.10" ''; - # No tests included - doCheck = false; - propagatedBuildInputs = [ botocore bcdoc @@ -62,10 +58,18 @@ with py.pkgs; buildPythonApplication rec { passthru = { python = py; # for aws_shell - - tests = { inherit (nixosTests) awscli; }; }; + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + $out/bin/aws --version | grep "${py.pkgs.botocore.version}" + $out/bin/aws --version | grep "${version}" + + runHook postInstallCheck + ''; + meta = with lib; { homepage = "https://aws.amazon.com/cli/"; description = "Unified tool to manage your AWS services";