mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
compat nixpkgs and change to testing-python.nix
This commit is contained in:
parent
842c903201
commit
8f0e518bc0
3 changed files with 36 additions and 9 deletions
17
lib/compat.nix
Normal file
17
lib/compat.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
let
|
||||
inherit (builtins)
|
||||
fetchTarball
|
||||
fromJSON
|
||||
readFile
|
||||
;
|
||||
lockfile = fromJSON (readFile ../flake.lock);
|
||||
in
|
||||
input:
|
||||
let
|
||||
locked = lockfile.nodes."${input}".locked;
|
||||
inherit (locked) rev narHash owner repo;
|
||||
in
|
||||
fetchTarball {
|
||||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
|
||||
sha256 = narHash;
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ let
|
|||
|
||||
toJSONFile = content: builtins.toFile "json" (builtins.toJSON content);
|
||||
|
||||
nixosTesting = import "${nixosPath}/lib/testing.nix" {
|
||||
nixosTesting = import "${nixosPath}/lib/testing-python.nix" {
|
||||
inherit pkgs;
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
|
|
|
|||
22
release.nix
22
release.nix
|
|
@ -1,5 +1,12 @@
|
|||
{ pkgs ? import <nixpkgs> {}, nixosPath ? toString <nixpkgs/nixos>, lib ? pkgs.lib
|
||||
, e2e ? true, throwError ? true }:
|
||||
let
|
||||
fetch = import ./lib/compat.nix;
|
||||
in
|
||||
{ pkgs ? import (fetch "nixpkgs") { }
|
||||
, nixosPath ? toString (fetch "nixpkgs") + "/nixos"
|
||||
, lib ? pkgs.lib
|
||||
, e2e ? true
|
||||
, throwError ? true
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
|
|
@ -23,7 +30,8 @@ let
|
|||
runK8STests = k8sVersion: import ./tests {
|
||||
inherit pkgs lib kubenix k8sVersion e2e throwError nixosPath;
|
||||
};
|
||||
in rec {
|
||||
in
|
||||
rec {
|
||||
generate.k8s = pkgs.linkFarm "k8s-generated.nix" [
|
||||
{
|
||||
name = "v1.8.nix";
|
||||
|
|
@ -130,15 +138,17 @@ in rec {
|
|||
k8s-1_18 = runK8STests "1.18";
|
||||
};
|
||||
|
||||
test-results = pkgs.recurseIntoAttrs (mapAttrs (_: t: pkgs.recurseIntoAttrs {
|
||||
test-results = pkgs.recurseIntoAttrs (mapAttrs
|
||||
(_: t: pkgs.recurseIntoAttrs {
|
||||
results = pkgs.recurseIntoAttrs t.results;
|
||||
result = t.result;
|
||||
}) tests);
|
||||
})
|
||||
tests);
|
||||
|
||||
test-check =
|
||||
if !(all (test: test.success) (attrValues tests))
|
||||
then throw "tests failed"
|
||||
else true;
|
||||
|
||||
examples = import ./examples {};
|
||||
examples = import ./examples { };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue