tfk8s: add passthru.tests.sample1

This commit is contained in:
superherointj 2021-07-14 07:53:00 -03:00
parent 0bac0bfd72
commit 909c6f0394
4 changed files with 35 additions and 1 deletions

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, callPackage }:
buildGoModule rec {
pname = "tfk8s";
@ -30,6 +30,10 @@ buildGoModule rec {
$out/bin/tfk8s --version | grep ${tag} > /dev/null
'';
passthru.tests = {
sample1 = callPackage ./tests/sample1 { };
};
meta = with lib; {
description = "An utility to convert Kubernetes YAML manifests to Terraform's HCL format";
license = licenses.mit;

View file

@ -0,0 +1,11 @@
{ runCommandCC, tfk8s }:
runCommandCC "tfk8s-test-sample1" {
buildInputs = [
tfk8s
];
meta.timeout = 60;
}
''
cmp <(${tfk8s}/bin/tfk8s -f ${./input.yaml}) ${./output.tf} > $out
''

View file

@ -0,0 +1,7 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: test
data:
TEST: test

View file

@ -0,0 +1,12 @@
resource "kubernetes_manifest" "configmap_test" {
manifest = {
"apiVersion" = "v1"
"data" = {
"TEST" = "test"
}
"kind" = "ConfigMap"
"metadata" = {
"name" = "test"
}
}
}