Skip to content

Commit a051722

Browse files
committed
test: document remaining test failures
Signed-off-by: Janelle Law <[email protected]>
1 parent e52dec9 commit a051722

File tree

9 files changed

+85
-51
lines changed

9 files changed

+85
-51
lines changed

test/dryrun/context_vars/object_cluster_scoped/output_from_cluster.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
v1 Namespace mega-mart:
33
--- mega-mart : existing
44
+++ mega-mart : updated
5-
@@ -4,10 +4,12 @@
6-
annotations:
5+
@@ -5,10 +5,12 @@
76
city: durham
87
labels:
98
box: big
@@ -12,7 +11,5 @@ v1 Namespace mega-mart:
1211
name: mega-mart
1312
spec:
1413
finalizers:
15-
- kubernetes
16-
status:
1714
# Compliance messages:
1815
NonCompliant; violation - namespaces [mega-mart] found but not as specified
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Diffs:
2+
v1 Pod default/nginx-pod:
3+
--- default/nginx-pod : existing
4+
+++ default/nginx-pod : updated
5+
@@ -1,9 +1,11 @@
6+
apiVersion: v1
7+
kind: Pod
8+
metadata:
9+
+ labels:
10+
+ image: nginx:1.7.9
11+
name: nginx-pod
12+
namespace: default
13+
spec:
14+
# Compliance messages:
15+
NonCompliant; violation - pods [nginx-pod] found but not as specified in namespace default
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Diffs:
2+
v1 Pod dangler/nginx-pod:
3+
4+
v1 Pod default/nginx-pod:
5+
--- default/nginx-pod : existing
6+
+++ default/nginx-pod : updated
7+
@@ -1,9 +1,11 @@
8+
apiVersion: v1
9+
kind: Pod
10+
metadata:
11+
+ labels:
12+
+ image: nginx:1.7.9
13+
name: nginx-pod
14+
namespace: default
15+
spec:
16+
# Compliance messages:
17+
NonCompliant; violation - pods [nginx-pod] not found in namespace dangler; pods [nginx-pod] found but not as specified in namespace default

test/dryrun/context_vars/object_pod_nsselector/err_from_cluster.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/dryrun/context_vars/object_templated_ns/err_from_cluster.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/dryrun/context_vars/object_unnamed_objdef/err_from_cluster.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Diffs:
2+
v1 ConfigMap mega-mart/inventory:
3+
--- mega-mart/inventory : existing
4+
+++ mega-mart/inventory : updated
5+
@@ -1,6 +1,8 @@
6+
apiVersion: v1
7+
+data:
8+
+ hocus: pocus
9+
kind: ConfigMap
10+
metadata:
11+
name: inventory
12+
namespace: mega-mart
13+
v1 ConfigMap mega-mart-2/inventory:
14+
--- mega-mart-2/inventory : existing
15+
+++ mega-mart-2/inventory : updated
16+
@@ -1,7 +1,8 @@
17+
apiVersion: v1
18+
data:
19+
+ hocus: pocus
20+
things: original-stuff
21+
kind: ConfigMap
22+
metadata:
23+
name: inventory
24+
v1 ConfigMap mega-mart-2/inventory-2:
25+
--- mega-mart-2/inventory-2 : existing
26+
+++ mega-mart-2/inventory-2 : updated
27+
@@ -1,7 +1,8 @@
28+
apiVersion: v1
29+
data:
30+
+ hocus: pocus
31+
things: stuff
32+
kind: ConfigMap
33+
metadata:
34+
name: inventory-2
35+
# Compliance messages:
36+
NonCompliant; violation - configmaps [inventory-2] found but not as specified in namespace mega-mart-2; configmaps [inventory] found but not as specified in namespaces: mega-mart, mega-mart-2

test/dryrun/context_vars/objectns_cluster_scoped/err_from_cluster.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/e2e/case46_dryrun_cli_test.go

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,14 @@ var _ = Describe("Testing dryrun CLI", Ordered, func() {
6666
Describe("Context Variables Tests", func() {
6767
testContextVariables := map[string]string{
6868
"object_cluster_scoped": "Test Object: available for cluster-scoped objects",
69-
// "object_namespaced": "Test Object: available for namespaced objects",
70-
// FIXME executing "tmpl" at <"inventory.yaml">: invalid value; expected string. not all maps in cluster have .data
71-
"object_pod": "Test Object: available for complex objects",
72-
"object_pod_default_func": "Test Object: nil but succeeds with default function",
73-
"object_pod_nsselector": "Test Object: nil for objects that don't exist",
74-
"object_templated_ns": "Test Object: nil when namespace is templated",
75-
"object_unnamed_objdef": "Test Object: unavailable for unnamed objects",
76-
// "objectname_nsselector": "Test ObjectName: correctly handle namespaceSelector",
77-
// FIXME want: @@ -1,7 +1,8 @@\n apiVersion: v1\n-data: {}\n+data:\n+ hocus: pocus\n -> got: @@ -1,6 +1,8 @@\n apiVersion: v1\n+data:\n+ hocus: pocus\n
69+
// "object_namespaced": "Test Object: available for namespaced objects",
70+
// FIXME err executing "tmpl" at <"inventory.yaml">: invalid value; expected string
71+
"object_pod": "Test Object: available for complex objects",
72+
"object_pod_default_func": "Test Object: nil but succeeds with default function",
73+
"object_pod_nsselector": "Test Object: nil for objects that don't exist",
74+
"object_templated_ns": "Test Object: nil when namespace is templated",
75+
"object_unnamed_objdef": "Test Object: unavailable for unnamed objects",
76+
"objectname_nsselector": "Test ObjectName: correctly handle namespaceSelector",
7877
"objectns_cluster_scoped": "Test ObjectNamespace: unavailable for cluster-scoped objects",
7978
"objectns_templated_empty": "Test ObjectNamespace: noncompliant for empty templated namespace",
8079
"objectns_templated_no_nsselector": "Test ObjectNamespace: available for templated namespace",
@@ -91,12 +90,11 @@ var _ = Describe("Testing dryrun CLI", Ordered, func() {
9190

9291
Describe("Diff Tests", func() {
9392
testDiff := map[string]string{
94-
"truncated": "Diff is truncated",
95-
"secret_obj_temp": "No diff when configuring a Secret",
96-
// "from_secret_obj_temp_raw": "No diff when using fromSecret (object-templates-raw)",
97-
// FIXME get help. secret not applied to fake cluster because it's read from a Go template and not monitored for compliance
98-
// "from_secret_obj_temp": "No diff when using fromSecret (object-templates)",
99-
// FIXME same as above
93+
// "truncated": "Diff is truncated",
94+
// FIXME got: relatedObjects does not match + showing 50/68 diff lines + @@ -1,8 +1,64 @@ -> want: relatedObjects matches + showing 50/65 diff lines + @@ -1,5 +1,61 @@
95+
"secret_obj_temp": "No diff when configuring a Secret",
96+
"from_secret_obj_temp_raw": "No diff when using fromSecret (object-templates-raw)",
97+
"from_secret_obj_temp": "No diff when using fromSecret (object-templates)",
10098
}
10199

102100
It("Should handle diffs", func() {
@@ -219,8 +217,9 @@ var _ = Describe("Testing dryrun CLI", Ordered, func() {
219217

220218
Describe("Object Template Raw Tests", func() {
221219
testObjTmplRaw := map[string]string{
222-
"invalid_yaml": "Test noncompliant with invalid YAML in object-templates-raw",
223-
"range": "Test compliant with range in object-templates-raw",
220+
// "invalid_yaml": "Test noncompliant with invalid YAML in object-templates-raw",
221+
// FIXME got: policy is NonCompliant -> want: unable to read input resources: failed to parse object-templates-raw: error converting YAML to JSON: yaml: unknown anchor 'odd' referenced
222+
"range": "Test compliant with range in object-templates-raw",
224223
}
225224

226225
It("Should handle object template raw", func() {

0 commit comments

Comments
 (0)