Commit a6d11d19 authored by Bryan Lai's avatar Bryan Lai
Browse files

hydra-check: add basic passthru.tests

parent c53baa66
Loading
Loading
Loading
Loading
+28 −2
Original line number Diff line number Diff line
@@ -7,9 +7,12 @@
  stdenv,
  installShellFiles,
  versionCheckHook,
  testers,
  curl,
  cacert,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: rec {
  pname = "hydra-check";
  version = "2.0.4";

@@ -53,6 +56,29 @@ rustPlatform.buildRustPackage rec {

  doInstallCheck = true;

  passthru.tests.mainCommand =
    testers.runCommand # allows internet access
      {
        name = "hydra-check-test";

        # only runs the test when internet access is confirmed:
        script = ''
          set -e
          if curl hydra.nixos.org > /dev/null; then
            hydra-check
          else
            echo "no internet access, skipping test"
          fi
          touch $out
        '';

        nativeBuildInputs = [
          finalAttrs.finalPackage
          curl
          cacert # for https connectivity
        ];
      };

  meta = {
    description = "Check hydra for the build status of a package";
    homepage = "https://github.com/nix-community/hydra-check";
@@ -65,4 +91,4 @@ rustPlatform.buildRustPackage rec {
    ];
    mainProgram = "hydra-check";
  };
}
})