lol

treewide: add version tests (#255781)

authored by

Austin Horstman and committed by
GitHub
ad07cd4f ba267807

+54 -5
+5 -1
pkgs/applications/file-managers/ranger/default.nix
··· 1 - { lib, fetchFromGitHub, python3Packages, file, less, highlight, w3m 2 , imagePreviewSupport ? true 3 , neoVimSupport ? true 4 , improvedEncodingDetection ? true ··· 48 substituteInPlace ranger/config/rc.conf \ 49 --replace "set preview_images false" "set preview_images true" 50 ''; 51 52 meta = with lib; { 53 description = "File manager with minimalistic curses interface";
··· 1 + { lib, fetchFromGitHub, python3Packages, file, less, highlight, w3m, ranger, testers 2 , imagePreviewSupport ? true 3 , neoVimSupport ? true 4 , improvedEncodingDetection ? true ··· 48 substituteInPlace ranger/config/rc.conf \ 49 --replace "set preview_images false" "set preview_images true" 50 ''; 51 + 52 + passthru.tests.version = testers.testVersion { 53 + package = ranger; 54 + }; 55 56 meta = with lib; { 57 description = "File manager with minimalistic curses interface";
+5 -1
pkgs/applications/misc/1password/default.nix
··· 1 - { lib, stdenv, fetchurl, fetchzip, autoPatchelfHook, installShellFiles, cpio, xar }: 2 3 let 4 inherit (stdenv.hostPlatform) system; ··· 62 installCheckPhase = '' 63 $out/bin/${mainProgram} --version 64 ''; 65 66 meta = with lib; { 67 description = "1Password command-line tool";
··· 1 + { lib, stdenv, fetchurl, fetchzip, autoPatchelfHook, installShellFiles, cpio, xar, _1password, testers }: 2 3 let 4 inherit (stdenv.hostPlatform) system; ··· 62 installCheckPhase = '' 63 $out/bin/${mainProgram} --version 64 ''; 65 + 66 + passthru.tests.version = testers.testVersion { 67 + package = _1password; 68 + }; 69 70 meta = with lib; { 71 description = "1Password command-line tool";
+5 -1
pkgs/development/tools/lazygit/default.nix
··· 1 - { lib, buildGoModule, fetchFromGitHub }: 2 3 buildGoModule rec { 4 pname = "lazygit"; ··· 15 subPackages = [ "." ]; 16 17 ldflags = [ "-X main.version=${version}" "-X main.buildSource=nix" ]; 18 19 meta = with lib; { 20 description = "Simple terminal UI for git commands";
··· 1 + { lib, buildGoModule, fetchFromGitHub, lazygit, testers }: 2 3 buildGoModule rec { 4 pname = "lazygit"; ··· 15 subPackages = [ "." ]; 16 17 ldflags = [ "-X main.version=${version}" "-X main.buildSource=nix" ]; 18 + 19 + passthru.tests.version = testers.testVersion { 20 + package = lazygit; 21 + }; 22 23 meta = with lib; { 24 description = "Simple terminal UI for git commands";
+6
pkgs/os-specific/darwin/sketchybar/default.nix
··· 9 , IOKit 10 , MediaRemote 11 , SkyLight 12 }: 13 14 let ··· 52 53 runHook postInstall 54 ''; 55 56 meta = { 57 description = "A highly customizable macOS status bar replacement";
··· 9 , IOKit 10 , MediaRemote 11 , SkyLight 12 + , testers 13 }: 14 15 let ··· 53 54 runHook postInstall 55 ''; 56 + 57 + passthru.tests.version = testers.testVersion { 58 + package = finalAttrs.finalPackage; 59 + version = "sketchybar-v${finalAttrs.version}"; 60 + }; 61 62 meta = { 63 description = "A highly customizable macOS status bar replacement";
+6
pkgs/os-specific/darwin/skhd/default.nix
··· 3 , fetchFromGitHub 4 , Carbon 5 , Cocoa 6 }: 7 8 stdenv.mkDerivation (finalAttrs: { ··· 30 cp ${./org.nixos.skhd.plist} $out/Library/LaunchDaemons/org.nixos.skhd.plist 31 substituteInPlace $out/Library/LaunchDaemons/org.nixos.skhd.plist --subst-var out 32 ''; 33 34 meta = { 35 description = "Simple hotkey daemon for macOS";
··· 3 , fetchFromGitHub 4 , Carbon 5 , Cocoa 6 + , testers 7 }: 8 9 stdenv.mkDerivation (finalAttrs: { ··· 31 cp ${./org.nixos.skhd.plist} $out/Library/LaunchDaemons/org.nixos.skhd.plist 32 substituteInPlace $out/Library/LaunchDaemons/org.nixos.skhd.plist --subst-var out 33 ''; 34 + 35 + passthru.tests.version = testers.testVersion { 36 + package = finalAttrs.finalPackage; 37 + version = "skhd-v${finalAttrs.version}"; 38 + }; 39 40 meta = { 41 description = "Simple hotkey daemon for macOS";
+5 -1
pkgs/tools/misc/lazydocker/default.nix
··· 1 - { lib, buildGoModule, fetchFromGitHub }: 2 3 buildGoModule rec { 4 pname = "lazydocker"; ··· 20 excludedPackages = [ "scripts" "test/printrandom" ]; 21 22 ldflags = [ "-s" "-w" "-X main.version=${version}" ]; 23 24 meta = with lib; { 25 description = "A simple terminal UI for both docker and docker-compose";
··· 1 + { lib, buildGoModule, fetchFromGitHub, lazydocker, testers }: 2 3 buildGoModule rec { 4 pname = "lazydocker"; ··· 20 excludedPackages = [ "scripts" "test/printrandom" ]; 21 22 ldflags = [ "-s" "-w" "-X main.version=${version}" ]; 23 + 24 + passthru.tests.version = testers.testVersion { 25 + package = lazydocker; 26 + }; 27 28 meta = with lib; { 29 description = "A simple terminal UI for both docker and docker-compose";
+5
pkgs/tools/misc/ncdu/default.nix
··· 4 , ncurses 5 , zig_0_11 6 , installShellFiles 7 , pie ? stdenv.isDarwin 8 }: 9 ··· 30 postInstall = '' 31 installManPage ncdu.1 32 ''; 33 34 meta = { 35 homepage = "https://dev.yorhel.nl/ncdu";
··· 4 , ncurses 5 , zig_0_11 6 , installShellFiles 7 + , testers 8 , pie ? stdenv.isDarwin 9 }: 10 ··· 31 postInstall = '' 32 installManPage ncdu.1 33 ''; 34 + 35 + passthru.tests.version = testers.testVersion { 36 + package = finalAttrs.finalPackage; 37 + }; 38 39 meta = { 40 homepage = "https://dev.yorhel.nl/ncdu";
+5 -1
pkgs/tools/misc/toilet/default.nix
··· 1 - { lib, stdenv, fetchurl, pkg-config, libcaca }: 2 3 stdenv.mkDerivation rec { 4 pname = "toilet"; ··· 11 12 nativeBuildInputs = [ pkg-config ]; 13 buildInputs = [ libcaca ]; 14 15 meta = with lib; { 16 description = "Display large colourful characters in text mode";
··· 1 + { lib, stdenv, fetchurl, pkg-config, libcaca, toilet, testers }: 2 3 stdenv.mkDerivation rec { 4 pname = "toilet"; ··· 11 12 nativeBuildInputs = [ pkg-config ]; 13 buildInputs = [ libcaca ]; 14 + 15 + passthru.tests.version = testers.testVersion { 16 + package = toilet; 17 + }; 18 19 meta = with lib; { 20 description = "Display large colourful characters in text mode";
+6
pkgs/tools/system/bottom/default.nix
··· 4 , installShellFiles 5 , stdenv 6 , darwin 7 }: 8 9 rustPlatform.buildRustPackage rec { ··· 35 ''; 36 37 BTM_GENERATE = true; 38 39 meta = with lib; { 40 description = "A cross-platform graphical process/system monitor with a customizable interface";
··· 4 , installShellFiles 5 , stdenv 6 , darwin 7 + , bottom 8 + , testers 9 }: 10 11 rustPlatform.buildRustPackage rec { ··· 37 ''; 38 39 BTM_GENERATE = true; 40 + 41 + passthru.tests.version = testers.testVersion { 42 + package = bottom; 43 + }; 44 45 meta = with lib; { 46 description = "A cross-platform graphical process/system monitor with a customizable interface";
+6
pkgs/tools/system/btop/default.nix
··· 3 , fetchFromGitHub 4 , darwin 5 , removeReferencesTo 6 }: 7 8 stdenv.mkDerivation rec { ··· 29 postInstall = '' 30 ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/bin/btop) 31 ''; 32 33 meta = with lib; { 34 description = "A monitor of resources";
··· 3 , fetchFromGitHub 4 , darwin 5 , removeReferencesTo 6 + , btop 7 + , testers 8 }: 9 10 stdenv.mkDerivation rec { ··· 31 postInstall = '' 32 ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/bin/btop) 33 ''; 34 + 35 + passthru.tests.version = testers.testVersion { 36 + package = btop; 37 + }; 38 39 meta = with lib; { 40 description = "A monitor of resources";