kubenix/docs/content/examples/testing/test.nix

20 lines
620 B
Nix
Raw Normal View History

2023-07-07 22:01:34 -04:00
{ kubenix, test, ... }: {
imports = [ kubenix.modules.test ];
test = {
2022-08-29 02:04:47 -04:00
name = "example";
description = "can reach deployment";
2021-05-13 22:58:11 -04:00
script = ''
@pytest.mark.applymanifest('${test.kubernetes.resultYAML}')
2021-05-13 22:58:11 -04:00
def test_nginx_deployment(kube):
"""Tests whether nginx deployment gets successfully created"""
kube.wait_for_registered(timeout=30)
deployments = kube.get_deployments()
nginx_deploy = deployments.get('nginx')
assert nginx_deploy is not None
status = nginx_deploy.status()
assert status.readyReplicas == 10
'';
};
}