From a1df20a561b2b9ba7efed6485e8b20627b82b847 Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Tue, 14 Nov 2023 23:05:41 +0100 Subject: [PATCH 1/4] bats.libraries.bats-file: 0.3.0 -> 0.4.0 --- pkgs/development/interpreters/bats/libraries.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/bats/libraries.nix b/pkgs/development/interpreters/bats/libraries.nix index 9e60a4dc992c..d8d9eb4ab550 100644 --- a/pkgs/development/interpreters/bats/libraries.nix +++ b/pkgs/development/interpreters/bats/libraries.nix @@ -25,12 +25,12 @@ bats-file = stdenv.mkDerivation rec { pname = "bats-file"; - version = "0.3.0"; + version = "0.4.0"; src = fetchFromGitHub { owner = "bats-core"; repo = "bats-file"; rev = "v${version}"; - sha256 = "sha256-3xevy0QpwNZrEe+2IJq58tKyxQzYx8cz6dD2nz7fYUM="; + sha256 = "sha256-NJzpu1fGAw8zxRKFU2awiFM2Z3Va5WONAD2Nusgrf4o="; }; dontBuild = true; installPhase = '' From d87432110d39d3741b099f229c8ce38eed7026bc Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Tue, 28 Nov 2023 21:55:48 +0100 Subject: [PATCH 2/4] bats.libraries.bats-detik: init at 1.2.1 --- .../development/interpreters/bats/default.nix | 3 ++- .../interpreters/bats/libraries.nix | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/bats/default.nix b/pkgs/development/interpreters/bats/default.nix index 4953daf7109c..afffef1d1f68 100644 --- a/pkgs/development/interpreters/bats/default.nix +++ b/pkgs/development/interpreters/bats/default.nix @@ -140,6 +140,7 @@ resholve.mkDerivation rec { bats_load_library bats-support bats_load_library bats-assert bats_load_library bats-file + bats_load_library bats-detik/detik.bash bats_require_minimum_version 1.5.0 @@ -170,7 +171,7 @@ resholve.mkDerivation rec { ''; passAsFile = [ "testScript" ]; } '' - ${bats.withLibraries (p: [ p.bats-support p.bats-assert p.bats-file ])}/bin/bats "$testScriptPath" + ${bats.withLibraries (p: [ p.bats-support p.bats-assert p.bats-file p.bats-detik ])}/bin/bats "$testScriptPath" touch "$out" ''; diff --git a/pkgs/development/interpreters/bats/libraries.nix b/pkgs/development/interpreters/bats/libraries.nix index d8d9eb4ab550..e2ab8d31fadd 100644 --- a/pkgs/development/interpreters/bats/libraries.nix +++ b/pkgs/development/interpreters/bats/libraries.nix @@ -47,6 +47,31 @@ }; }; + bats-detik = stdenv.mkDerivation (finalAttrs: { + pname = "bats-detik"; + version = "1.2.1"; + src = fetchFromGitHub { + owner = "bats-core"; + repo = "bats-detik"; + rev = "v${finalAttrs.version}"; + hash = "sha256-2BEIqRSc21oPjd9BgTLg5mGyAdNJYA2b7gZe7Nj2dks="; + }; + dontBuild = true; + installPhase = '' + runHook preInstall + mkdir -p "$out/share/bats/bats-detik" + cp -r lib/* "$out/share/bats/bats-detik" + runHook postInstall + ''; + meta = { + description = "Library to ease e2e tests of applications in K8s environments"; + platforms = lib.platforms.all; + homepage = "https://github.com/bats-core/bats-detik"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ brokenpip3 ]; + }; + }); + bats-support = stdenv.mkDerivation rec { pname = "bats-support"; version = "0.3.0"; From 8c747e39cc16dfaf9398b8e0ba825c757160ece7 Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Tue, 28 Nov 2023 21:58:41 +0100 Subject: [PATCH 3/4] bats: use finalAttrs pattern --- .../interpreters/bats/libraries.nix | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/pkgs/development/interpreters/bats/libraries.nix b/pkgs/development/interpreters/bats/libraries.nix index e2ab8d31fadd..a7d5e2b87747 100644 --- a/pkgs/development/interpreters/bats/libraries.nix +++ b/pkgs/development/interpreters/bats/libraries.nix @@ -1,18 +1,20 @@ { lib, stdenv, fetchFromGitHub }: { - bats-assert = stdenv.mkDerivation rec { + bats-assert = stdenv.mkDerivation (finalAttrs: { pname = "bats-assert"; version = "2.1.0"; src = fetchFromGitHub { owner = "bats-core"; repo = "bats-assert"; - rev = "v${version}"; - sha256 = "sha256-opgyrkqTwtnn/lUjMebbLfS/3sbI2axSusWd5i/5wm4="; + rev = "v${finalAttrs.version}"; + hash = "sha256-opgyrkqTwtnn/lUjMebbLfS/3sbI2axSusWd5i/5wm4="; }; dontBuild = true; installPhase = '' + runHook preInstall mkdir -p "$out/share/bats/bats-assert" cp load.bash "$out/share/bats/bats-assert" cp -r src "$out/share/bats/bats-assert" + runHook postInstall ''; meta = { description = "Common assertions for Bats"; @@ -21,22 +23,24 @@ license = lib.licenses.cc0; maintainers = with lib.maintainers; [ infinisil ]; }; - }; + }); - bats-file = stdenv.mkDerivation rec { + bats-file = stdenv.mkDerivation (finalAttrs: { pname = "bats-file"; version = "0.4.0"; src = fetchFromGitHub { owner = "bats-core"; repo = "bats-file"; - rev = "v${version}"; - sha256 = "sha256-NJzpu1fGAw8zxRKFU2awiFM2Z3Va5WONAD2Nusgrf4o="; + rev = "v${finalAttrs.version}"; + hash = "sha256-NJzpu1fGAw8zxRKFU2awiFM2Z3Va5WONAD2Nusgrf4o="; }; dontBuild = true; installPhase = '' + runHook preInstall mkdir -p "$out/share/bats/bats-file" cp load.bash "$out/share/bats/bats-file" cp -r src "$out/share/bats/bats-file" + runHook postInstall ''; meta = { description = "Common filesystem assertions for Bats"; @@ -45,7 +49,7 @@ license = lib.licenses.cc0; maintainers = with lib.maintainers; [ infinisil ]; }; - }; + }); bats-detik = stdenv.mkDerivation (finalAttrs: { pname = "bats-detik"; @@ -72,20 +76,22 @@ }; }); - bats-support = stdenv.mkDerivation rec { + bats-support = stdenv.mkDerivation (finalAttrs: { pname = "bats-support"; version = "0.3.0"; src = fetchFromGitHub { owner = "bats-core"; repo = "bats-support"; - rev = "v${version}"; - sha256 = "sha256-4N7XJS5XOKxMCXNC7ef9halhRpg79kUqDuRnKcrxoeo="; + rev = "v${finalAttrs.version}"; + hash = "sha256-4N7XJS5XOKxMCXNC7ef9halhRpg79kUqDuRnKcrxoeo="; }; dontBuild = true; installPhase = '' + runHook preInstall mkdir -p "$out/share/bats/bats-support" cp load.bash "$out/share/bats/bats-support" cp -r src "$out/share/bats/bats-support" + runHook postInstall ''; meta = { description = "Supporting library for Bats test helpers"; @@ -94,5 +100,5 @@ license = lib.licenses.cc0; maintainers = with lib.maintainers; [ infinisil ]; }; - }; + }); } From bb05714df4e46528c1c72877e9f3529e5ae74b70 Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Tue, 28 Nov 2023 21:58:52 +0100 Subject: [PATCH 4/4] maintainers: add brokenpip3 --- maintainers/maintainer-list.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 40c1c894f955..a268dcc93611 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -2605,6 +2605,13 @@ githubId = 1071610; name = "Gunnar Nitsche"; }; + brokenpip3 = { + email = "brokenpip3@gmail.com"; + matrix = "@brokenpip3:matrix.org"; + github = "brokenpip3"; + githubId = 40476330; + name = "brokenpip3"; + }; bryanasdev000 = { email = "bryanasdev000@gmail.com"; matrix = "@bryanasdev000:matrix.org";