mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Use ExpectNotEqual in test/e2e/network/
This commit is contained in:
		@@ -46,6 +46,15 @@ do
 | 
			
		||||
    fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
errors_expect_no_equal=()
 | 
			
		||||
for file in "${all_e2e_files[@]}"
 | 
			
		||||
do
 | 
			
		||||
    if grep -E "Expect\(.*\)\.(NotTo|ToNot)\((gomega\.Equal|Equal)" "${file}" > /dev/null
 | 
			
		||||
    then
 | 
			
		||||
        errors_expect_no_equal+=( "${file}" )
 | 
			
		||||
    fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
errors_expect_equal=()
 | 
			
		||||
for file in "${all_e2e_files[@]}"
 | 
			
		||||
do
 | 
			
		||||
@@ -83,6 +92,20 @@ if [ ${#errors_expect_error[@]} -ne 0 ]; then
 | 
			
		||||
  exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ ${#errors_expect_no_equal[@]} -ne 0 ]; then
 | 
			
		||||
  {
 | 
			
		||||
    echo "Errors:"
 | 
			
		||||
    for err in "${errors_expect_no_equal[@]}"; do
 | 
			
		||||
      echo "$err"
 | 
			
		||||
    done
 | 
			
		||||
    echo
 | 
			
		||||
    echo 'The above files need to use framework.ExpectNotEqual(foo, bar) instead of '
 | 
			
		||||
    echo 'Expect(foo).NotTo(Equal(bar)) or gomega.Expect(foo).NotTo(gomega.Equal(bar))'
 | 
			
		||||
    echo
 | 
			
		||||
  } >&2
 | 
			
		||||
  exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ ${#errors_expect_equal[@]} -ne 0 ]; then
 | 
			
		||||
  {
 | 
			
		||||
    echo "Errors:"
 | 
			
		||||
 
 | 
			
		||||
@@ -935,7 +935,7 @@ var _ = SIGDescribe("Services", func() {
 | 
			
		||||
		pausePods, err := cs.CoreV1().Pods(ns).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()})
 | 
			
		||||
		framework.ExpectNoError(err, "Error in listing pods associated with pause pod deployments")
 | 
			
		||||
 | 
			
		||||
		gomega.Expect(pausePods.Items[0].Spec.NodeName).ToNot(gomega.Equal(pausePods.Items[1].Spec.NodeName))
 | 
			
		||||
		framework.ExpectNotEqual(pausePods.Items[0].Spec.NodeName, pausePods.Items[1].Spec.NodeName)
 | 
			
		||||
 | 
			
		||||
		serviceAddress := net.JoinHostPort(serviceIP, strconv.Itoa(servicePort))
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user