Skip to content

Instantly share code, notes, and snippets.

@jorgemoralespou
Last active July 25, 2023 17:50
Show Gist options
  • Save jorgemoralespou/ab8f598822ba00b58e1d903cfe5e9891 to your computer and use it in GitHub Desktop.
Save jorgemoralespou/ab8f598822ba00b58e1d903cfe5e9891 to your computer and use it in GitHub Desktop.
ytt tests
#@ load("@ytt:data","data")
#@ load("@ytt:yaml","yaml")
#@ load("@ytt:struct","struct")
---
#@ tests = []
#@ test_defintions = data.read("/tests.yaml")
#@ for i in test_defintions.split("---"):
#@ value = struct.encode(yaml.decode(i))
#@ if type(value) != "NoneType":
#@ tests.append(value["metadata"]["name"])
#@ end
#@ end
tests: #@ tests
---
kind: Test
metadata:
name: test-1
---
kind: Test
metadata:
name: test-2
---
kind: Test
metadata:
name: test-3
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment