mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
fmt
This commit is contained in:
parent
c3fa598922
commit
db6d83c61e
53 changed files with 1916 additions and 1599 deletions
|
|
@ -1,12 +1,11 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
testing = config.testing;
|
||||
cfg = testing.driver.kubetest;
|
||||
|
||||
kubetest = import ./kubetestdrv.nix {inherit pkgs;};
|
||||
kubetest = import ./kubetestdrv.nix { inherit pkgs; };
|
||||
|
||||
pythonEnv = pkgs.python38.withPackages (ps: with ps; [
|
||||
pytest
|
||||
|
|
@ -16,18 +15,20 @@ let
|
|||
|
||||
toTestScript = t:
|
||||
if isString t.script
|
||||
then pkgs.writeText "${t.name}.py" ''
|
||||
${cfg.defaultHeader}
|
||||
${t.script}
|
||||
''
|
||||
then
|
||||
pkgs.writeText "${t.name}.py" ''
|
||||
${cfg.defaultHeader}
|
||||
${t.script}
|
||||
''
|
||||
else t.script;
|
||||
|
||||
tests = pkgs.linkFarm "${testing.name}-tests" (
|
||||
map (t: {
|
||||
path = toTestScript t;
|
||||
name = "${t.name}_test.py";
|
||||
})
|
||||
( filter (t: t.script != null) testing.tests )
|
||||
map
|
||||
(t: {
|
||||
path = toTestScript t;
|
||||
name = "${t.name}_test.py";
|
||||
})
|
||||
(filter (t: t.script != null) testing.tests)
|
||||
);
|
||||
|
||||
testScript = pkgs.writeScript "test-${testing.name}.sh" ''
|
||||
|
|
@ -35,7 +36,8 @@ let
|
|||
${pythonEnv}/bin/pytest -p no:cacheprovider ${tests} $@
|
||||
'';
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.testing.driver.kubetest = {
|
||||
defaultHeader = mkOption {
|
||||
type = types.lines;
|
||||
|
|
@ -48,7 +50,7 @@ in {
|
|||
extraPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
description = "Extra packages to pass to tests";
|
||||
default = [];
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue