E2e test for run with json

This commit is contained in:
Phani Teja Marupaka
2020-06-08 20:51:01 -07:00
parent b39c522cc1
commit e994b3b566
9 changed files with 76 additions and 122 deletions

View File

@@ -194,32 +194,14 @@ func TestSourceCommandJSON(t *testing.T) {
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
kind: ResourceList
items:
- kind: Deployment
metadata:
annotations:
app: nginx2
config.kubernetes.io/format: 'json'
config.kubernetes.io/index: '0'
config.kubernetes.io/path: 'f1.json'
labels:
app: nginx2
name: foo
spec:
replicas: 1
- apiVersion: v1
kind: Abstraction
metadata:
annotations:
config.kubernetes.io/function: |
container:
image: gcr.io/example/reconciler:v1
config.kubernetes.io/local-config: "true"
config.kubernetes.io/format: 'json'
config.kubernetes.io/index: '0'
config.kubernetes.io/path: 'f2.json'
name: foo
spec:
replicas: 3
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
"annotations": {"app": "nginx2", config.kubernetes.io/format: 'json', config.kubernetes.io/index: '0',
config.kubernetes.io/path: 'f1.json'}}, "spec": {"replicas": 1}}
- {"apiVersion": "v1", "kind": "Abstraction", "metadata": {"name": "foo", "annotations": {
"config.kubernetes.io/function": "container:\n image: gcr.io/example/reconciler:v1\n",
"config.kubernetes.io/local-config": "true", config.kubernetes.io/format: 'json',
config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f2.json'}}, "spec": {
"replicas": 3}}
`, b.String()) {
return
}
@@ -326,17 +308,9 @@ func TestSourceCommandJSON_Stdin(t *testing.T) {
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
kind: ResourceList
items:
- kind: Deployment
metadata:
annotations:
app: nginx2
config.kubernetes.io/format: 'json'
config.kubernetes.io/index: '0'
labels:
app: nginx2
name: foo
spec:
replicas: 1
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
"annotations": {"app": "nginx2", config.kubernetes.io/format: 'json', config.kubernetes.io/index: '0'}},
"spec": {"replicas": 1}}
`, out.String()) {
return
}