Closed Skarlso closed 3 months ago
✗ ./cty test sample-tests
+-----------------------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
| IT | MATCHER | ERROR | TEMPLATE |
+-----------------------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
| matches AWSCluster crds correctly | matchSnapshot | <nil> | sample-tests/crds/infrastructure.cluster.x-k8s.io_awsclusters.yaml |
| matches AWSCluster crds correctly | matchSnapshot | <nil> | sample-tests/crds/infrastructure.cluster.x-k8s.io_awsclusters.yaml |
| matches AWSCluster crds correctly | matchString | <nil> | sample-tests/crds/infrastructure.cluster.x-k8s.io_awsclusters.yaml |
| matches AWSCluster crds correctly | matchString | matcher returned failure: failed to validate kind AWSCluster: spec.controlPlaneEndpoint.host in body must be of type string: "number" | sample-tests/crds/infrastructure.cluster.x-k8s.io_awsclusters.yaml |
| matches bootstrap crds correctly | matchSnapshot | <nil> | sample-tests/crds/bootstrap_crd.yaml |
| matches bootstrap crds correctly | matchSnapshot | <nil> | sample-tests/crds/bootstrap_crd.yaml |
| matches some custom stuff | matchString | <nil> | sample-tests/crds/bootstrap_crd.yaml |
+-----------------------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
Tests total: 7, failed: 1, passed: 6
➜ crd-to-sample-yaml git:(add-crd-test-command-and-github-action-config) ✗ echo $?
1
➜ crd-to-sample-yaml git:(add-crd-test-command-and-github-action-config) ✗
That's better.
Added some color and wrapping of long text into the mix.
Arguably the output could be nicer and the failure including the HELP of the command is ugly.