mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +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);
|
toJSONFile = content: builtins.toFile "json" (builtins.toJSON content);
|
||||||
|
|
||||||
nixosTesting = import "${nixosPath}/lib/testing.nix" {
|
nixosTesting = import "${nixosPath}/lib/testing-python.nix" {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
22
release.nix
22
release.nix
|
|
@ -1,5 +1,12 @@
|
||||||
{ pkgs ? import <nixpkgs> {}, nixosPath ? toString <nixpkgs/nixos>, lib ? pkgs.lib
|
let
|
||||||
, e2e ? true, throwError ? true }:
|
fetch = import ./lib/compat.nix;
|
||||||
|
in
|
||||||
|
{ pkgs ? import (fetch "nixpkgs") { }
|
||||||
|
, nixosPath ? toString (fetch "nixpkgs") + "/nixos"
|
||||||
|
, lib ? pkgs.lib
|
||||||
|
, e2e ? true
|
||||||
|
, throwError ? true
|
||||||
|
}:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
|
@ -23,7 +30,8 @@ let
|
||||||
runK8STests = k8sVersion: import ./tests {
|
runK8STests = k8sVersion: import ./tests {
|
||||||
inherit pkgs lib kubenix k8sVersion e2e throwError nixosPath;
|
inherit pkgs lib kubenix k8sVersion e2e throwError nixosPath;
|
||||||
};
|
};
|
||||||
in rec {
|
in
|
||||||
|
rec {
|
||||||
generate.k8s = pkgs.linkFarm "k8s-generated.nix" [
|
generate.k8s = pkgs.linkFarm "k8s-generated.nix" [
|
||||||
{
|
{
|
||||||
name = "v1.8.nix";
|
name = "v1.8.nix";
|
||||||
|
|
@ -130,15 +138,17 @@ in rec {
|
||||||
k8s-1_18 = runK8STests "1.18";
|
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;
|
results = pkgs.recurseIntoAttrs t.results;
|
||||||
result = t.result;
|
result = t.result;
|
||||||
}) tests);
|
})
|
||||||
|
tests);
|
||||||
|
|
||||||
test-check =
|
test-check =
|
||||||
if !(all (test: test.success) (attrValues tests))
|
if !(all (test: test.success) (attrValues tests))
|
||||||
then throw "tests failed"
|
then throw "tests failed"
|
||||||
else true;
|
else true;
|
||||||
|
|
||||||
examples = import ./examples {};
|
examples = import ./examples { };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue