fix: test kubernetes manifest

nix-repl> test-nginx = g.config.testing.testsByName.nginx-deployment.evaled.config.kubernetes.resources.deployments.nginx
nix-repl> test-nginx.spec.template.spec.containers.nginx.image
"nginx:dy4y4j45arjj9sgyjb90sv035sxglpv8"

vs

nix-repl> nginx = g.config.kubernetes.resources.deployments.nginx
nix-repl> nginx.spec.template.spec.containers.nginx.image
"docker.io/gatehub/nginx:dy4y4j45arjj9sgyjb90sv035sxglpv8"
This commit is contained in:
David Arnold 2021-05-31 21:45:22 -05:00
parent 80d3a595f5
commit 0c99276b50
No known key found for this signature in database
GPG key ID: 6D6A936E69C59D08
3 changed files with 5 additions and 5 deletions

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, kubenix, ... }: { config, lib, pkgs, kubenix, test, ... }:
with lib; with lib;
@ -9,7 +9,7 @@ with lib;
name = "nginx-deployment"; name = "nginx-deployment";
description = "Test testing nginx deployment"; description = "Test testing nginx deployment";
script = '' script = ''
@pytest.mark.applymanifest('${config.kubernetes.resultYAML}') @pytest.mark.applymanifest('${test.kubernetes.resultYAML}')
def test_nginx_deployment(kube): def test_nginx_deployment(kube):
"""Tests whether nginx deployment gets successfully created""" """Tests whether nginx deployment gets successfully created"""

View file

@ -15,7 +15,7 @@ let
kubenix.project = mkDefault config.name; kubenix.project = mkDefault config.name;
_module.args = { _module.args = {
inherit kubenix; inherit kubenix;
test = config; test = evaled.config;
} // testing.args; } // testing.args;
}; };
} }

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, kubenix, images, ... }: { config, lib, pkgs, kubenix, images, test, ... }:
with lib; with lib;
let let
@ -47,7 +47,7 @@ in
script = '' script = ''
import time import time
@pytest.mark.applymanifest('${config.kubernetes.resultYAML}') @pytest.mark.applymanifest('${test.kubernetes.resultYAML}')
def test_deployment(kube): def test_deployment(kube):
"""Tests whether deployment gets successfully created""" """Tests whether deployment gets successfully created"""