brandboat commented on code in PR #887:
URL: https://github.com/apache/yunikorn-k8shim/pull/887#discussion_r1705340198
##########
pkg/admission/util_test.go:
##########
@@ -189,3 +190,18 @@ func TestDefaultQueueName(t *testing.T) {
t.Fatal("UpdatePodLabelForAdmissionController is not as
expected")
}
}
+
+func TestConvert2Namespace(t *testing.T) {
+ configMap := &v1.Namespace{}
+ result := convert2Namespace(configMap)
+ assert.Equal(t, result != nil, true)
+ assert.Equal(t, reflect.DeepEqual(result, configMap), true)
Review Comment:
```suggestion
assert.Check(t, reflect.DeepEqual(result, configMap))
```
##########
pkg/admission/util_test.go:
##########
@@ -189,3 +190,18 @@ func TestDefaultQueueName(t *testing.T) {
t.Fatal("UpdatePodLabelForAdmissionController is not as
expected")
}
}
+
+func TestConvert2Namespace(t *testing.T) {
+ configMap := &v1.Namespace{}
Review Comment:
could we rename to namespace ?
##########
pkg/admission/util_test.go:
##########
@@ -189,3 +190,18 @@ func TestDefaultQueueName(t *testing.T) {
t.Fatal("UpdatePodLabelForAdmissionController is not as
expected")
}
}
+
+func TestConvert2Namespace(t *testing.T) {
+ configMap := &v1.Namespace{}
+ result := convert2Namespace(configMap)
+ assert.Equal(t, result != nil, true)
+ assert.Equal(t, reflect.DeepEqual(result, configMap), true)
+
+ obj := struct{}{}
+ result = convert2Namespace(obj)
+ assert.Equal(t, result == nil, true)
+
+ pod := &v1.Pod{}
+ result = convert2Namespace(pod)
+ assert.Equal(t, result == nil, true)
Review Comment:
```suggestion
assert.Check(t, result == nil)
```
##########
pkg/admission/util_test.go:
##########
@@ -189,3 +190,18 @@ func TestDefaultQueueName(t *testing.T) {
t.Fatal("UpdatePodLabelForAdmissionController is not as
expected")
}
}
+
+func TestConvert2Namespace(t *testing.T) {
+ configMap := &v1.Namespace{}
+ result := convert2Namespace(configMap)
+ assert.Equal(t, result != nil, true)
Review Comment:
```suggestion
assert.Check(t, result != nil)
```
##########
pkg/admission/util_test.go:
##########
@@ -189,3 +190,18 @@ func TestDefaultQueueName(t *testing.T) {
t.Fatal("UpdatePodLabelForAdmissionController is not as
expected")
}
}
+
+func TestConvert2Namespace(t *testing.T) {
+ configMap := &v1.Namespace{}
+ result := convert2Namespace(configMap)
+ assert.Equal(t, result != nil, true)
+ assert.Equal(t, reflect.DeepEqual(result, configMap), true)
+
+ obj := struct{}{}
+ result = convert2Namespace(obj)
+ assert.Equal(t, result == nil, true)
Review Comment:
```suggestion
assert.Check(t, result == nil)
```
##########
pkg/admission/util_test.go:
##########
@@ -189,3 +190,18 @@ func TestDefaultQueueName(t *testing.T) {
t.Fatal("UpdatePodLabelForAdmissionController is not as
expected")
}
}
+
+func TestConvert2Namespace(t *testing.T) {
+ configMap := &v1.Namespace{}
+ result := convert2Namespace(configMap)
+ assert.Equal(t, result != nil, true)
Review Comment:
```suggestion
assert.Check(t, result != nil)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]