bitnami / kube-libsonnet

Bitnami's jsonnet library for building Kubernetes manifests
https://bitnami.com
Apache License 2.0
174 stars 50 forks source link

[jjo] rollback Ingress apiVersion, better testing #29

Closed jjo closed 4 years ago

jjo commented 4 years ago
jjo commented 4 years ago

FYI example tests output:

$ make tests
make -C tests
make[1]: Entering directory '/home/jjo/go/src/github.com/bitnami-labs/kube-libsonnet/tests'
install -d ./tmp-rancher ./tmp-rancher/etc && touch ./tmp-rancher/etc/k3s.yaml
docker-compose -p kubelibsonnet up -d
Creating network "kubelibsonnet_default" with the default driver
Creating k3s-api ...
Creating k3s-api ... done
Creating e2e-test ...
Creating e2e-test ... done
rc=$(docker wait e2e-test); docker logs e2e-test; docker-compose -p kubelibsonnet down; exit $rc
INFO: Starting tests: unit, lint ...
make: Entering directory '/work/tests'
jsonnet unittests.jsonnet
true
jsonnet test-sealedsecrets.jsonnet > /dev/null
jsonnet test-sealedsecrets-datalines.jsonnet > /dev/null
jsonnet unittests.jsonnet > /dev/null
jsonnet test-simple-validate.jsonnet > /dev/null
NOTE: if the 'diff' target fails, review output and run:
      make gen-golden diff

diff -u golden/test-sealedsecrets.json <(jsonnet test-sealedsecrets.jsonnet)
diff -u golden/test-sealedsecrets-datalines.json <(jsonnet test-sealedsecrets-datalines.jsonnet)
diff -u golden/unittests.json <(jsonnet unittests.jsonnet)
diff -u golden/test-simple-validate.json <(jsonnet test-simple-validate.jsonnet)
make: Leaving directory '/work/tests'
INFO: Waiting for kube-api to be available ...
The connection to the server localhost:8080 was refused - did you specify the right host or port?
The connection to the server localhost:8080 was refused - did you specify the right host or port?
The connection to the server localhost:8080 was refused - did you specify the right host or port?
No resources found.
INFO: Starting tests: validate ...
+ make -C tests test-kube
make: Entering directory '/work/tests'
timeout 10 kubectl api-versions > /dev/null \
|| { echo "WARNING: no usable runtime kube context, skipping."; exit 0 ;} \
&& kubectl version --short && kubecfg version && kubecfg validate --ignore-unknown=false test-simple-validate.jsonnet
Client Version: v1.13.0
Server Version: v1.13.5-k3s.1
kubecfg version: v0.12.0
jsonnet version: v0.12.0
client-go version: v0.0.0-master+$Format:%h$
Validating configmaps foons.foo-config
validate object "/v1, Kind=ConfigMap"
Validating cronjobs foons.foo-cronjob
validate object "batch/v1beta1, Kind=CronJob"
Validating deployments foons.foo-deploy
validate object "apps/v1, Kind=Deployment"
Validating daemonsets foons.foo-ds
validate object "apps/v1, Kind=DaemonSet"
Validating ingresses foons.foo-ingress
validate object "extensions/v1beta1, Kind=Ingress"
Validating jobs foons.foo-job
validate object "batch/v1, Kind=Job"
Validating namespaces foons
validate object "/v1, Kind=Namespace"
Validating networkpolicies foons.foo-nsp-pods
validate object "networking.k8s.io/v1, Kind=NetworkPolicy"
Validating pods foons.foo-pod
validate object "/v1, Kind=Pod"
Validating roles foons.foo-role
validate object "rbac.authorization.k8s.io/v1beta1, Kind=Role"
Validating rolebindings foons.foo-rolebinding
validate object "rbac.authorization.k8s.io/v1beta1, Kind=RoleBinding"
Validating serviceaccounts foons.foo-sa
validate object "/v1, Kind=ServiceAccount"
Validating secrets foons.foo-secret
validate object "/v1, Kind=Secret"
Validating services foons.foo-svc
validate object "/v1, Kind=Service"
Validating statefulsets foons.foo-sts
validate object "apps/v1, Kind=StatefulSet"
make: Leaving directory '/work/tests'
Stopping k3s-api ... done
Removing e2e-test ... done
Removing k3s-api  ... done
Removing network kubelibsonnet_default
rm -rf ././tmp-rancher
make[1]: Leaving directory '/home/jjo/go/src/github.com/bitnami-labs/kube-libsonnet/tests'
jjo commented 4 years ago

Travis tests fixed at c357ec8 :tada: