@@ -29,7 +29,10 @@ import (
29
29
30
30
func Test_NoInspectReconcile_IfNoDeployAttempted (t * testing.T ) {
31
31
log := logf .Log .WithName ("kc" )
32
- var appMetrics = metrics .NewAppMetrics ()
32
+ var (
33
+ appMetrics = metrics .NewAppMetrics ()
34
+ timeMetrics = metrics .NewReconcileTimeMetrics ()
35
+ )
33
36
34
37
// The url under fetch is invalid, which will cause this
35
38
// app to fail before deploy.
@@ -52,7 +55,7 @@ func Test_NoInspectReconcile_IfNoDeployAttempted(t *testing.T) {
52
55
tmpFac := template .NewFactory (k8scs , fetchFac , false , exec .NewPlainCmdRunner ())
53
56
deployFac := deploy .NewFactory (k8scs , kubeconfig .NewKubeconfig (k8scs , log ), nil , exec .NewPlainCmdRunner (), log )
54
57
55
- crdApp := NewCRDApp (& app , log , appMetrics , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
58
+ crdApp := NewCRDApp (& app , log , appMetrics , timeMetrics , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
56
59
_ , err := crdApp .Reconcile (false )
57
60
assert .Nil (t , err , "unexpected error with reconciling" , err )
58
61
@@ -86,7 +89,10 @@ func Test_NoInspectReconcile_IfNoDeployAttempted(t *testing.T) {
86
89
87
90
func Test_NoInspectReconcile_IfInspectNotEnabled (t * testing.T ) {
88
91
log := logf .Log .WithName ("kc" )
89
- var appMetrics = metrics .NewAppMetrics ()
92
+ var (
93
+ appMetrics = metrics .NewAppMetrics ()
94
+ timeMetrics = metrics .NewReconcileTimeMetrics ()
95
+ )
90
96
91
97
app := v1alpha1.App {
92
98
ObjectMeta : metav1.ObjectMeta {
@@ -119,7 +125,7 @@ func Test_NoInspectReconcile_IfInspectNotEnabled(t *testing.T) {
119
125
tmpFac := template .NewFactory (k8scs , fetchFac , false , exec .NewPlainCmdRunner ())
120
126
deployFac := deploy .NewFactory (k8scs , kubeconfig .NewKubeconfig (k8scs , log ), nil , exec .NewPlainCmdRunner (), log )
121
127
122
- crdApp := NewCRDApp (& app , log , appMetrics , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
128
+ crdApp := NewCRDApp (& app , log , appMetrics , timeMetrics , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
123
129
_ , err := crdApp .Reconcile (false )
124
130
assert .Nil (t , err , "unexpected error with reconciling" , err )
125
131
@@ -164,7 +170,10 @@ func Test_NoInspectReconcile_IfInspectNotEnabled(t *testing.T) {
164
170
165
171
func Test_TemplateError_DisplayedInStatus_UsefulErrorMessageProperty (t * testing.T ) {
166
172
log := logf .Log .WithName ("kc" )
167
- var appMetrics = metrics .NewAppMetrics ()
173
+ var (
174
+ appMetrics = metrics .NewAppMetrics ()
175
+ timeMetrics = metrics .NewReconcileTimeMetrics ()
176
+ )
168
177
169
178
fetchInline := map [string ]string {
170
179
"file.yml" : `foo: #@ data.values.nothere` ,
@@ -191,7 +200,7 @@ func Test_TemplateError_DisplayedInStatus_UsefulErrorMessageProperty(t *testing.
191
200
tmpFac := template .NewFactory (k8scs , fetchFac , false , exec .NewPlainCmdRunner ())
192
201
deployFac := deploy .NewFactory (k8scs , kubeconfig .NewKubeconfig (k8scs , log ), nil , exec .NewPlainCmdRunner (), log )
193
202
194
- crdApp := NewCRDApp (& app , log , appMetrics , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
203
+ crdApp := NewCRDApp (& app , log , appMetrics , timeMetrics , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
195
204
_ , err := crdApp .Reconcile (false )
196
205
assert .Nil (t , err , "Unexpected error with reconciling" , err )
197
206
0 commit comments